Search code examples
loggingdb2db2-express-c

Where is the log file of changes in the database?


Where can I find the log file of changes in the database DB2 Express-C for Windows? I looked for the logging file and can't find it.


Solution

  • Stackoverflow is a programming website, but your question is not about programming. Your question can easily be answered by referring to and careful study of the Db2 documentation for your version of Db2 .

    Db2 uses transaction log files to record logged changes to database objects. As with many other RDBMS engines that use write-ahead logging, the data is stored separately from the transaction logs.There can be many of these transaction log files and there are many configuration options to determine logging behaviour. Study the documentation here and all related pages.

    One (of many) database configuration parameters is the 'Path to log files', which defaults on Microsoft-Windows operating systems to "c:\DB2\NODE0000\SQL00001\LOGSTREAM0000' (the bolded numbers can vary, as can the Db2-instance name DB2 depending on user choice).

    The documentation also describes the structure of a transaction log file, and an API to read the transaction-logs. This is for advanced users with sufficient programming skills, and the time to study all the details.