Oracle数据库11g新特性:事务管理
2008-12-16 13:03:10 来源:WEB开发网 elect txn_amt
from trans
as of timestamp to_timestamp ('07/18/2007 12:39:00','mm/dd/yyyy hh24:mi:ss')
where trans_id = 2;
TXN_AMT
----------
19325.67
现在,隔一段时间,当还原数据从还原段中清除后,再次查询这个闪回数据:
select txn_amt
from trans
as of timestamp to_timestamp ('07/18/2007 12:39:00','mm/dd/yyyy hh24:mi:ss')
where trans_id = 2;
结果返回:19325.67. 还原数据已经清除了,那么这个数据来自何处呢?
我们问问 Oracle.您可以使用自动跟踪来查看执行计划:
SQL> set autotrace traceonly explain
SQL> select txn_amt
2 from trans
3 as of timestamp to_timestamp ('07/18/2007 12:39:00','mm/dd/yyyy hh24:mi:ss')
4 where trans_id = 2;
Execution Plan
----------------------------------------------------------
Plan hash value: 535458644
----------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop
-------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 2 | 52 | 10 (10)| 00:00:01 | |
| 1 | VIEW | | 2 | 52 | 10 (10)| 00:00:01 | |
| 2 | UNION-ALL | | | | | | |
|* 3 | FILTER | | | | | | |
| 4 | PARTITION RANGE SINGLE| | 1 | 52 | 3 (0)| 00:00:01 | 1 | 1
|* 5 | TABLE ACCESS FULL | SYS_FBA_HIST_68909 | 1 | 52 | 3 (0)| 00:00:01 | 1 | 1
|* 6 | FILTER | | | | | | |
|* 7 | HASH JOIN OUTER | | 1 | 4053 | 10 (10)| 00:00:01 | |
|* 8 | TABLE ACCESS FULL | TRANS | 1 | 38 | 6 (0)| 00:00:01 | |
| 9 | VIEW | | 2 | 8030 | 3 (0)| 00:00:01 | |
|* 10 | TABLE ACCESS FULL | SYS_FBA_TCRV_68909 | 2 | 8056 | 3 (0)| 00:00:01 | |
-------------------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
3 - filter(NULL IS NOT NULL)
5 - filter("TRANS_ID"=2 AND "ENDSCN">161508784336056 AND "ENDSCN"<=1073451 AND ("STARTSCN" IS NULL
OR "STARTSCN"<=161508784336056))
6 - filter("F"."STARTSCN"<=161508784336056 OR "F"."STARTSCN" IS NULL)
7 - access("T".ROWID=("F"."RID"(+)))
8 - filter("T"."VERSIONS_STARTSCN" IS NULL AND "T"."TRANS_ID"=2)
10 - filter(("ENDSCN" IS NULL OR "ENDSCN">1073451) AND ("STARTSCN" IS NULL OR "STARTSCN"<1073451))
Note
-----
- dynamic sampling used for this statement
该输出回答了我们的疑问“这个数据来自何处?”,数据来自表 SYS_FBA_HIST_68909,这是您先前为那个表定义的闪回存档中的某个位置。您可以查看这个表,但是 Oracle 不支持在那里直接查看数据。不过,我觉得您也没有必要那样做。
- ››oracle 中 UPDATE nowait 的使用方法
- ››Oracle ORA-12560解决方法
- ››Oracle 10g RAC 常用维护命令
- ››Oracle如何在ASM中定位文件的分布
- ››Oracle的DBMS_RANDOM.STRING 的用法
- ››oracle 外部表导入时间日期类型数据,多字段导入
- ››Oracle中查找重复记录
- ››oracle修改用户登录密码
- ››Oracle创建删除用户、角色、表空间、导入导出等命...
- ››Oracle中登陆时报ORA-28000: the account is lock...
- ››Oracle数据库在配置文件中更改最大连接数
- ››Oracle中在pl/sql developer修改表的两种方式
更多精彩
赞助商链接