Oracle 参数 ENABLE_DDL_LOGGING 官方解释,作用,如何配置最优化建议

本站中文解释

ENABLE_DDL_LOGGING用于启用DDL语句记录,如建表、更改表结构等,以跟踪DDL变更历史。每隔一段时间,系统都会将DDL日志信息写入控制文件中,以形成一个数据库恢复点。

如果要正确设置ENABLE_DDL_LOGGING,需要在全局参数中设置。

ALTER SYSTEM SET enable_ddl_logging=TRUE SCOPE=MEMORY;

如果设置时未指定范围,则默认值为SPFILE。另外,还可以通过alter session语句设置会话参数:

ALTER SESSION SET enable_ddl_logging=TRUE;

官方英文解释

ENABLE_DDL_LOGGING enables or disables the writing of a subset of data definition language (DDL) statements to a DDL log.

Property Description

Parameter type

Boolean

Default value

false

Modifiable

ALTER SESSION, ALTER SYSTEM

Modifiable in a PDB

Yes

Range of values

true | false

Basic

No

The DDL log is a file that has the same format and basic behavior as the alert log, but it only contains the DDL statements issued by the database. The DDL log is created only for the RDBMS component and only if the ENABLE_DDL_LOGGING initialization parameter is set to true. When this parameter is set to false, DDL statements are not included in the DDL log, but they are included in the alert log.

The DDL log contains one log record for each DDL statement issued by the database. The DDL log is included in IPS incident packages.

There are two DDL logs that contain the same information. One is an XML file, and the other is a text file. The DDL log is stored in the log/ddl subdirectory of the ADR home.

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

  • ALTER/CREATE/DROP/TRUNCATE CLUSTER

  • ALTER/CREATE/DROP FUNCTION

  • GRANT

  • 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

  • REVOKE

  • 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

Note:

The DDL statement written to the log may be truncated. You can use DDL triggers to view the entire DDL statement. See Oracle Database PL/SQL
Language Reference
for more information about DDL triggers.

See Also:

Oracle Database Licensing
Information User Manual
for licensing information for the ENABLE_DDL_LOGGING initialization parameter.


数据运维技术 » Oracle 参数 ENABLE_DDL_LOGGING 官方解释,作用,如何配置最优化建议