签到成功

知道了

CNDBA社区CNDBA社区

oracle ENABLE_DDL_LOGGING

2022-06-12 22:03 969 0 原创 oracle
作者: hbhe0316

12c之后有单独的DDL日志文件,$ORACLE_BASE/diag/rdbms/xktest/xktest/log/ddl
12c之后有两个DDL日志包含相同的信息。 一个是XML文件,另一个是文本文件http://www.cndba.cn/hbhe0316/article/108064http://www.cndba.cn/hbhe0316/article/108064http://www.cndba.cn/hbhe0316/article/108064

http://www.cndba.cn/hbhe0316/article/108064
http://www.cndba.cn/hbhe0316/article/108064http://www.cndba.cn/hbhe0316/article/108064http://www.cndba.cn/hbhe0316/article/108064

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说明

http://www.cndba.cn/hbhe0316/article/108064
http://www.cndba.cn/hbhe0316/article/108064http://www.cndba.cn/hbhe0316/article/108064

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

用户评论
* 以下用户言论只代表其个人观点,不代表CNDBA社区的观点或立场
hbhe0316

hbhe0316

关注

1.只有承认无知,才能装下新的东西; 2.进步来自一点点滴滴的积累; 3.广博让你更优秀,而专业让你无法替代; 4.挫折和失败能够转换为一种财富。

  • 889
    原创
  • 1
    翻译
  • 13
    转载
  • 24
    评论
  • 访问:1171276次
  • 积分:1523
  • 等级:核心会员
  • 排名:第6名
精华文章
    最新问题
    查看更多+
    热门文章
      热门用户
      推荐用户
        Copyright © 2016 All Rights Reserved. Powered by CNDBA · 皖ICP备2022006297号-1·

        QQ交流群

        注册联系QQ