Making global changes to all servers
Adam.Bean
Posts: 28
I'm finding it very tedious to have to set server settings (default file format) and email settings for each and every server/instance.
Is there any easy to make the same settings for all registered servers?
Thanks again!
Is there any easy to make the same settings for all registered servers?
Thanks again!
Comments
The settings are stored in the registry, under the HKLM\Software\Red Gate\SQL Backup\BackupSettingsGlobal\<instance name> key. Knowing this, you can do any of the following:
- follow the suggestions in this post to change the settings
- prepare a script that uses either the sqbutility or xp_regwrite extended stored procedures to change the required settings. Run this script using a tool that can target multiple servers e.g. SQL Multi Script.
sqbutility is a SQL Backup extended stored procedure to perform miscellaneous maintenance SQL Backup tasks. One of them is to change the SQL Backup settings. To do that for text values, you would run something like e.g.
where the 1st parameter is fixed at 1040, the 2nd parameter is the name of the setting as found in the registry, and the 3rd parameter the value.
To change number values, use 1041 for the 1st parameter e.g.
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8
Is this a planned change in an upcoming version?
Also, these registry settings are on the target servers, so this still wouldn't allow me to set a default/make changes to all servers at the same time without connecting to the remote registry. This is where that multi script app comes into play correct?
Thanks
That's true. So basically you have 2 ways of making the change - manipulating the registry directly, or use the extended stored procedures to do it.
SQL Multi Script makes it convenient to run the same script against multiple servers. Or you could just write a shell script to iterate through a list of servers and run the script on each server in turn.
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8
What about x64 servers?
I see SQLBackup under HKLM\Wow6432Node\RedGate\SQLBackup, but the path ends there ...
I tried on a 32bit server, and it didn't seem to work ...
EXEC master..sqbutility 1040, 'BackupFileName', '<DATABASE>'
EXEC master..sqbutility 1040, 'SMTPHost ', 'removed'
EXEC master..sqbutility 1040, 'SMTPSender', 'removed'
EXEC master..sqbutility 1041, 'LogDeleteHours', 7
0 results, registry remains the same.
Thanks again
Is there anyway to have it read from your registered servers in SQLBU or SSMS? I have quite a few servers that I'm going to want to make several changes to using this tool once I get that procedure working.
Thanks
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8
Correct, I am on the target instance attempting to change the settings for that particular instance.
Thanks.
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8
Ok, I just had to refresh ...
It does work, but the return from the procedure is nothing. Is this normal?
If you use the SQL Multi Script to update the email tab (SMTPHost, SMTPSender) and refresh your connection, the tab does not update until you restart the SQL BU application. The file/logging tab works fine on refresh though.
- use the 4th parameter, which is an output parameter. 1 indicates success, 0 indicates failure, -1 indicates an invalid setting name. E.g.
- update the setting, then retrieve the value to check if its updated. This is done via sqbutility again, but with function number 1014. E.g.
- update a bunch of settings, then retrieve all settings and check that they have been upated, using sqbtutility with function number 1008. E.g.
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8