dbTalk Databases Forums  

Alter DB maintenance plan

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Alter DB maintenance plan in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Locus Adam
 
Posts: n/a

Default Alter DB maintenance plan - 10-12-2003 , 05:57 PM






I want to change DB maintenance plan from "remove
transaction log if older than 4 weeks" to "remove
transaction log if older tha 1 day", for hundreds of SQL
servers. What is the best way to do it automatically? I
checked system tabels in MSDB but found no info about DB
maintenance plan. How to write a T-SQL or VB to do such a
task? Does SQL DMO offer the properties?

Thanks.

Reply With Quote
  #2  
Old   
Andrew J. Kelly
 
Posts: n/a

Default Re: Alter DB maintenance plan - 10-12-2003 , 09:07 PM






You can do this several ways. One is to update the system tables directly
( sysjobsteps to be exact ) but is the least advisable. Another is to use
sp_update_jobstep. In either case you will need to replace the setting for
4WEEKS to 1DAYS in the current xp_maint command for each job step. You can
do this with a simple REPLACE() command. The trick is to find the right job
steps. BOL has more info on sp_update_jobstep.

--

Andrew J. Kelly
SQL Server MVP


"Locus Adam" <localadm (AT) hotmail (DOT) com> wrote

Quote:
I want to change DB maintenance plan from "remove
transaction log if older than 4 weeks" to "remove
transaction log if older tha 1 day", for hundreds of SQL
servers. What is the best way to do it automatically? I
checked system tabels in MSDB but found no info about DB
maintenance plan. How to write a T-SQL or VB to do such a
task? Does SQL DMO offer the properties?

Thanks.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.