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

本站中文解释

Oracle视图FLASHBACK_TRANSACTION_QUERY是一个支持光回滚事务查询的内置视图,使用该视图可以查询最近一段时间内数据库表中发生变化的会话。它允许用户查看某个事务发生的时间,以及当时动作如何影响数据库中的内容。

使用方法:

1. 首先,应该向Oracle提供要查询的表的名称,以及要查询的时间范围(例如一周前发生变化的事务);

2. 然后,使用SELECT语句来从FLASHBACK_TRANSACTION_QUERY视图中查询需要的数据,如下所示:

SELECT * FROM FLASHBACK_TRANSACTION_QUERY WHERE table_name = ‘name_of_your_table’ AND action_ timestamp >= ‘start_timestamp’ AND action_timestamp

官方英文解释

FLASHBACK_TRANSACTION_QUERY displays information about all flashback transaction queries in the database.

The database must have at least minimal supplemental logging enabled to avoid unpredictable behavior.

Column Datatype NULL Description

XID

RAW(8)

Transaction identifier

START_SCN

NUMBER

Transaction start system change number (SCN)

START_TIMESTAMP

DATE

Transaction start timestamp

COMMIT_SCN

NUMBER

Transaction commit system change number; NULL for active transactions

COMMIT_TIMESTAMP

DATE

Transaction commit timestamp; NULL for active transactions

LOGON_USER

VARCHAR2(128)

Logon user for the transaction

UNDO_CHANGE#

NUMBER

Undo system change number (1 or higher)

OPERATION

VARCHAR2(32)

Forward-going DML operation performed by the transaction:

  • D – Delete

  • I – Insert

  • U – Update

  • B

  • UNKNOWN

TABLE_NAME

VARCHAR2(256)

Name of the table to which the DML applies

TABLE_OWNER

VARCHAR2(386)

Owner of the table to which the DML applies

ROW_ID

VARCHAR2(19)

Rowid of the row that was modified by the DML

UNDO_SQL

VARCHAR2(4000)

SQL to undo the DML indicated by OPERATION

See Also:

Oracle Database
Utilities
for information on how to enable minimal supplemental logging


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