cancel
Showing results for 
Search instead for 
Did you mean: 

MS-SQL batch POLICY keyword

AAlmroth
Level 6
Partner Accredited

I just noticed that the POLICY keyword isn't really a documented keyword in the most recent SQL admin guides. We all know that the NBU will use the policy in from which the automatic schedule initiated the job, and we can still use the NBSCHED to control which application schedule to use.

So, by specifying POLICY in the bch file, will it only work when running a user-initiated backup, or will it override what the policy fed to the client when an automatic schedule started the job session? Well, guess I could test this, but lacking time to set up a test environment for this...

/A

 

6 REPLIES 6

Chirag_Patel1
Level 3
Employee

A POLICY keyword specified in the batch file overrides the policy fed to the client when an automatic schedule for the policy starts.

Jim-90
Level 6

I  was looking at the same thing. We are moving away from "dump & pickup" SQL backups.

  Planning to model it on our Oracle RMAN backups where the DBAs control everything (what is backed up, when it happens, monitoring backups, doing their own restores etc) the NBU admins only need to provide a policy which defines retention times and storage target.  I don't usually restrict the backup times. If the DBAs max out database server, the LAN and other non-NetBackup resources ...its their problem not mine.

As regards running a user directed backup from dbbackex there is no need to use an undocumented feature. According the the NBU 7.6 manual there is a -p PolicyName paramaeter for dbbackex "If it is omitted, then the NetBackup server uses the first active SQL Server policy that it finds in its policy list. This policy name is used for all of the backup operations that are specified in the batch file."  - from manual

That leaves me with another problem - all the backups are fulls. Now I need to figure out how to do non-full backups.  The NBSCHED option for the .BCH  file only selects from application schedules. 

I suspect I'm stuck with doing only full backups that are initiated using the SQL Server Scheduler via the Microsoft SQL Server Enterprise Manager.  - Correct ?

 

Chirag_Patel1
Level 3
Employee

When you create a batch file for 'Full differential' or 'transactoin log' backup using NetBackup for MSSQL agent GUI it would add DUMPOPTION INCREMENTAL or OBJECTTYPE TRXLOG keywords in batch file respectively, and you need to specify this batch file dbbackex when you schedule it using client-based schedulers or execute it from command line. The DUMPOPTION INCREMENTAL keyword in batch file would run incremental backup and OBJECTTYPE TRXLOG would run transaction log backup. Let me know if this answers your question for non-full backups.

Jim-90
Level 6

The DUMPOPTION INCREMENTAL in the BCH file according to the manual "Specifies INCREMENTAL
restoring from an incremental backup." there is no mention of a backup. 

Interesting that it GUI creates a  BCH file DUMPOPTION and its motted in the manual

Chirag_Patel1
Level 3
Employee

The DUMPOPTION INCREMENTAL keyword applies for incremental backup as well. Probably the manual is not updated correctly. I will follow up with conerned team to get it corrected.

But your issue regarding taking an inremental backup will be resolved using DUMPOPTION INCREMENTAL batch file keyword.

 

Chirag_Patel1
Level 3
Employee

I hope this answers your query.