DDL Logging in Oracle 12c

Share via:

Dear Readers,

In this article, we will see the following DDL Logging in Oracle 12c.

What is DDL Logging ?

Concerning the Data Definition Language log, or DDL log, in previous releases, there wasn’t any direct option available to log the DDL command/action. Like an example we can says that if any user perform any DDL operation then it will not log by default in oracle database.

Though, In oracle database 11g added some support for DDL logging of RDBMS DDL statements into the alert log. If we turned on DDL logging in oracle database 12c then RDBMS DDL logging will write to a new ADR file type that has the same format and basics behavior as the alert log, but it contains only DDL statements and Timestamp.

How to enable?
Lets’ look at how to enable this 12c new feature as part of enhancement for monitoring 12c information.

Check the DDL is Enabled or Disabled.

Now enable by using following statement.

Where all log will go?

DDL log will be logged in two different places in two different formats

XML format :

1.$ORACLE_BASE/diag/rdbms/{DB_NAME}/{SID}/log/ddl/log.xml

Or

$ADR_HOME/log/ddl/log.xml

Text format :

2.$ORACLE_BASE/diag/rdbms/{DB_NAME}/{SID}/log/ddl_{instance}.log

Or

$ADR_HOME/log/ddl_{instance}.log

Note :

Incase if you are using Container  database then all pluggable database DDL will goes into the same log file.

Let’s execute some DDL statements to check the log files.

We have created two table(ktexperts,ktexperts1) and one common user(c##ktexperts) and dropped.

These DDL lines will be in logs .

Will check

more log.xml

Or

Else you can check in ddl_orcl.log

more ddl_orcl.log

How to disable?

check status

To Disable follow below command

Licensing

The use of init.ora parameters ENABLE_DDL_LOGGING  is licensed under Oracle Change Management Pack when set to TRUE. By default parameter value if FALSE.

 

Thank you for giving your valuable time to read the above information. Please click here to subscribe for further updates

KTEXPERTS is always active on below social media platforms.

Facebook : https://www.facebook.com/ktexperts/
LinkedIn : https://www.linkedin.com/company/ktexperts/
Twitter : https://twitter.com/ktexpertsadmin
YouTube : https://www.youtube.com/c/ktexperts
Instagram : https://www.instagram.com/knowledgesharingplatform

Share via:
Note: Please test scripts in Non Prod before trying in Production.
1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 5.00 out of 5)
Loading...

Add Comment