Solved

Is there a way to have a backup of a MSSQL DB instance retry backing up a single DB on the server if there are errors?

  • 22 January 2024
  • 1 reply
  • 65 views

Userlevel 2
Badge +11

Question: I’m wondering if Commvault can be made to “auto retry” backing up a database if there are certain types of errors (when the database is online, and other DB’s are able to be backed up, just some failure occurs with a single DB)

Why: We have been having some issues with backing up MSSQL DB’s and its very intermittent. I know “find out what the connectivity/issue is” is probably the right approach, but time and rarity keep this from being a priority. People have asked “Can CommVault just retry?”

Example:

2 Db’s had failures in a backup of a MSSQL instance with about 50 Db’s in it. 

Error 1 = “Error encountered when closing the virtual device. Please see SQL Server vdi.log for more details.”. 

Reasoning for retry: In this case it appears there was some sort of disconnection (somewhere, somehow) for just this single DB when the backup ran.  This would be a case where I would want CommVault to try again maybe 1 time after x minutes or something, as the DB is online, just something happened and its likely to backup if a second attempt is made.

Error 2 = “Error encountered during backup. Error: [Microsoft.SqlServer.Management.Common.ExecutionFailureException:Unable to access availability database 'X-REDACTED-X' because the database replica is not in the PRIMARY or SECONDARY role. Connections to an availability database is permitted only when the database replica is in the PRIMARY or SECONDARY role. Try the operation again later. BACKUP DATABASE is terminating abnormally. An exception occurred while executing a Transact-SQL statement or batch.]”

Reasoning for retry: In this case, I would not care if CommVault retries 1 extra time, but it's not going to matter, we just don’t want it “retrying forever” as its never going to get a successful backup as long as its in this state, but maybe it would… like maybe it was being configured by a DBA, or some other odd reason its neither primary or secondary for just a few minutes.

icon

Best answer by Scott Reynolds 22 January 2024, 21:48

View original

1 reply

Userlevel 6
Badge +14

Hello @tigger2 

There is nothing to control and retry for an individual database within a backup job. There are job retries:

https://documentation.commvault.com/2023e/expert/advanced_backup_options_job_retry.html

and there are also some controls on how the job and/or database is reported for various reasons 

https://documentation.commvault.com/2023e/expert/sql_agent_configuration_sql_configuration.html

https://documentation.commvault.com/2023e/expert/customizing_completed_with_errors_condition_advanced.html

 

However, there is nothing specific to what you are asking, in most cases those failure examples the backup will also fail on that DB even on retry. It would probably be better to have frequent tlog backups for best protection.

Reply