您的位置:首页 > 其它

【原】根据scn查看数据是否成功写入磁盘

2012-08-05 17:54 267 查看
作者:david_zhang@sh 【转载时请以超链接形式标明文章】

链接:/article/6413185.html

SQL>  select file#,checkpoint_change#,to_char(checkpoint_time,'yyyy-mm-dd hh24:mi:ss') from v$datafile;

FILE# CHECKPOINT_CHANGE# TO_CHAR(CHECKPOINT_
---------- ------------------ -------------------
1            1787744 2012-08-05 16:04:29
2            1787744 2012-08-05 16:04:29
3            1787744 2012-08-05 16:04:29
4            1787744 2012-08-05 16:04:29
5            1787744 2012-08-05 16:04:29
6            1787744 2012-08-05 16:04:29
7            1787744 2012-08-05 16:04:29

7 rows selected.

SQL> select current_scn from v$database;

CURRENT_SCN
-----------
1788412


说明SCN1787744之前的所有数据,已经同步到数据文件,但是之后的数据更改信息依然存在于内存中

scn_to_timestamp //SCN 和时间的转换工具

SQL> select to_char(scn_to_timestamp(1787744),'yyyy-mm-dd hh24:mi:ss') from dual;

TO_CHAR(SCN_TO_TIME
-------------------
2012-08-05 16:04:29

SQL> !date Sun Aug  5 16:23:20 CST 2012


//也就是说,2012-08-05 16:04:29之前的所有数据都已经写到了磁盘文件上
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐