cancel
Showing results for 
Search instead for 
Did you mean: 

Can I use NBU environment variables with SQL Server batch scripts?

tien86
Level 4
Partner

Default scripts of Oracle,

I can use NBU environment variables such as:  $NB_ORA_FULL, $NB_ORA_INCR, $NB_ORA_CINC. Then I can choose many methods of backup in 1  script depending on what Schedule is running.

In SQL Server, NBU use batch script file which is different. Is there a way to do the same as Oracle?

For example:

<if $NB_ORA_FULL=1>

OPERATION BACKUP
DATABASE "testmir"
SQLHOST "sql1"
SQLINSTANCE "SQLDB"
NBSERVER "MASTER1"
MAXTRANSFERSIZE 6
BLOCKSIZE 7
NUMBUFS 2
ENDOPER TRUE

 

<if $NB_ORA_INCR=1>

OPERATION BACKUP
DATABASE "testmir"
SQLHOST "sql1"
SQLINSTANCE "SQLDB"
NBSERVER "MASTER1"
MAXTRANSFERSIZE 6
BLOCKSIZE 7
DUMPOPTION INCREMENTAL
NUMBUFS 2
ENDOPER TRUE

 

1 ACCEPTED SOLUTION

Accepted Solutions

rookie11
Moderator
Moderator
   VIP   

no man 

simplest approach is to run full and incremental backup in different policies and using 2 different scripts. 1 for full SQL backup and 2 for differential backup

or try this 

How to create a single MS-SQL-Server NetBackup policy which contains multiple schedules with different retention levels

View solution in original post

9 REPLIES 9

rookie11
Moderator
Moderator
   VIP   

no man 

simplest approach is to run full and incremental backup in different policies and using 2 different scripts. 1 for full SQL backup and 2 for differential backup

or try this 

How to create a single MS-SQL-Server NetBackup policy which contains multiple schedules with different retention levels

Marianne
Level 6
Partner    VIP    Accredited Certified

No, you cannot use NBU for Oracle variables in NBU for SQL script.

Variables are different because NBU plugs into the built-in Database backup utility.

Will_Restore
Level 6

Another thing, Oracle scripts are executable, SQL batch files are lists of parameters.

RamNagalla
Moderator
Moderator
Partner    VIP    Certified

may be alternatly what you can do is...

have a reguelr SQL bch files.. and scheule the backups as user drrected.. and use the policy and scheule names in the user directed command.

http://www.symantec.com/business/support/index?page=content&id=HOWTO85407

 

install_path\NetBackup\bin\dbbackex -f file [-p policy][-u userid][-pw password] 
[-s server][-np]

tien86
Level 4
Partner

Hello Marianne, can you give me the links 

The link you provide in another topic is expired.

http://www.symantec.com/business/support/index?page=content&id=TECH90544

 

Hello RamNagalla, I can create a .bat file be able to run dbbackex but still dont' know how to use this. 

Marianne
Level 6
Partner    VIP    Accredited Certified

Please give the link of 'the other topic' so that I know what the TN was all about.

Only Symantec employees have access to 'expired' TNs.

To get back to your original question - 
You cannot use Oracle-type variables.

Simply create separate scripts and policies for SQL Full and Incremental backups and schedule them for different days.

Will_Restore
Level 6

I believe he's referring to this thread

https://www-secure.symantec.com/connect/forums/how-create-single-ms-sql-server-netbackup-policy-which-contains-multiple-schedules-different-

 

TECH90544 is now a dead link

CRZ
Level 6
Employee Accredited Certified

No idea why this one expired, so I unexpired and republished it:

DOCUMENTATION: How to create a single MS-SQL-Server NetBackup policy which contains multiple schedules with different retention levels
 http://symantec.com/docs/TECH90544

(If anybody finds anything really wrong in it, let me know and I'll expire it again!  ;)  )

tien86
Level 4
Partner

thank you for take care we decide to create 2 policy for all clients for easy manage