Solved

Running only one SQL DB backup


Userlevel 3
Badge +13

Hi Team,

 

Hope all are doing good ! 

we have many SQL servers which has 500 DB’s each, is it some option in commvault to run on-demand backup for  only one DB out of 500 DB’s. I knew we have SQL plug-in which can be used from the SQL studio but i am looking for some option from the commvault end, 

 

i found below link to run from commvault end but it is not working as expected, not sure what i am missing here. 

https://documentation.commvault.com/commvault/v11_sp20/article?p=18360.htm

icon

Best answer by Scott Reynolds 2 March 2022, 15:41

View original

If you have a question or comment, please create a topic

11 replies

Userlevel 5
Badge +12

Hi @Allan0105 

In Command Center Databases list screen we can run on demand backup of any specific DB.

Which FR you’re at?

 

Thanks,

Sunil-

Userlevel 3
Badge +13

Hi @Allan0105 

In Command Center Databases list screen we can run on demand backup of any specific DB.

Which FR you’re at?

 

Thanks,

Sunil-

Thanks Sunil for your quick response. I can run on demand back using command line but need help on scheduling it on specific time. 

Userlevel 6
Badge +14

@Allan0105 

From the Command Center you can run a backup of an individual database.

https://documentation.commvault.com/11.24/essential/87377_sql_configuration.html

If you are looking for an option to run from command line you can leverage the ondemand option

https://documentation.commvault.com/11.24/expert/18341_configuring_sql_server_agent_using_command_line_interface.html#specifying-databases-for-on-demand-backup

This command requires you edit a text file with the database(s) that you want to backup. It can be scheduled to run with task scheduler within windows or similar options.

 

Also if you have specific databases that need one time backup it might be beneficial to create a subclient just for those DBs.

Userlevel 3
Badge +13

@Allan0105

From the Command Center you can run a backup of an individual database.

https://documentation.commvault.com/11.24/essential/87377_sql_configuration.html

If you are looking for an option to run from command line you can leverage the ondemand option

https://documentation.commvault.com/11.24/expert/18341_configuring_sql_server_agent_using_command_line_interface.html#specifying-databases-for-on-demand-backup

This command requires you edit a text file with the database(s) that you want to backup. It can be scheduled to run with task scheduler within windows or similar options.

 

Also if you have specific databases that need one time backup it might be beneficial to create a subclient just for those DBs.

Thanks Scott for your help here ! I tried to run the qcommand but it is running backup for all the DB’s even though i gave only one DB on the text file. not sure what i am missing. problem in creating new Subclient for one DB is that after backup completed, we cant remove that DB and add to the default sub-client until we delete the sub-client or add another DB to the sub-client.  

 

Any help will be greatly appreciated. 

Userlevel 5
Badge +12

@Allan0105

From the Command Center you can run a backup of an individual database.

https://documentation.commvault.com/11.24/essential/87377_sql_configuration.html

If you are looking for an option to run from command line you can leverage the ondemand option

https://documentation.commvault.com/11.24/expert/18341_configuring_sql_server_agent_using_command_line_interface.html#specifying-databases-for-on-demand-backup

This command requires you edit a text file with the database(s) that you want to backup. It can be scheduled to run with task scheduler within windows or similar options.

 

Also if you have specific databases that need one time backup it might be beneficial to create a subclient just for those DBs.

Thanks Scott for your help here ! I tried to run the qcommand but it is running backup for all the DB’s even though i gave only one DB on the text file. not sure what i am missing. problem in creating new Subclient for one DB is that after backup completed, we cant remove that DB and add to the default sub-client until we delete the sub-client or add another DB to the sub-client.  

 

Any help will be greatly appreciated. 

@Allan0105

Actually I didn’t mean Command line, for running on demand backup. It’s in the Command Center GUI which is a web interface. You can run on-demand backup for any database from the UI.

But for scheduling you need to make it part of the subclient and create schedule for that.

 

Thanks,

Sunil-

 

Adding an image if that helps

 

Userlevel 3
Badge +13

@Allan0105

From the Command Center you can run a backup of an individual database.

https://documentation.commvault.com/11.24/essential/87377_sql_configuration.html

If you are looking for an option to run from command line you can leverage the ondemand option

https://documentation.commvault.com/11.24/expert/18341_configuring_sql_server_agent_using_command_line_interface.html#specifying-databases-for-on-demand-backup

This command requires you edit a text file with the database(s) that you want to backup. It can be scheduled to run with task scheduler within windows or similar options.

 

Also if you have specific databases that need one time backup it might be beneficial to create a subclient just for those DBs.

Thanks Scott for your help here ! I tried to run the qcommand but it is running backup for all the DB’s even though i gave only one DB on the text file. not sure what i am missing. problem in creating new Subclient for one DB is that after backup completed, we cant remove that DB and add to the default sub-client until we delete the sub-client or add another DB to the sub-client.  

 

Any help will be greatly appreciated. 

@Allan0105

Actually I didn’t mean Command line, for running on demand backup. It’s in the Command Center GUI which is a web interface. You can run on-demand backup for any database from the UI.

But for scheduling you need to make it part of the subclient and create schedule for that.

 

Thanks,

Sunil-

 

Hi Sunil, 

 

Thanks for your response. Scott specified that we can use command line to run an on demand backup and can schedule it so when i tried the command line, backup is getting triggered for all the DBS on the Subclient.

command used and on the db.txt, i have specified couple of Db;s

qoperation execute -af D:\xml\backup_template.xml -clientName bteegvpcstvw001 -instanceName BTEEGVPCSTVW001\COMMVAULT -subclientName default –ondemandinputfile D:\xml\db.txt –backupLevel FULL 

https://documentation.commvault.com/11.24/expert/18341_configuring_sql_server_agent_using_command_line_interface.html#specifying-databases-for-on-demand-backup

 

 

Userlevel 6
Badge +14

@Allan0105 

Did you create the ondemand subclient first?

  1. Download the create_ondemand_DBsub_template.xml file and save it on the computer from where the command will be executed.

  2. Execute the following command from the <Software_Installation_Directory>/Base folder after substituting the parameters values.

    qoperation execute –af create_ondemand_DBsub_template.xml –clientName client1 –instanceName client1\instance1 –subclientName subclient1 -dataBackupStoragePolicy/storagePolicyName SPdata -logBackupStoragePolicy/storagePolicyName SPlog -sqlSubclientType DATABASE -onDemandSubClient true

    For information on the parameters used in this command, see Subclient Configuration.

Userlevel 3
Badge +13

@Allan0105

Did you create the ondemand subclient first?

  1. Download the create_ondemand_DBsub_template.xml file and save it on the computer from where the command will be executed.

  2. Execute the following command from the <Software_Installation_Directory>/Base folder after substituting the parameters values.

    qoperation execute –af create_ondemand_DBsub_template.xml –clientName client1 –instanceName client1\instance1 –subclientName subclient1 -dataBackupStoragePolicy/storagePolicyName SPdata -logBackupStoragePolicy/storagePolicyName SPlog -sqlSubclientType DATABASE -onDemandSubClient true

    For information on the parameters used in this command, see Subclient Configuration.

Hi Scott, 

 

I want to run backup of only one DB in the default sub-client and default sub-client has some 500 DB’s in it, if i need to create on-demand sub-client  and put the DB in that Subclient then i cant move the db out of on-demand sub-client until i add another db to it or delete the on-demand sub-client.  

 

I can do this on the command center by manually clicking the DB but i need to schedule and automate this process. Do we have any options. 

Userlevel 6
Badge +14

@Allan0105

The ondemand subclient is different. There is no Content tab. Databases are not moved from their existing subclient it will only backup the DBs that are in the text file when running the ondemand backup.

Userlevel 3
Badge +13

@Allan0105

No the ondemand subclient is different. There is no Content tab. Databases are not moved from their existing subclient it will only backup the DBs that are in the text file when running the ondemand backup.

AAH ! sorry scoot, i missed that. I tried few time but no luck. i believe i am missing something here. can you please review the command once! Thanks. 

 

D:\Program Files\Commvault\ContentStore\Base>qoperation execute -af D:\xml\create_ondemand_DBsub_template.xml -clientName bteegvpcstvw001 -instanceName BTEEGVPCSTVW001\COMMVAULT -s
ubclientName new -dataBackupStoragePolicy/storagePolicyName systemstate -logBackupStoragePolicy/storagePolicyName systemstate -sqlSubclientType DATABASE -onDemandSubClient true
qoperation: Error 0x301:
Performs CommServe operations


D:\Program Files\Commvault\ContentStore\Base>qoperation execute -af create_ondemand_DBsub_template.xml -clientName bteegvpcstvw001 -instanceName BTEEGVPCSTVW001\COMMVAULT -subclien
tName subclient1 -dataBackupStoragePolicy systemstate -logBackupStoragePolicy systemstate -sqlSubclientType DATABASE -onDemandSubClient true
qoperation: Error 0x301:
Performs CommServe operations

Userlevel 3
Badge +13

@Allan0105

No the ondemand subclient is different. There is no Content tab. Databases are not moved from their existing subclient it will only backup the DBs that are in the text file when running the ondemand backup.

AAH ! sorry scoot, i missed that. I tried few time but no luck. i believe i am missing something here. can you please review the command once! Thanks. 

 

D:\Program Files\Commvault\ContentStore\Base>qoperation execute -af D:\xml\create_ondemand_DBsub_template.xml -clientName bteegvpcstvw001 -instanceName BTEEGVPCSTVW001\COMMVAULT -s
ubclientName new -dataBackupStoragePolicy/storagePolicyName systemstate -logBackupStoragePolicy/storagePolicyName systemstate -sqlSubclientType DATABASE -onDemandSubClient true
qoperation: Error 0x301:
Performs CommServe operations


D:\Program Files\Commvault\ContentStore\Base>qoperation execute -af create_ondemand_DBsub_template.xml -clientName bteegvpcstvw001 -instanceName BTEEGVPCSTVW001\COMMVAULT -subclien
tName subclient1 -dataBackupStoragePolicy systemstate -logBackupStoragePolicy systemstate -sqlSubclientType DATABASE -onDemandSubClient true
qoperation: Error 0x301:
Performs CommServe operations

Hey Scott, 

 

this was fixed and working as expected, i just copied pasted the commands directly which made the issue. i typed the command and it worked fine. Thanks for your inputs and suggestions.