05-14-2014 02:41 AM
Can anyone shed some light on this, I am looking to exclude some single database from the database backup when I have more than one instance on the machine and the SQLINSTANCE "$ALL" option is used.
Thanks
05-14-2014 02:58 AM
When using the DATABASE $ALL option, you can add lines in the batch script with the EXCLUDE keyword followed by the database name. You can use multiple EXCLUDE lines within the OPERATION block.
You would have the SQLINSTANCE $ALL in the first operation block, and if using EXCLUDE, it would exclude in every instance found, is my understanding.
I do however prefer to use one batch script for each instance...
/A
05-14-2014 03:02 AM
I have two instances on the machine and want to have one policy and one set of server side scripts, as a result we us both:
SQLINSTANCE "$ALL"
DATABASE "$ALL"
But there are single databases that we may wish to exclude and the EXCLUDE "????" option does not work with SQLINSTANCE "$ALL" or I just don’t have the syntax correct.
If I split the instances out, it seem to back up the first instance and exclude correctly and then ignore the second instance altogether.
05-14-2014 04:38 AM
Does this help?
http://www.symantec.com/docs/HOWTO69783
05-14-2014 06:41 AM
Thanks for the link, but I have already looked at this and it doesnt address the issue of multiple instances on one box.
05-14-2014 01:11 PM
Sure it does ...
You can also exclude individual databases from backup by creating a Windows environmental variable NB_SQL_DATABASE_EXCLUDE. For the value of the variable, specify a list of database names.
For example, consider the following batch file:
SQLINSTANCE $ALL OPERATION BACKUP DATABASE $ALL NBSERVER "BEARING" MAXTRANSFERSIZE 6 BLOCKSIZE 7 NUMBUFS 2 ENDOPER TRUEYou can exclude the databases "master," "accounting," and "pubs" with the NB_SQL_DATABASE_EXCLUDE environmental variable. For the value of the variable, indicate the databases you want to exclude. Separate the database names with semi-colons.
MASTER;ACCOUNTING;PUBS
10-02-2014 01:56 AM
Hi Will!
Can you give me a hint for this constellation:
1 Host: SERVER1
2 Instanzes: Productive, Development
1 Batchfile:
SQLINSTANCE $ALL
OPERATION BACKUP
DATABASE $ALL
NBSERVER "BEARING"
MAXTRANSFERSIZE 6
BLOCKSIZE 7
NUMBUFS 2
ENDOPER TRUE
In both instances a Database called "MyDatabase" exists. I want to exclude MyDatabase just in Instance "Development"! Did you have a solution for that case?
Thx
BR Martin
10-02-2014 03:40 AM
NB_SQL_DATABASE_EXCLUDE:
#Develpoment#;MyDatabase;
See if that does it for you
10-02-2014 03:48 AM
Use a batch file per instance and use Will's method to exclude "MyDatabase" from "Development" instance.
EDIT: Responded same time with Mark, see his answer, its better then mine.