Forum Discussion

nbritton's avatar
nbritton
Level 4
11 years ago

sql tranlog backup with exlude variable

I have wrote a script that will run and populate a env var with the databases that are in simple mode :   @echo off sqlcmd -S server\instance  -Q "set nocount on; select name from sys.da...
  • Chirag_Patel1's avatar
    11 years ago

    I ran sqlcmd  you have written above and got the list of system DBs which should be excluded (having simple recovery model) in sql.txt. then added one of the user database i wanted to exclude in sql.txt file. then ran the script you have created. i verified that User environment variable NB_SQL_DATABASE_EXCLUDE got set properly but databases are ',' seperated then i changed the seperator to ';' (which NetBackup for MSSQL agent expects).

    Then i reopened the MSSQL agent GUI and ran the same batch file as you have mentioned above (obviously after modifying the SQLHOST, SQL instance and NBSERVER). It is excluding the databases specified in NB_SQL_DATABASE_EXCLUDE User environment variable.

    I didn't specify NB_SQL_DATABASE_EXCLUDE in system environment variable. 

    I ran above test with administrator. I also tried with another user as well and everything is working as expected.

    I looked at the dbclient logs you have provided and it has excluded the 'JAMS' database for trxlog backup.

    Can you manually specify User environment variable NB_SQL_DATABASE_EXCLUDE and database names with ',' seperated and try the backup?