参考文章:http://www.cndba.cn/dave/article/1975;http://www.cndba.cn/dave/article/1285
smon_scan_time表介绍:scn和时间的对应关系表,由smon进程维护
scn:系统改变数字,保证数据一致性
一、创建SMON_SCN_TIME表
先对SMON_SCN_TIME进行查询,和表中的记录内同
SQL> desc smon_scn_time
Name Null? Type
----------------------------------------- -------- ----------------------------
THREAD NUMBER
TIME_MP NUMBER
TIME_DP DATE
SCN_WRP NUMBER
SCN_BAS NUMBER
NUM_MAPPINGS NUMBER
TIM_SCN_MAP RAW(1200)
SCN NUMBER
ORIG_THREAD NUMBER
SQL> alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';
Session altered.
SQL> select time_dp,scn from smon_scn_time where rownum<5;
TIME_DP SCN
------------------- ----------
2017-09-23 02:12:55 989929
2017-09-23 02:17:44 990322
2017-09-23 02:23:02 990432
2017-09-23 02:27:44 990533
删除SMON_SCN_TIME表
此时查询表已经不存在
SQL> drop table smon_scn_time;
Table dropped.
SQL> select time_dp,scn from smon_scn_time where rownum<5;
select time_dp,scn from smon_scn_time where rownum<5;
*
ERROR at line 1:
ORA-00942: table or view does not exist
查询SMON_SCN_TIME表创建语句(这里使用的是11g 11.2.04的环境)
SMON_SCN_TIME表重建语句在 $ORACLE_HOME/rdbms/admin/dtxnspc.bsq
rem
rem create the scn<->time tracking table that smon will maintain
rem as a circular queue - notice that we populate the entire
rem table with