-1

Is there a way to export logs from a DB2 database on Iseries Power 8 to a syslog collector like graylog please?

thanks, Bryan

Bryan
  • 1
  • 1
  • What sort of log are you looking for? – jmarkmurphy Oct 30 '17 at 12:07
  • Google is your friend... – Charles Oct 30 '17 at 13:19
  • @jmarkmurphy Its to see sql statements requested on the DB2 for i – Bryan Oct 31 '17 at 11:48
  • @Charles If you are a specialist on antiquity system, its good for you but i'm not.. and i find very few informations on google about that point and I dont understand it... – Bryan Oct 31 '17 at 13:28
  • @Bryan If you're using an AS/400...then yes it's an antique....but if you're running IBM i v7 on a POWER system...then it's far from an antique. You'd get a better answer if you told us what version of the OS you're using and what specific logs you're looking for. – Charles Oct 31 '17 at 16:58
  • ok, goal is to set up an alternative to Guardium that is too expensive, i can manage vulnerabilities assessment with other software but i need to monitor all SQL statements requested on the DB, I only need timestamps, full SQL statements and who execute the request. Version of the OS is V7R10 – Bryan Nov 02 '17 at 05:44

2 Answers2

0

Try

QSYS2.DISPLAY_JOURNAL()

QSYS2.HISTORY_LOG_INFO()

these are new functions in IBM i 7.3 that were just released

More info here:

https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/IBM%20i%20Technology%20Updates/page/Db2%20for%20i%20generated%20syslog%20history%20and%20audit%20journal

PHPDave
  • 904
  • 1
  • 7
  • 15
  • Hello, thanks for your thought, but we don't have this new version. The goal of my question is to trace sql statements, I have try DBMON, but all variables aren't "resolved" and appears as question marks. I will dig around the new functions. – Bryan Oct 31 '17 at 11:19
  • SQL statements are not recorded in QAUDJRN so i dont think it would be possible via these new functions – Bryan Oct 31 '17 at 12:37
  • Hmm try and get to the SQL Plan Cache statements then. I'm unsure how to get that. – PHPDave Nov 07 '17 at 14:07
0

If you just want to log an activity for particular physical file (DB2 table) you can enable journaling for it (which is a kind of db logging) and retrieve tons of details from it. You can find more info here.

Kociamber
  • 1,048
  • 8
  • 16