Video Screencast Help
Symantec to Separate Into Two Focused, Industry-Leading Technology Companies. Learn more.

Excluding backups by status/type instead of name

Created: 18 Mar 2013 • Updated: 30 Apr 2013 | 6 comments
This issue has been solved. See solution.

Is there a command I can put into my batch files that will exclude databases in standby?  Offline?  Snapshots?

Specific reason I'm asking the question, I received the following error in the details of a database backup.  There were 3 snapshots listed and one database that is in standby / read-only.  This cropped up very recently.  I don't know if the databses are there when the batch starts and gone when it finally starts to run them or what.

USER - Backup operation inhibited because database SODA_PROD_Demographics_TA_ss does not exist.

Operating Systems:

Comments 6 CommentsJump to latest comment

Marianne's picture

Are we talking about exclude lists for SQL databases? 

Or exclude lists for filesystem backups?

If you have DATABASE $ALL in your SQL script, you can add
EXCLUDE DATABASE-NAME

No option for 'type'.

Supporting Storage Foundation and VCS on Unix and Windows as well as NetBackup on Unix and Windows
Handy NBU Links

SOLUTION
HankHill's picture

I have excludes in them for specific databses.  I'm looking for a solution that will allow me to say if %database% offline/standby/not exist then EXCLUDE "%DATABASE%".

My guess is that the snapshots exist when the job starts and are gone before it ends.  I'll just have to do manual excludes and pray.

Will Restore's picture

Where is it picking up the SODA_PROD name?  Hard coded in the .bch file? 

If so, you can use DATABASE $ALL as Marianne suggests and determine databases at backup run time.

 

 

Will Restore -- where there is a Will there is a way

HankHill's picture

The batch actually does use the DATABASE $ALL.  That's why I'm wondering if the snapshots that it tries to backup, which aren't actually there when you look at the DB list in SQL Server, can be excluded by variable instead of name.

StefanosM's picture

This is another solution.

You can write a sell script to create the netbackup SQL script just before the backup.
And as SQL policy does not have pre and post scripts, you must trigger your script with a dummy file backup.
 

At the end of your script you can put the command to start the SQL backup.
Or you can run both policies with netbackup scheduler. The dummy file backup must run before the SQL backup.

Will Restore's picture

See this MS KnowledgeBase article

 http://support.microsoft.com/kb/903643

Will Restore -- where there is a Will there is a way