Adsense Ad

Tuesday, 3 September 2019

Oracle 12c New Features " DDL logging "


There was no direction option available to log the DDL action in the previous releases. In 12cR1, you can now log the DDL action into XML and log files. This will be very useful to know when the drop or create command was executed and by who. The ENABLE_DDL_LOGGING initiation parameter must be configured in order to turn on this feature. The parameter can be set at the database or session levels. 

When this parameter is enabled, all DDL commands are logged in an XML and a log file under the $ORACLE_BASE/diag/RDBMS/DBNAME/log|ddl location. An XML file contains information, such as DDL command, IP address, timestamp etc. This helps to identify when a user or table dropped or when a DDL statement is triggered.

To enable DDL login

SQL> ALTER SYSTEM|SESSION SET ENABLE_DDL_LOGGING=TRUE;

The following DDL statements are likely to be recorded in the XML/log file:

o CREATE|ALTER|DROP|TRUNCATE TABLE
o DROP USER
o CREATE|ALTER|DROP PACKAGE|FUNCTION|VIEW|SYNONYM|SEQUENCE

The DDL logging data is written in XML format to the file located at 

$DIAG\rdbms\DBName\INSTNAME\log\ddl

No comments: