Determining actual DB2® log file usage

The following is the procedure to verify how much space was used by a successful instance of the JnextPlan command:
  1. After JnextPlan has run, log on to the computer where the HCL Workload Automation DB2® server is installed, as the DB2® instance owner (UNIX) or DB2® Administrator (Windows).
  2. Open a DB2® command line window or shell, as follows:
    UNIX
    Follow these steps:
    1. Issue the command su - db2inst1, or change to the subdirectory sqllib of the home directory of the owner of the DB2® instance (by default db2inst1)
    2. Launch the command . ./db2profile
    Windows
    Select from the Start menu, ProgramsIBM DB2Command Line ToolsCommand Window
  3. Run the following command:
    db2 "get snapshot for database on TWS" > snapdb.txt
    where "TWS" must be changed to the actual database name if different
  4. Open the snapdb.txt file and look for a section like this:
             Log space available to the database (Bytes)= 244315359
             Log space used by the database (Bytes)     = 484641
             Maximum secondary log space used (Bytes)   = 0
             Maximum total log space used (Bytes)       = 581636
             Secondary logs allocated currently         = 0

    The value shown in "Maximum total log space used" is the actual space used for the DB2® logs. This space should be allocated to DB2® using primary log files only: therefore, you should change the number of primary log files and their size as necessary to meet this requirement as a minimum.

    In addition, you are recommended to allocate a secondary log space to DB2®. A good choice for the secondary log files is half the number allocated for the primary files.

The snapshot command described in step 3 can be run at any time to keep track of the current usage of the DB2® log space, without a noticeable impact on performance. All metrics shown are useful to monitor the current allocation of DB2® primary and secondary logs at any time, and to determine any required changes.