Data Backup and Recovery

SMSQL 5.1 - Adding DB to backup schedule


Being new to SMSQL, I'm trying to identify the best procedure to update the Backup script when we add another DB to our SQL Cluster.  From what I can gather I have a couple of options:

  1. Go into the SQL job within SSMS and add the name of the DB in the script
  2. Recreate the job in SMSQL and recreate the schedule in SSMS?

I'm to use to SSMS that will automatically add any new DB into the Maintenance plan

Is there a better way?

thanks in advance.



In SSMS, if you look at the job that was created by SMSQL, you'll see that it just has a single step that runs "SmsqlJobLauncher.exe" followed by the "new-backup" command, which itself is followed by a number of parameters. To include or exclude databases from the backup job, look for the "-d" parameter (which is short for "-Database"), it's followed by at least 3 values: <<SQL server instance>, <Number of databases>, <db1>,<db2>,<db3>..>.

Say, for example, the job is backing up 3 databases named db1, db2, and db3, the command in the job step would include:

     -d 'server\instance', '3', 'db1', 'db2', 'db3'

If you wanted to add a fourth database named db4 to the backup job, you would change that part of the command to:

     -d 'server\instance', '4', 'db1', 'db2', 'db3', 'db4'

You can check out more details about all of the parameters that "new-backup" takes at this page:

You might also want to check out a script that someone else in this forum made, it creates a job that dynamically builds the "new-backup" command to include all user databases in the instance and then runs the command. You may have to tweak parts of it to make sure that all the other command parameters are suited to your environment, but it's a good starting point: