1. Forum Rules (PLEASE CLICK HERE TO READ BEFORE POSTING) Click the link to access ADSM.ORG Acceptable Use Policy and forum rules which should be observed when using this website. Violators may be banned from this website. This message will disappear after you have made at least 12 posts. Thank you for your cooperation.

need query to locate DB2 logs

Discussion in 'DB2' started by cheffern, Feb 18, 2011.

  1. cheffern

    cheffern Senior Member

    Joined:
    Mar 9, 2005
    Messages:
    1,004
    Likes Received:
    7
    Occupation:
    TSM Admin / Database & SAP Admin
    Location:
    Massachusetts, USA
    hi all -

    have a customer asking if there will be a way using new DB2 log management auto archive logs from node --> TSM diskpool --> tape to find out where exactly a log is at a given point in time.
    so basically the customer wants to know if there is a query we can run to be able to grab the info on a log and see where it is (is it on the node? is it on the TSM diskpool? or is it on tape?).
    my first thought of course was db2adutl query - but I don't think we can get that level of detail...
    on the server side the logs would be stored as 'objects' to TSM's knowledge, right?
    so how would one be able to get this info - one log or even a group/range of DB2 logs and where they are?

    thanks in advance for any / all stabs at this!
    -Chef.
     
  2.  
  3. cfhoffmann

    cfhoffmann New Member

    Joined:
    Jun 2, 2005
    Messages:
    93
    Likes Received:
    3
    Occupation:
    TSM Storage Specialist
    Location:
    Sydney, Australia
    Since DB2 logs are stored as archives I'd try 'SELECT * FROM ARCHIVES WHERE ....' to get the log names, dates and object ids:

    NODE_NAME: BIGSERVER_DB2
    FILESPACE_NAME: /INDEXDB
    FILESPACE_ID: 1
    TYPE: FILE
    HL_NAME: /NODE0000/
    LL_NAME: C0000000_S0003611.LOG
    OBJECT_ID: 1478716952 <--------------------
    ARCHIVE_DATE: 2010-01-25 21:10:22.000000

    and then using the object id run 'show bfo 0 1478716952' to show you the primary and copy stgpool volumes the DB2 log is actually stored on:

    Bitfile Object: 0.1478716952

    **Archival Bitfile Entry
    Bitfile Type: PRIMARY Storage Format: 22
    Bitfile Size: 0.22977590 Number of Segments: 1
    Storage Pool ID: 20 Volume ID: 15384 Volume Name: XX0429 <------
    **Archival Bitfile Entry
    Bitfile Type: COPY Storage Format: 22
    Bitfile Size: 0.22977590 Number of Segments: 1
    Storage Pool ID: -4 Volume ID: 20435 Volume Name: AA0528 <------
     
    Last edited: Feb 26, 2011
: db2, log, query, tsm

Share This Page