数据库参数:ENABLE_DDL_LOGGING开启DDL操作记录

ENABLE_DDL_LOGGING默认为false。可以在线修改为true。

SQL> show parameter ENABLE_DDL_LOGGING 

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
enable_ddl_logging                   boolean     FALSE

修改的命令如下:

alter system set enable_ddl_logging=true;

日志分别记录到xml文件与文本文件中。xml文件在ADR home的log/ddl路径下,文本文件在$ORACLE_BASE/diag/rdbms///log/ddl_.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
在11.2.0.4.之前是不记录RENAME table的操作

Related Posts