Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2011
    Posts
    9

    Unanswered: db2audit - Execute not returning the SQL

    Hey Guys,

    So I have set up an audit to capture data on who accessed a particular table and what query they ran.

    db2 "create audit policy testpolicy categories execute with data status both error type audit"

    db2 "audit table schema.table using policy testpolicy"

    From here I have a batch script set up to load the data into work tables.

    The issue: Once I'm querying the data in the tables I do not see any SQL.

    Im assuming it should be under the STMTTEXT field in the EXECUTE table however all i get under that field is data like: auditlobs.32554522.5945/

    Does anyone know what I'm doing wrong?. Is it how I'm loading the data maybe?

    Thanks in advance.

  2. #2
    Join Date
    Jul 2013
    Location
    Moscow, Russia
    Posts
    666
    Provided Answers: 55
    Hi dyer,

    the sql text resides in the auditlobs file.
    Load this file by:
    [import | load] ... lobs from path_to_your_files ...

    Regards,
    Mark B.

  3. #3
    Join Date
    Jun 2011
    Posts
    9
    Hey Mark,

    Do you know if there is a way to access this during the initial load so I can see the SQL in the table?

    Cheers

  4. #4
    Join Date
    Jul 2013
    Location
    Moscow, Russia
    Posts
    666
    Provided Answers: 55
    I'm not sure if I got your question correctly...
    After the extraction of the audit records you have your files *.del and auditlobs in some server directory.
    Then you load the information from these files to the database tables where you should see text of your queries if you use this 'lobs from' clause.
    Without this clause db2 utilities assume that these 'auditlobs.32554522.5945/' strings are actually string constants rather then 'link' to the appropriate position inside auditlobs file.

  5. #5
    Join Date
    Jun 2011
    Posts
    9
    Hey Mark,

    Thanks for this.... Was my mistake thought I had done this.

    Thanks again! a great help!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •