TheCuriousDBA

updated

11 years ago

0

3258

November 12th, 2015 11:00

How to Exclude Specific SQL Server DBs with Wildcard

Hi Everyone,

Is there an easy way to exclude a range of SQL Server databases for a given client? For the backup command, can you pass:

nsrsqlsv -h CT* 

for example and exclude DBs starting with the letters "CT"?

Thanks for your help!

-TheCuriousDBA

  • CarlosRojas

    1 Rookie

    •

    1693 Posts

    2338

    1

    Posted November 15th, 2015 23:00

    Hi thecuriousdba

    Wildcrads are not supported when excluding DB's. You have to either use the -h and the names of all DB's you want to exclude (for example -h model -h ,aster, etc) or else you can use the -i option and use a text file that will especify the DB's to be backed up, same as adding those to the saveset field:

    -I Specifies a text file that lists multiple SQL Server save sets. The -I option can also be specified with the nsrsqlsv command for the Backup Command field in the NetWorker Administration GUI.

    Thank you,

    Carlos

  • MoinMansuri

    2 Intern

    •

    147 Posts

    2338

    1

    Posted November 16th, 2015 03:00

    Hi,

    You can create Global Directive as below and apply to respective client: and also mention extension as below.

    NMC >>>>Configuration>>>>>Directive

    Unix:

    << / >>

    +skip: *.ldf *.mdf *.ndf *.LDF *.MDF *.NDF *.lck *.LCK *.chk *.CHK

    Windows:

    << "C:" >>

    +skip: *.ldf *.mdf *.ndf *.LDF *.MDF *.NDF

    << "D:" >>

    +skip: *.ldf *.mdf *.ndf *.LDF *.MDF *.NDF

    << "E:" >>

    +skip: *.ldf *.mdf *.ndf *.LDF *.MDF *.NDF

    .

    .

    .

    .

    As per Drives on the client machine add that drives too.

  • 2338

    0

    Posted November 16th, 2015 05:00

    Thanks Carlos!

  • ble1

    6 Operator

    •

    14354 Posts

    •

    56186 Points

    2338

    0

    Posted November 17th, 2015 02:00

    Moin,

    Question here is how to exclude it when doing VDI and not file system backup.  Further, "/" on Windows works too and it works for all drives (no point of giving suggestion for UNIX if such thing does not exist on UNIX, right?)