Video Screencast Help
Scheduled Maintenance: Symantec Connect is scheduled to be down Saturday, April 19 from 10am to 2pm Pacific Standard Time (GMT: 5pm to 9pm) for server migration and upgrades.
Please accept our apologies in advance for any inconvenience this might cause.

How to Backup and Restore Microsoft SQL Server Backup via Netbackup

Created: 29 Jul 2009 • Updated: 28 Dec 2010 | 32 comments
Language Translations
Zahid.Haseeb's picture
+5 15 Votes
Login to vote

Today we discuss how Veritas Netbackup do Backup and Restore of Microsoft SQL Server via very easy snapShot procedure. In our case we have a environment of windows2003 server with Veritas Netbackup 6.5.
Note: You must have installed Veritas Netbackup client on the client machine where MS SQL Server is installed.

In this article we will discuss:

  • Howto create script/Batch file for backup of MS SQL Server from Veritas Netbackup
  • Howto mention the backup script/Batch file in the Veritas Netbackup policy
  • Howto create script/Batch file for restore of MS SQL Server from Veritas Netbackup
  • Howto run the restore script/Batch file to restore the backup
  • Prerequesite for redirected restore

Howto create script/Batch file for backup of MS SQL Server from Veritas Netbackup

Open NetBackup MS SQL Client from the client machine/PC where MS SQL Server installed as mentioned in below figure
imagebrowser image

Now you will find the below window

imagebrowser image

Now click on Backup SQL Server objects

imagebrowser image

Now you can see the database(s) which exist on your MS SQL Server

imagebrowser image

Now select the database which you want to take backup via Veritas Netbackup as i selected and click on Save in the below figure.

imagebrowser image

You specify the script name and path where the script/Batch file you want to save at the client side

imagebrowser image

After click on save a window will offer you to view the scritp/ Batch FIle in the nodepad as shows in the below figure.

imagebrowser image

You can see the script/Batch file as the below figure shows

imagebrowser image

Now the script/Batch file is created who will help you to take the backup via Veritas Netbackup.

Howto mention the backup script/Batch file in the Veritas Netbackup policy
 

in our case we imagine that the backup policy is already created in the Veritas Netbackup

imagebrowser image
 

Howto create script/Batch file for restore of MS SQL Server from Veritas Netbackup

In the restore activity which we are now going to perform.
Note:
In our this restore activity we suppose that we are going to restore MS SQL Server on a different client machine and as you can see there is no database of name project in the below figure.

imagebrowser image

Now open the Netbackup MS SQL Client and click on Restore SQL Server objects. From here we are going to create a Restore Script.

(Note: Open the "Netbackup MS SQL Client" from the destination where you want to restore the backup.)

imagebrowser image

if you are restoring backup on the same machine then you mentioned same name on SQL Host and Source Client. if you are restoring MS SQL backup on a different PC then you must follow the "prerequesite for redirected restore"  in this article and then click on OK.

imagebrowser image

After clicking on OK you will see a window as the below figure

imagebrowser image

In our case we can see the one Full and 2 differential backups of project database

imagebrowser image

Now select the Create a move templete from Scripting because we are going to do a redirect restore(restoring a backup to an alternate PC) activity, and select Recovered from the Recovery and click on Restore.

imagebrowser image

After clicking on Restore TAB you will mentioned the path (where you want to keep the restore script/Batch file )and the script/Batch file name. After doing this Veritas will offer you to view the script/Batch file as shown in the below figure.

imagebrowser image

Now you will find the script/Batch file as you can see in the below figure

imagebrowser image
As the above outline figure you can see where the backup exist. Now in the below figure we specify the path where we want to restore the backup and also un hash the outline lines and then save this script/Batch files.

imagebrowser image

Howto run the restore script/Batch file to restore the backup

Open the Netbackup MS SQL Clients and click on Manage script files

imagebrowser image

Specify the restore script/Batch file and click on Start

imagebrowser image

Click YES to start the backup restoration process.

imagebrowser image

Now you can see that the project database is restored

imagebrowser image

Prerequesite for redirected restore

imagebrowser image

imagebrowser image
Now clck on Yes. The procedure "Prerequesite for redirected restore" can start the redirect restore

imagebrowser image

 

Article Filed Under:

Comments 32 CommentsJump to latest comment

rj_nbu's picture

No.Restrictions is Case sensitive. BTW all the steps you have mentioned here are either covered in technote 287789 and in the sql admin guide as well.

-Rajeev
"Unix IS user friendly... It's just selective about who its friends are"

+3
Login to vote
Zahid.Haseeb's picture

HI rj_nbu

i agree with your suggesstion. but there are so many ppl in the world who are not very well in Veritas Netbackup as you and as other gurus of Veritas Netbackup...
As far as Veritas netbackup admin guide is concern its not an easy task to read the huge admin guide for those who are new in Veritas Netbackup and they like to do these sort of things which i did in this article very very quickly with snap shots....

i main moto is to help those guys

Thanks in Advance rj_nbu

Any comment will be appreciated. Mark as Solution if your query is resolved
__________________
Thanks in Advance
Zahid Haseeb

zahidhaseeb.wordpress.com

0
Login to vote
Claudio Veronezi's picture

I agree

That way is VERY simple, and too much easy to find,

I read the completelly the manual, I understood the manual, but that way is too much simple.

 

Claudio Veronezi Mendes
IT Manager at Lb2 Consultoria
Londrina - Pr - Brazil
 

0
Login to vote
vikasgupta's picture

Hi RJ_NBU

I wonder when I see guys like you who exactly knows what news guys like me and many others in  netbackup exactly need( snapshots like above). My hat's off to you.

 

Thanks Vikas Gupta

 

0
Login to vote
sumanreddy's picture

thanks i am looking for the same .

0
Login to vote
fdiaz's picture

How could I execute the bach file remotely? I created the batch file but want to execute it from CMD.

0
Login to vote
Zahid.Haseeb's picture

Dear fdiaz

 

You have to add the batch file/script in the policy under Backup Selection

Any comment will be appreciated. Mark as Solution if your query is resolved
__________________
Thanks in Advance
Zahid Haseeb

zahidhaseeb.wordpress.com

0
Login to vote
haijin-jack's picture

Under section:

How to mention the backup script/Batch file in the Veritas Netbackup policy

Do I have to create a separate policy to backup just the database?...or, can I use an existing policy that's already there? I'm already backing up several directories on that server, but not the database.

Thank you for your excellent instructions.

Curt (haijin-jack)

0
Login to vote
Zahid.Haseeb's picture

Dear Hiajin-Jack

 

The files and directories are flat files backup and Veritas takes it in different way and the Database take in different way. Both backups (Flat file backup and SQL/Database backup) are treated in different ways thats why Veritas Netbackup created different agents for these backups (Flat file backup and SQL/Database backup)

Any comment will be appreciated. Mark as Solution if your query is resolved
__________________
Thanks in Advance
Zahid Haseeb

zahidhaseeb.wordpress.com

0
Login to vote
user_feo's picture

Guys, Does this also apply to backing up, sql 2008 std 64bit running on Ws 2008 R2?  I 've tried reusing an already existing script, but my backup jobs are not running.  Did I miss anything?

 

I took the following script, and did the following:

OPERATION BACKUP
DATABASE $ALL
SQLHOST "target-server"  //modified this line with the name of the new ws 2008r2 server.
NBSERVER "backup-server"
MAXTRANSFERSIZE 6
BLOCKSIZE 7
POLICY SQL-Weekly
NUMBUFS 2
ENDOPER TRUE

 

Thanks,

user_feo 

0
Login to vote
Altimate1's picture

Hi, it should works...

at my side, I use

OPERATION BACKUP
DATABASE "VIM_VCDB"
SQLHOST "Jerez2k8"
SQLINSTANCE "SQLEXP_VIM"
NBSERVER "VM-W2K8-BESERVER"
MAXTRANSFERSIZE 6
BLOCKSIZE 7
NUMBUFS 2
ENDOPER TRUE

The database is an SQL Express vCenter running on a win2k8 R2 Standard and it works.

I only noticed that you have a "POLICY" extra line.

I have dropped a tuturial video here:

https://www-secure.symantec.com/connect/videos/netbackup7-ms-sql-backups

Regards

Bernard

0
Login to vote
uznosyke's picture

Straight forward documentation. Very helpful.

Thanks.

0
Login to vote
syedzeeshan's picture

excellent

 

 

0
Login to vote
Zahid.Haseeb's picture

Thanks

Happy to hear that this helped you

Any comment will be appreciated. Mark as Solution if your query is resolved
__________________
Thanks in Advance
Zahid Haseeb

zahidhaseeb.wordpress.com

0
Login to vote
Zahid.Haseeb's picture

Happy to hear that this helps you

Any comment will be appreciated. Mark as Solution if your query is resolved
__________________
Thanks in Advance
Zahid Haseeb

zahidhaseeb.wordpress.com

0
Login to vote
f25's picture

Thanks for the explanation.

On the other hand this shows that NetBackup is more for hobby than for use when it comes to SQL restores. I am glad I do not have to write any assembler code to complete this basic operation or use the FAX machine. I am not against command line usage, but 1 restore operation should be: 1 simple wizard AND its 1 command line equivalent, nothing more.

Why do NBU people like to make things so sophisticated?!

0
Login to vote
Abhii01's picture

Hi Zahid,

 

The process explained is really handy for newbies !! Thanks to you.

On similar note could you write up on configuring SQL/Oracle/Exchange/Lotus Notes  agen from scratch, something like kind of logon id's for the Client services and how to setup the Agent, ?

 

I read in some articel on configuring SQL, which also briefs on how to create the DSN entry in ODBC connection and integrate it with SQL ... not sure if all this is necessary ...If you have anything that's straight forward on setting up a new SQL server backup (not just with regards to creating policy, but starting from installing Netbackup agent (client s/w) to configuring of backups (which i presume you have already covered).

 

Thanks again !

Abhi

0
Login to vote
Zahid.Haseeb's picture

I hope this will help you:

 

How to install Netbackup agent

https://www-secure.symantec.com/connect/forums/how...

Your query regarding Oracle backup

https://www-secure.symantec.com/connect/articles/q...

Your query regarding Exchange

https://www-secure.symantec.com/connect/articles/e...

https://www-secure.symantec.com/connect/articles/e...

https://www-secure.symantec.com/connect/articles/h...

Any comment will be appreciated. Mark as Solution if your query is resolved
__________________
Thanks in Advance
Zahid Haseeb

zahidhaseeb.wordpress.com

0
Login to vote
Abhii01's picture

Thanks Zahid !!

 

But I'm looking on something like:

I read in some articel on configuring SQL, which also briefs on how to create the DSN entry in ODBC connection and integrate it with SQL ... not sure if all this is necessary ...If you have anything that's straight forward on setting up a new SQL server backup (not just with regards to creating policy, but starting from installing Netbackup agent (client s/w) to configuring of backups (which i presume you have already covered).

0
Login to vote
Zahid.Haseeb's picture

No need to create DSN or ODBC. you only need to install NBU agent and configure a policy for SQL thats it :)

Any comment will be appreciated. Mark as Solution if your query is resolved
__________________
Thanks in Advance
Zahid Haseeb

zahidhaseeb.wordpress.com

0
Login to vote
rookie11's picture

hi guys 

please answer my query. 

when i do a redirected SQL restore of a database do i need to have a empty table space or empty database of same name ???

0
Login to vote
Zahid.Haseeb's picture

Does your restore got successful in Activity Monitor ?

Redirected restore was successful before ? if no , verify that the file name "No.Restrictions" is created ?

Any comment will be appreciated. Mark as Solution if your query is resolved
__________________
Thanks in Advance
Zahid Haseeb

zahidhaseeb.wordpress.com

0
Login to vote
mpl.prasad's picture

Hi Zahid,

    I have configured SQL full backup policy. But application backup size is around 3gb and full backup size is zero. Pls. let me know where I went wrong while configuring policy

 

0
Login to vote
Zahid.Haseeb's picture

Hello mpl.prasad

 

Did you follow the same steps above to backup the SQL ? Share the backup script.

Any comment will be appreciated. Mark as Solution if your query is resolved
__________________
Thanks in Advance
Zahid Haseeb

zahidhaseeb.wordpress.com

0
Login to vote
mpl.prasad's picture

Hi Owen,

 

Thanks for the reply.

 

I have followed the same steps to backup the SQL.  Still its not happening.

 

Pls. find backup script which i have configured.

 

OPERATION BACKUP
DATABASE "HL_Data"
SQLHOST "madeupsplus"
NBSERVER "HL-SRV-BKP"
MAXTRANSFERSIZE 6
BLOCKSIZE 7
NUMBUFS 2
ENDOPER TRUE
 
 
Regards
Prasad
0
Login to vote
mtmorandba's picture

Do you know if we can enable the sql server integrity check on the backup that Netback is taking?

We have an existing sql server agent job, this takes the full backup , but also does and integrity check on the backup. I would like to keep this same functionally if switching to netbackup client.

thanks,
Michael

0
Login to vote
Zahid.Haseeb's picture

share DBclient log , and the time when backup started and finished.

Any comment will be appreciated. Mark as Solution if your query is resolved
__________________
Thanks in Advance
Zahid Haseeb

zahidhaseeb.wordpress.com

0
Login to vote
belse's picture

Hi All,

Is the process same for backing up sql using win server 2008 and 7.0 master for sql 2008 server?

Thanks,

Belse

0
Login to vote
Zahid.Haseeb's picture

COULD NOT UNDERSTAND WHAT YOU ARE TRYING TO SAY. WHAT i COME TO KNOW THAT THIS PROCESS CAN BE USED TO TAKE THE BACKUP OF sql 2005 OR EITHER sql 2000

Any comment will be appreciated. Mark as Solution if your query is resolved
__________________
Thanks in Advance
Zahid Haseeb

zahidhaseeb.wordpress.com

0
Login to vote
belse's picture

Hi,

Thanks a lot for this post. I read it reread it many times, But got stuck with some points. I have some queries as i am new to database backup and i dont know what to take backup in SQl. Pls let me know with the following things.

1:- What is the use of backup script file .bch? Can not we take backup directly as we do in folders?

2:-How would it take backup of SQL database?

3:-Once the backup script is ready how would it run automatically to take backup?

4:- How is the 3 screenshot is different (In while there is one tab type of backup) to the policy backup for SQl (there is also full and other backups)

5:-There is one more tab in 3 screenshot Netbackup Policy how is it different to the policy backup for SQL

 

Could somebody pls elaborate the object of batch file and all? Thanks i should not post it here but doing so. Pls help me.

0
Login to vote