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

本站中文解释

V$FLASHBACK_TXN_MODS视图用于查看当前实例下正在进行flashback事务(Flashback Transaction)的更改,该视图内包含所有正在进行flashback修改的事务和表。用户可通过它获取事务提交前和提交后的更新行,也可以查看事务是否已经提交,以及它包含哪些更改。

V$FLASHBACK_TXN_MODS视图只在使用Flashback Transaction时可用,而且只能由用户查看,不能修改或删除表中的数据。其中字段FTXID用于标记被修改的行,精确记录了被修改的表的名字、修改的列的名字和修改的内容。

使用V$FLASHBACK_TXN_MODS视图的方法如下:

1.确定正在进行Flashback Transaction的表/库
使用SQL脚本:
SELECT * from V$FLASHBACK_TXN_MODS;

2.检查存储在此表/库中的更改
使用SQL脚本:
SELECT FTXID, FTX_OPTY, TABLE_NAME, COLUMN_NAME, OLD_VALUE, NEW_VALUE
FROM V$FLASHBACK_TXN_MODS WHERE FTXID = ;

其中 txidNumber 所指定的值在第一步上语句中可以获得。

3.恢复数据
使用SQL脚本:
EXECUTE FLASHBACK_TRANSACTION(txidNumber);

其中 txidNumber 所指定的值在第一步上语句中可以获得。

官方英文解释

V$FLASHBACK_TXN_MODS displays the individual modifications of all the transactions in memory.

This view is relevant AFTER a compensating transaction has been started through the DBMS_FLASHBACK.TRANSACTION_BACKOUT() set of functions, and is no longer relevant once the compensating transaction is either committed or rolled back. It also provides a tabular representation of the undo SQL that is not available through the CLOB XML construct in the DBA_FLASHBACK_TXN_REPORT view.

Column Datatype Description

COMPENSATING_XID

RAW(8)

Transaction ID of the compensating transaction

COMPENSATING_TXN_NAME

VARCHAR2(255)

Name of the compensating transaction

XID

RAW(8)

Transaction ID of a relevant transaction found in memory

TXN_NAME

VARCHAR2(255)

Name of the transaction with XID as the transaction ID; NULL if none

PARENT_XID

RAW(8)

Parent transaction ID (for a PDML transaction)

INTERESTING

NUMBER

If the transaction is in the transaction dependency graph

ORIGINAL

NUMBER

If the transaction is part of the input set provided

BACKOUT_SEQ

NUMBER

Order in which the transaction has been backed out

UNDO_SQL

VARCHAR2(4000)

Undo SQL for the modification

UNDO_SQL_SQN

NUMBER

Order in which the given SQL has been executed to back out this transaction

UNDO_SQL_SUB_SQN

NUMBER

If the undo SQL is greater than 4000 bytes, then a sequence number, starting from 1, of a 4000-byte division of the undo SQL

BACKOUT_SQL_ID

NUMBER

SQL ID of the undo SQL (used only for this compensating transaction)

OPERATION

VARCHAR2(128)

Operation (such as insert/update/delete) performed by the forward-going operation

BACKEDOUT

NUMBER

Indicates whether the transaction has been backed out as of now

CONFLICT_MOD

NUMBER

If the concerned modification is causing a conflict

MODS_PER_LCR

NUMBER

Sometimes an LCR could cause multiple modifications (for example, an update of an IOT could actually be a delete followed by an insert)

CON_ID

NUMBER

The ID of the container to which the data pertains. Possible values include:

  • 0: This value is used for rows containing data that pertain to the entire CDB. This value is also used for rows in non-CDBs.

  • 1: This value is used for rows containing data that pertain to only the root

  • n: Where n is the applicable container ID for the rows containing data

See Also:

  • “DBA_FLASHBACK_TXN_REPORT”

  • Oracle Database PL/SQL
    Packages and Types Reference
    for more information about the DBMS_FLASHBACK.TRANSACTION_BACKOUT procedures


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