Attempting to backup a SQL 2005 Database returns error
During a vCenter server upgrade from 4.0 U2 to 4.1 I needed to take a backup of the SQL 2005 database(running on a seperate server). I logged in as the database owner which is the user that vCenter uses to log in to the database and attempted a backup. The backup failed with errors that looked something like this:
at Microsoft.SqlServer.Management.Smo.Backup.SqlBackup(Server srv)
at Microsoft.SqlServer.Management.SqlManagerUI.BackupPropOptions.OnRunNow(Object sender)
After running the following SQl query I found that the commvault agent that was meant to backup the SQL database at 1am was still accessing the database (although I know it was just sitting there doing nothing) I restarted the commvault services (2 of them) and the backup now completed successfully.
select session_id, Text from sys.dm_exec_requests r cross apply sys.dm_exec_sql_text(sql_handle) t