Setting Up Scheduled Backups for vCenter on SQL Server Express 2005
If you run your vCenter on SQL Server Express 2005, you may have noticed that you cannot set up scheduled backup jobs with SQL Maintenance Plans, a feature available in the full version of SQL Server. However, there are ways to set up the same kind of scheduled backups in SQL Server Express, without being a SQL Server guru. In this blog post, we will go over the steps to create a scheduled backup job for your vCenter database using Windows Scheduled Tasks.
Step 1: Creating a Backup Script
First, we need to create a backup script that we can use to back up our vCenter database. To do this, open SQL Server Management Studio Express and connect to your vCenter database. Right-click on the VIM_VCDB database and select Tasks > Back Up… This will open the Backup Database window, where you can set your backup options. Set your options as needed, such as the backup file location and retention policy.
Step 2: Saving the Script
Once you have set your backup options, you can save the script by going to File > Save As… and selecting a location to save the script. I recommend creating a folder specifically for your SQL scripts, such as C:\scripts_. Save the backup script in this folder with a meaningful name, such as FullBackupVCDB.sql.
Step 3: Scheduling the Backup
Now that we have a working backup script, we need to schedule it to run on a regular basis. Since we can’t do this within the SQL Server Management Studio Express application, we will use Windows Scheduled Tasks to create our schedule. Open the Control Panel and select Schedule Tasks. Click Create Basic Task and give it a name that describes the backup task.
Step 4: Creating the Schedule
In the Actions tab of the task, select Start a program as the action type. In the Program/Script field, enter “C:\Program Files (x86)\Microsoft SQL Server\90\Tools\Binn\SQLCMD.EXE” -S [servername]\SQLEXP_VIM -i c:\scripts\FullBackupVCDB.sql. This will run the backup script we created earlier. Make sure to replace [servername] with the name of your vCenter server.
Step 5: Configuring the Task Properties
In the Properties tab of the task, make sure the Run whether user is logged on or not option is selected, so that the schedule runs as planned even when no one is logged in. You can also set a description and a trigger time if desired.
Step 6: Verifying the Schedule
Once you have created the scheduled task, test it by clicking Finish to see if it works as intended. Make sure that your vCenter database location is included in your regular backup scheme, and you should be all set!
Conclusion
In this blog post, we have covered the steps to create a scheduled backup job for your vCenter database on SQL Server Express 2005 using Windows Scheduled Tasks. By following these steps, you can ensure that your vCenter database is backed up regularly, without having to manually initiate the backup process every time. Remember to include your vCenter database location in your regular backup scheme to ensure that your data is always protected.