ADSM-L

Re: [ADSM-L] Shrinking the SQL logs after TDP full backup

2007-10-31 10:44:03
Subject: Re: [ADSM-L] Shrinking the SQL logs after TDP full backup
From: "Quirt, Tom" <tquirt AT SHOPTHEPIG DOT COM>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Wed, 31 Oct 2007 09:43:43 -0500
In sql enterprise manager right click on the database and go to
properties.  Look at the options tab put a checkmark in the shrink log
box.  Within TSM from the sql gui check the truncate log box in the
backup tab.  
Should do it. 

-----Original Message-----
From: ADSM: Dist Stor Manager [mailto:ADSM-L AT VM.MARIST DOT EDU] On Behalf Of
Steven Harris
Sent: Wednesday, October 31, 2007 12:20 AM
To: ADSM-L AT VM.MARIST DOT EDU
Subject: Re: [ADSM-L] Shrinking the SQL logs after TDP full backup

Rick,

I don't normally take this line,  I like to be helpful, but Why is this
your problem?

We have our areas of expertise,  DBAs have theirs.  Big logs falls
neatly
into theirs IMO.  Or are you in one of those one-man-band shops?

Regards

Steve

Steven Harris
TSM Admin

Sydney Australia






             Rick Harderwijk
             <rick.harderwijk@
             GMAIL.COM>
To
             Sent by: "ADSM:           ADSM-L AT VM.MARIST DOT EDU
             Dist Stor
cc
             Manager"
             <[email protected]
Subject
             .EDU>                     [ADSM-L] Shrinking the SQL logs
                                       after TDP full backup

             31/10/2007 08:09
             AM


             Please respond to
             "ADSM: Dist Stor
                 Manager"
             <[email protected]
                   .EDU>






Hi *

I have been staring at this problem for too long now and I need it
fixed.
We
have some rather large transaction logs on our MSSQL2005 servers because
some backups went wrong for some time. Now that the backups are a-ok
again, I need to shrink those logfiles, and I could do that from osql
with
dbcc shrinkfile, but I'd rather make it stick - so I thought I'd put it
in
as part of the TDP backup cycle. However, I cannot figure out how to do
it.
I do not have powershell installed on the machines, so that is out. DMO
is
a
way to go, but will be discontinued, so why bother and I just can't get
it
right with SMO and VBScript - I'm no expert in VBScripting, but with the
right examples I usually can manage something that seems pretty basic to
me
as lined out below...

What I need is:

1. Check what databases are on the server (as new databases are added
over
time I do not wish to rewrite the script every time)
2. Get the physical names of the logfiles for each and every one of
those
databases
3. Shrink the logfiles so it will free up diskspace.

@2 - I might need to add an extra check to make sure I only shrink the
logfiles of the databases that are in full recovery mode.

I'm sure people are doing this - otherwise all the transaction logs
would
be
way too big - but I just cannot find the info I need.

I was hoping maybe you could help...


Cheers,

Rick