码迷,mamicode.com
首页 > 其他好文 > 详细

12c 特性(enable_ddl_logging)

时间:2018-01-25 12:05:41      阅读:346      评论:0      收藏:0      [点我收藏+]

标签:logging   参数   XML   blog   txt   create   ddl   int   1.5   

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>$

12c 特性(enable_ddl_logging)

标签:logging   参数   XML   blog   txt   create   ddl   int   1.5   

原文地址:http://blog.51cto.com/roidba/2064968

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!