标签: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>$
标签:logging 参数 XML blog txt create ddl int 1.5
原文地址:http://blog.51cto.com/roidba/2064968