专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > Oracle技术

高分根据sql语句查询scn

发布时间:2010-05-20 14:01:29 文章来源:www.iduyao.cn 采编人员:星星草
高分求助:根据sql语句查询scn
我找到当时执行的sql语句,想看下提交时的scn,各位老大们,有知道咋查的吗?

------解决方案--------------------
SQL> select count(*) from t;

COUNT(*)
----------
53753

SQL> select sql_text,LAST_ACTIVE_TIME from v$sql where sql_text like '%select count(*) from t%';

SQL_TEXT
-------------------------------------------------------------------------------
----------------------------------------------------------------
LAST_ACTIVE_TI
--------------
select sql_text,LAST_ACTIVE_TIME from v$sql where sql_text like '%select count(*) from t%'
01-9月 -11

select count(*) from t
01-9月 -11


SQL> select sql_text,to_char(LAST_ACTIVE_TIME,'yyyy-mm-dd hh24:mi:ss') from v$sql where sql_text like '%select count(*) from t%';

SQL_TEXT
-------------------------------------------------------------------------------
----------------------------------------------------------------
TO_CHAR(LAST_ACTIVE
-------------------
select sql_text,LAST_ACTIVE_TIME from v$sql where sql_text like '%select count(*) from t%'
2011-09-01 16:10:46

select count(*) from t
2011-09-01 16:09:58

select sql_text,to_char(LAST_ACTIVE_TIME,'yyyy-mm-dd hh24:mi:ss') from v$sql where sql_text like '%select count(*) from t%'
2011-09-01 16:11:31


SQL> select TIMESTAMP_TO_SCN(to_date('2011-09-01 16:11:31','yyyy-mm-dd hh24:mi:ss')) from dual;

TIMESTAMP_TO_SCN(TO_DATE('2011-09-0116:11:31','YYYY-MM-DDHH24:MI:SS'))
----------------------------------
1379145
------解决方案--------------------
select * from t1 as of scn :scn;
------解决方案--------------------
select * from test ;

select sql_text,LAST_ACTIVE_TIME from v$sql
where sql_text like '%select * from test%';

select timestamp_to_scn(to_date('2011/9/2 9:37:08','yyyy/mm/dd hh24:mi:ss')) scn from dual;
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: