cancel
Showing results for 
Search instead for 
Did you mean: 

How to exclude a SQL DB of a particular instance from backup

Ajeesh
Level 3

Hi,

I am using separate scripts to perform FULL, INCR & LOG backups of the MSSQL databases. In each of the scripts I use the keyword "SQLINSTANCE $ALL" to backup all the instances.

Suppose there are 3 instances: Instance1, Instance2, Instance3. And all these instances have 1 database named "DB01".

Now, I need to exclude the database DB01 from LOG backup script of instance "Instance1". But the databases of Instance2 and Instance3 shouldn't be excluded.

Note: I already heard about excluding the databases using NB_SQL_DATABASE_EXCLUDE environment variable. But this will cause excluding the database from all 3 instances. But what I want to exclude is only "Instance1\DB01".

 

Regards,

Ajeesh B

 

1 ACCEPTED SOLUTION

Accepted Solutions

RamNagalla
Moderator
Moderator
Partner    VIP    Certified

since you have the same database name in the 3 instances...

you need to use the 3 seperate scripts for each instance.. and use Keyword EXCLUDE  in the script that you would like to exclude the DB01.

eiter you can go with the unique DB naming stardard across the host to make use of NB_SQL_DATABASE_EXCLUDE or EXCLUDE with single script.

View solution in original post

8 REPLIES 8

inn_kam
Level 6
Partner Accredited

go to Host Properties

Clients

Properties

Exclude list

Give the path

 

exclude.JPG

RamNagalla
Moderator
Moderator
Partner    VIP    Certified

since you have the same database name in the 3 instances...

you need to use the 3 seperate scripts for each instance.. and use Keyword EXCLUDE  in the script that you would like to exclude the DB01.

eiter you can go with the unique DB naming stardard across the host to make use of NB_SQL_DATABASE_EXCLUDE or EXCLUDE with single script.

inn_kam
Level 6
Partner Accredited

NetBackup for SQL Server script that uses environment variables to exclude instances and databases from backup

Article:HOWTO85376  |  Created: 2013-09-27  |  Updated: 2013-09-27  |  Article URL http://www.symantec.com/docs/HOWTO85376
 
 

About NetBackup for SQL sample batch files

Article:HOWTO85315  |  Created: 2013-09-27  |  Updated: 2013-09-27  |  Article URL http://www.symantec.com/docs/HOWTO85315
 

 

Ajeesh
Level 3

@Inn_Kam.. Thanks. I am looking for excluding MSSQL database, not any folder/file.

 

@Ramnagalla... Thank you. I am aware of this method. But I do not want to use this method of creating one scripts for each instance as I have multiple instance, not just 3. Is there any other parameter/options in Netbackup that help me exclude a Database that is specific to an instance - as I mentioned in my post.

RamNagalla
Moderator
Moderator
Partner    VIP    Certified

Ajeesh,

unfortunatly i dont find any other way .... there may be something, but i am not finding it now.. 

having the naming Standards to keep the unique names for each DB would have make your life easier... 

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified

NO!!! Filesystem exclude list will NOT work for a database backup!!!!

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified

Have a look at this TN:
Keywords and values used in batch files: http://www.symantec.com/docs/HOWTO85316 

My suggestion is to specify each Instance separately followed by DATABASE $all and then add EXCLUDE DB01 in the relevant Instance section.

e.g.

SQLINSTANCE Instance1
OPERATION BACKUP
DATABASE $ALL 
EXCLUDE DB01
NBSERVER ....
...
ENDOPER TRUE

SQLINSTANCE Instance2
OPERATION BACKUP
DATABASE $ALL 
NBSERVER ...

 

I have not tried this, but I guess worth a try?
Or else separate scripts for each Instance as per above suggestion.

Moved:

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified