Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Creating a trigger to back the Master DB up

Author  Topic 

Jake Shelton
Yak Posting Veteran

74 Posts

Posted - 2010-09-09 : 13:07:36
Hi all,

Could I create one that fires the backup job whenever a user is created, dropped? Could I configure it to fire also when server/db settings are altered (even by myself), or would this need a 2nd trigger?

Cheers,

Jake

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-09-09 : 13:23:45
I'm not sure why you'd want to do that. Although I don't have the answer you are looking for, I'd instead recommend running a full backup of the system databases daily or weekly rather than going down this route.

And yes if this is possible through the DDL triggers, then you'd need lots of triggers to catch every single change that could happen. It is so much better to just schedule a regular backup of it.

And don't forget to backup msdb (important for jobs, etc...) and model (less important) too!

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Jake Shelton
Yak Posting Veteran

74 Posts

Posted - 2010-09-09 : 13:55:42
Cheers Tara, I know it's usually good practice to back up the Master DB right after any change, and I've pretty much always left it to the EOD backup, but it's not impossible that a bunch of users could be added in the morning, systems crash, and I have to redo THAT work along with all the other restoration.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-09-09 : 14:00:48
Very true, however a system crash should be a very, very rare event. Adding a bunch of users will be the least of your worries in the event of master needing to be restored.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -