TX Logs

  • Can anyone help?

    I am looking to measure the size of the TX logs on several db's. What I would like to do is every 58th minute of the hour, record the size of the TX log before it is truncated and backed up. Does anyone know of a method that can do this??

  • This will return the size of the Trans Log

    select cast((size / 128.00) as decimal(10,2)) as tl_size from dbname.dbo.sysfiles where status & 66 = 66

    Works with SQL 7 and 2K.

  • Correct me if I'm wrong, but I think the select statement Antares686 provided will give you what you ask for the allocated size of the transaction log, but I think you want to know how much of the allocated transaction log space is used.

    I would suggest you consider trying use the output from DBCC SQLPREF(LOGSIZE) and taking the " Log Size (MB)" and the "Log Space Used (%)" to calculate the current size of the used portion of the transaction log.

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

    Gregory A. Larsen, MVP

  • Gregory, I think you mistyped the command - try

    DBCC SQLPERF(logspace)

    instead.

    Steve Armistead,

    Database Administration

    Panther Systems Northwest, Inc.

    Vancouver, WA

    Steve

  • Ooops. Thank you for correcting my typo!!!!

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

    Gregory A. Larsen, MVP

Viewing 5 posts - 1 through 4 (of 4 total)

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