12c之后有单独的DDL日志文件,$ORACLE_BASE/diag/rdbms/xktest/xktest/log/ddl
12c之后有两个DDL日志包含相同的信息。 一个是XML文件,另一个是文本文件
SQL> alter system set enable_ddl_logging=true;
System altered.
SQL> create table t22 (id int);
Table created.
SQL> drop table t22;
Table dropped.
#tail -f /u01/app/oracle/diag/rdbms/orcl/orcl/log/ddl/log.xml
<msg time='2022-06-12T20:59:58.772+08:00' org_id='oracle' comp_id='rdbms'
msg_id='opiexe:4955:2946163730' type='UNKNOWN' group='diag_adl'
level='16' host_id='db02' host_addr='192.168.56.188'
pid='12361' con_uid='1' con_id='1'
con_name='CDB$ROOT'>
<txt>create table t22 (id int)
</txt>
</msg>
<msg time='2022-06-12T21:00:11.037+08:00' org_id='oracle' comp_id='rdbms'
msg_id='opiexe:4955:2946163730' type='UNKNOWN' group='diag_adl'
level='16' host_id='db02' host_addr='192.168.56.188'
pid='2046' con_uid='1' con_id='1'
con_name='CDB$ROOT'>
<txt>truncate table wri$_adv_addm_pdbs
</txt>
</msg>
<msg time='2022-06-12T21:00:11.074+08:00' org_id='oracle' comp_id='rdbms'
msg_id='opiexe:4955:2946163730' type='UNKNOWN' group='diag_adl'
level='16' host_id='db02' host_addr='192.168.56.188'
pid='2046' con_uid='1' con_id='1'
con_name='CDB$ROOT'>
<txt>truncate table wri$_adv_addm_pdbs
</txt>
</msg>
<msg time='2022-06-12T21:00:22.758+08:00' org_id='oracle' comp_id='rdbms'
msg_id='opiexe:4955:2946163730' type='UNKNOWN' group='diag_adl'
level='16' host_id='db02' host_addr='192.168.56.188'
pid='12361' con_uid='1' con_id='1'
con_name='CDB$ROOT'>
<txt>drop table t22
</txt>
</msg>
How to Enable and Monitor DDL Logging in 11g and 12c (Doc ID 2254010.1)
MOS说明
ENABLE_DDL_LOGGING is licensed under Oracle Change Management Pack and it is not offered as a standalone option.
You can create an enhancement request, but it is already mentioned that it is part of Oracle Change Management Pack that needs to be purchased as a separate license.
You can set the parameter to TRUE only if you purchased the license for the above mentioned package.
In 11g we have this DDL Logging information under ADR HOME/alert directory only in XML format and Text Format information will be recorded in alert_.log file
In 12c we have this DDL Logging information under ADR HOME/log/ddl_.log ( Text Format ) and ADR HOME/log/ddl/log.xml ( XML format ).
版权声明:本文为博主原创文章,未经博主允许不得转载。
oracle