Friday, March 30, 2012

Job to Backup Log when Full

We have several servers with dozens of databases on each one. We have
elected to group our maintenance jobs so that all database backups are
consolidated into 4 separate jobs (alphabetically). We would like to backup
a log using our standard practices if it gets full. We don't want to call
the 'consolidated' job because if the db is the last alphabetically, it will
have to go through all of the preceeding dbs before it gets to that log. By
that time, I could have gotten up out of bed and backed up the log myself
We would like to be able to read the database name that triggered the alert
and have a job that backs up that log only. Where would I get that database
name? The alert has it, does it store it in a system table in msdb?
Thanks!There is a group of Alert tokens that you can use...
For instance, you could create a job that has one step
Backup log [A-DBN] to disk = 'c:\[A-DBN].logbak'
When the job is called from an Alert, the token will be replaced (even in
the filename string... and the appropriate database log will be backed up...
But the job can not be run< except from an alert> , because that is the only
time the tokens will be replaced..
For a complete list of Alert tokens, go to Gert Drapers web site
http://www.sqldev.net/sqlagent/SQLA...ens.htm#Example using TSQL
step
"Michelle" <michelle@.nospam.com> wrote in message
news:eDmu1PNIEHA.3664@.TK2MSFTNGP11.phx.gbl...
> We have several servers with dozens of databases on each one. We have
> elected to group our maintenance jobs so that all database backups are
> consolidated into 4 separate jobs (alphabetically). We would like to
backup
> a log using our standard practices if it gets full. We don't want to call
> the 'consolidated' job because if the db is the last alphabetically, it
will
> have to go through all of the preceeding dbs before it gets to that log.
By
> that time, I could have gotten up out of bed and backed up the log myself

> We would like to be able to read the database name that triggered the
alert
> and have a job that backs up that log only. Where would I get that
database
> name? The alert has it, does it store it in a system table in msdb?
> Thanks!
>|||This is awesome. I set it up to test and am quite eager to deploy it to
production. Thank you very much.
"Wayne Snyder" <wsnyder@.computeredservices.com> wrote in message
news:eSpn43UIEHA.2744@.TK2MSFTNGP10.phx.gbl...
> There is a group of Alert tokens that you can use...
> For instance, you could create a job that has one step
> Backup log [A-DBN] to disk = 'c:\[A-DBN].logbak'
> When the job is called from an Alert, the token will be replaced (even in
> the filename string... and the appropriate database log will be backed
up...
> But the job can not be run< except from an alert> , because that is the
only
> time the tokens will be replaced..
> For a complete list of Alert tokens, go to Gert Drapers web site
> http://www.sqldev.net/sqlagent/SQLA...ens.htm#Example using TSQL
> step
>
> "Michelle" <michelle@.nospam.com> wrote in message
> news:eDmu1PNIEHA.3664@.TK2MSFTNGP11.phx.gbl...
> backup
call
> will
> By
myself
>
> alert
> database
>

No comments:

Post a Comment