Agent Jobs

Run Before Backup Process

It’s generally a good idea whenever you have automated backup processes through Agent Jobs to make sure you have the proper settings in sys.configurations before running the ever so helpful backup process you have in place. This is why I always set the following configurations just before the overall backup process beings.

use master;

set nocount on

declare @sqlversion varchar(25)

set @sqlversion = (select substring (@@version, 21, 5))

if @sqlversion > 2005

begin

exec master..sp_configure ‘show advanced options’, ‘1’ reconfigure;

exec master..sp_configure ‘backup compression default’, ‘1’ reconfigure;

exec master..sp_configure ‘agent xps’, ‘1’ reconfigure;

exec master..sp_configure ‘xp_cmdshell’, ‘1’ reconfigure;

end

else

exec master..sp_configure ‘agent xps’, ‘1’ reconfigure;

exec master..sp_configure ‘xp_cmdshell’, ‘1’ reconfigure;

[/code]

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s