ENABLE_DDL_LOGGING 引數使用 監控物件的DDL

yewushang發表於2015-05-15

當需要確定某些ddl操作什麼時候發生,確定是表啥時間被動了,可以設定此引數。

此引數支援動態調整。
alter system set enable_ddl_logging=true;

效果圖如下:
SQL> create table tmp_lk as select * from dba_objects where rownum=1;


Table created.


SQL> alter table tmp_lk modify object_name varchar2(100);


Table altered.


SQL> 

告警日誌如下:
2015-05-15 17:18:20.128000 +08:00
ALTER SYSTEM SET enable_ddl_logging=TRUE SCOPE=BOTH;
2015-05-15 17:18:55.148000 +08:00
create table tmp_lk as select * from dba_objects where rownum=1
2015-05-15 17:20:12.431000 +08:00
alter table tmp_lk modify object_name varchar2(100)



ENABLE_DDL_LOGGING

Property Description
Parameter type Boolean
Default value false
Modifiable ALTER SESSION, ALTER SYSTEM
Range of values true | false
Basic No

ENABLE_DDL_LOGGING enables or disables the writing of a subset of DDL statements to the alert log.

When ENABLE_DDL_LOGGING is set to true, the following DDL statements are written to the alert log:

  • ALTER/CREATE/DROP/TRUNCATE CLUSTER

  • ALTER/CREATE/DROP FUNCTION

  • ALTER/CREATE/DROP INDEX

  • ALTER/CREATE/DROP OUTLINE

  • ALTER/CREATE/DROP PACKAGE

  • ALTER/CREATE/DROP PACKAGE BODY

  • ALTER/CREATE/DROP PROCEDURE

  • ALTER/CREATE/DROP PROFILE

  • ALTER/CREATE/DROP SEQUENCE

  • CREATE/DROP SYNONYM

  • ALTER/CREATE/DROP/RENAME/TRUNCATE TABLE

  • ALTER/CREATE/DROP TRIGGER

  • ALTER/CREATE/DROP TYPE

  • ALTER/CREATE/DROP TYPE BODY

  • DROP USER

  • ALTER/CREATE/DROP VIEW

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29477587/viewspace-1656549/,如需轉載,請註明出處,否則將追究法律責任。

相關文章