小编给大家分享一下oracle12c中enable_ddl_logging怎么用,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!
1、设置参数,动态参数
SQL> alter system set enable_ddl_logging=true; System altered. SQL> create table t (id int); Table created. SQL> alter session set container=pdb1; Session altered. SQL> drop table t; Table dropped. SQL>
2、查看ddl日志
<roidb01:cdb:/u01/app/oracle/diag/rdbms/cdb/cdb/log>$cd ddl <roidb01:cdb:/u01/app/oracle/diag/rdbms/cdb/cdb/log/ddl>$ls log.xml <roidb01:cdb:/u01/app/oracle/diag/rdbms/cdb/cdb/log/ddl>$tail -f log.xml level='16' host_id='roidb01' host_addr='fe80::9e8:140c:99e6:7ad9%enp0s3'> <txt>truncate table t </txt> </msg> <msg time='2018-01-25T11:11:10.940+08:00' org_id='oracle' comp_id='rdbms' msg_id='opiexe:4428:2946163730' type='UNKNOWN' group='diag_adl' level='16' host_id='roidb01' host_addr='fe80::9e8:140c:99e6:7ad9%enp0s3'> <txt>create table t (id int) </txt> </msg> <msg time='2018-01-25T11:12:41.503+08:00' org_id='oracle' comp_id='rdbms' msg_id='kpdbLogDDL:19042:2946163730' type='UNKNOWN' group='diag_adl' level='16' host_id='roidb01' host_addr='fe80::9e8:140c:99e6:7ad9%enp0s3'> <txt>drop table t </txt> </msg> ^C <roidb01:cdb:/u01/app/oracle/diag/rdbms/cdb/cdb/log/ddl>$pwd /u01/app/oracle/diag/rdbms/cdb/cdb/log/ddl ---路径在这里 <roidb01:cdb:/u01/app/oracle/diag/rdbms/cdb/cdb/log/ddl>$
以上是“oracle12c中enable_ddl_logging怎么用”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注亿速云行业资讯频道!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。