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 |
---|---|---|
|
|
Transaction ID of the compensating transaction |
|
|
Name of the compensating transaction |
|
|
Transaction ID of a relevant transaction found in memory |
|
|
Name of the transaction with |
|
|
Parent transaction ID (for a PDML transaction) |
|
|
If the transaction is in the transaction dependency graph |
|
|
If the transaction is part of the input set provided |
|
|
Order in which the transaction has been backed out |
|
|
Undo SQL for the modification |
|
|
Order in which the given SQL has been executed to back out this transaction |
|
|
If the undo SQL is greater than 4000 bytes, then a sequence number, starting from |
|
|
SQL ID of the undo SQL (used only for this compensating transaction) |
|
|
Operation (such as insert/update/delete) performed by the forward-going operation |
|
|
Indicates whether the transaction has been backed out as of now |
|
|
If the concerned modification is causing a conflict |
|
|
Sometimes an LCR could cause multiple modifications (for example, an update of an IOT could actually be a delete followed by an insert) |
|
|
The ID of the container to which the data pertains. Possible values include:
|
See Also:
-
“DBA_FLASHBACK_TXN_REPORT”
-
Oracle Database PL/SQL
Packages and Types Reference for more information about theDBMS_FLASHBACK.TRANSACTION_BACKOUT
procedures