Oracle 视图 ALL_TAB_MODIFICATIONS 官方解释,作用,如何使用详细说明

本站中文解释

ALL_TAB_MODIFICATIONS 属于 Oracle Data Dictionary 视图,它储存了每张表被编辑过的操作信息,包括 DDL(数据定义语言)和 DML(数据操纵语言)操作,例如表的创建、更改、修改、删除等行为。它可以根据用户指定的参数信息来查询指定的表的变更信息。

使用方法:

语法:
SELECT * FROM ALL_TAB_MODIFICATIONS WHERE TABLE_NAME = ‘表名’

在我们想查看某张表的变更信息时,可以使用 ALL_TAB_MODIFICATIONS 视图查询结果,本质是运行SQL语句查询相应表的变更历史信息,可以获取到更新和删除前后的数据,查询结果包括TABLE_NAME(表名),OPERATION(操作类型),TIMESTAMP(变更时间),USERNAME(操作用户),CTIME(创建时间)等信息。

官方英文解释

ALL_TAB_MODIFICATIONS describes tables accessible to the current user that have been modified since the last time statistics were gathered on the tables.

Related Views

  • DBA_TAB_MODIFICATIONS describes such information for all tables in the database.

  • USER_TAB_MODIFICATIONS describes such information for tables owned by the current user. This view does not display the TABLE_OWNER column.

Column Datatype NULL Description

TABLE_OWNER

VARCHAR2(128)

Owner of the modified table

TABLE_NAME

VARCHAR2(128)

Name of the modified table

PARTITION_NAME

VARCHAR2(128)

Name of the modified partition

SUBPARTITION_NAME

VARCHAR2(128)

Name of the modified subpartition

INSERTS

NUMBER

Approximate number of inserts since the last time statistics were gathered

UPDATES

NUMBER

Approximate number of updates since the last time statistics were gathered

DELETES

NUMBER

Approximate number of deletes since the last time statistics were gathered

TIMESTAMP

DATE

Indicates the last time the table was modified

TRUNCATED

VARCHAR2(3)

Indicates whether the table has been truncated since the last analyze (YES) or not (NO)

DROP_SEGMENTS

NUMBER

Number of partition and subpartition segments dropped since the last analyze

See Also:

  • “DBA_TAB_MODIFICATIONS”

  • “USER_TAB_MODIFICATIONS”


数据运维技术 » Oracle 视图 ALL_TAB_MODIFICATIONS 官方解释,作用,如何使用详细说明