Script Help to SHRINKFILE all User Tlogs

  • I've been around DB admin. for many years (mainframe and Oracle) but am new to SQL Server. We lost our SQL Server DBA and I was handed the job.

    Shortly after taking over, I found many, many db's with Tlogs which ranged in the few Gigs to 100's of Gigs I had to manually go through and truncate these. To avoid the problem again, I found that if I ran scheduled Tlog backups which included a DBCC SHRINKFILE(filename, 10), I could keep the Tlogs to a much more manageble size.

    I wanted to set up a Management Plan to easily address all the user DB's for an instance but the plans only include the capability to BACKUP a log. There is no built-in capability to use DBCC SHRINKFILE for all user DB's.

    I have several questions:

    1. Is it acceptable to use the DBCC SHRINKFILE with each Tlog backup?
    2. Is there a better way
    3. does anyone know of a way to apply the DBCC SHRINKFILE for all user db's in one management plan
    4. Should I even be using a management plan

    Thanks for any help provided.

  • Hi

    If you are taking regular log backups then your log file size should not grow to a large size. You can shrink log files only when you feel they have increase in size beyond a measure. However this would not be very often since you are taking regular log backups.

    "Keep Trying"

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply