Logging pursues an integral part of any application nowadays. Its inseparable, and unquestionable use is of top priority for any project.
Current versions of most popular databases have the Logging Capabilities.
Oracle, in its flavour, gives these capabilities to its users. These can be exercised in three ways.
1. Stores the operational logs in the System Table that can found in the Data Dictionary. The table is called "SYS.AUD$".
2. Operational logs can also be written to the System's Logging System
3. Operational logs can also be written to flat files into the System's directories as we do with conventional logging mechanisms.
Each of these ways pose several advantages and disadvantages. However, this article's scope is to highlight the third option of saving into so called flat files (XML format).
XML will be the choosen standard, for their interoperability with the external systems that would be using these flast operational log files. Their dependance on the live database is zero, because of the nature of the way it is written. And moreover, Oracle supports the quering of the XML Files thus produced.
Follow these steps to enable this third option in an Oracle DB.
1. We need to set the Logfile Directory. This can be set through the following setting.
audit_file_dest='loggingpath'
Note: this has to be an OS directory.
2. Set the Audit_Trial parameter to be XML
audit_trail=xml
You need to restart the Oracle instance for logging to take effect.
You will find the logs in the logging path.