views:

65

answers:

1

How to find out the current transaction log size? Is it possible to do e.g. by querying some system tables with SQL? It would also be interesting to find out the maximum size for the transaction log.

Is the only option to look it up from the file system?

+1  A: 

The GET DATABASE CONFIGURATION command will give you all the configuration information about a database.

It includes information about the log file size, the number of primary and secondary log files etc. Sample output below.

Log file size (4KB)                         (LOGFILSIZ) = 1024
Number of primary log files                (LOGPRIMARY) = 13
Number of secondary log files               (LOGSECOND) = 4
Changed path to log files                  (NEWLOGPATH) =
Path to log files                                       = D:\DB2\NODE0000\SQL00003\SQLOGDIR\
Overflow log path                     (OVERFLOWLOGPATH) =
Mirror log path                         (MIRRORLOGPATH) =
First active log file                                   =
Block log on disk full                (BLK_LOG_DSK_FUL) = NO
Block non logged operations            (BLOCKNONLOGGED) = NO
Percent max primary log space by transaction  (MAX_LOG) = 0
Num. of active log files for 1 active UOW(NUM_LOG_SPAN) = 0
Michael Sharek
Is it possible to obtain this information by doing some SELECTs to system tables?
Juha Syrjälä