June 23, 2011 at 9:52 am
Hi all,
Environment is SQL 2005 SP3 (9.0.4053). I need to make sure that we have a backup of the database mail configuration and of the linked servers.
Is all of this stored in MSDB? If so, I presume that a simple restore of last good MSDB backup would recover all of this, in the event of a server failure(?)
Many thanks,
Adrian
June 23, 2011 at 12:52 pm
Yes. Data for both are stored in msdb. In addition, you can script linked servers in SSMS by right-clicking on one and selecting 'Script Linked Server as...'.
Greg
June 23, 2011 at 1:13 pm
i htink you also need a backup of master just in case;
I thought the CREDENTIAL for any database mail username/pass used for the AUTH command are in master, and i think the same goes for a linked server that is using a specific username and password;
I reverse engineered database mail settings before,a nd found that was the one thing i couldn't script out...credentials.
Lowell
June 23, 2011 at 2:30 pm
info on linked servers is held in master, so a restore of msdb would not recover those.
---------------------------------------------------------------------
June 23, 2011 at 5:37 pm
george sibbald (6/23/2011)
info on linked servers is held in master, so a restore of msdb would not recover those.
So it is. I guess I was fooled when I saw catalog views in msdb.
Greg
June 24, 2011 at 4:02 am
Thanks guys - will make sure we have both backed up then (think we do already - certainly MSDB is).
I was aware of scripting out the linked server creation but wanted to avoid the risk of someone forgetting to do that if they add another one. Maybe I'll do both approaches as a belt-and-braces. Presumably a job with some sort of loop may be able to export all linked servers to a script every night? I could then add that script to our backups...
Cheers,
Adrian
June 24, 2011 at 4:07 am
Adrian Strudwick (6/24/2011)
Thanks guys - will make sure we have both backed up then (think we do already - certainly MSDB is).I was aware of scripting out the linked server creation but wanted to avoid the risk of someone forgetting to do that if they add another one. Maybe I'll do both approaches as a belt-and-braces. Presumably a job with some sort of loop may be able to export all linked servers to a script every night? I could then add that script to our backups...
Cheers,
Adrian
What? Scripting out? You mean your team doesn't make all server config changes via T-SQL scripts before checking those scripts into a version control repository? 😉
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
June 24, 2011 at 4:51 am
If only! One of the 'joys' of having your boss wearing a second hat & third hat as a developer and also retaining dba rights. Hard to rein in... 😉
June 29, 2011 at 2:33 pm
Adrian, we need to do the same thing. Do you mind sharing your code that scripts out the linked servers and email settings?
Thanks, don't care to recreate the wheel if I don't have to.:-)
June 30, 2011 at 2:00 am
Edie,
For linked server, you can right click, then click "script linked server as" followed by "Create to" then your destination (new query, clipboard etc).
Not worked out how to parse through the list and do this dynamically for all linked servers. As mentioned above, looks like the best way to avoid losing for email settings is simply back up master and msdb.
Adrian
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply