---查询当前scn
SQL> select current_scn from v$database;
CURRENT_SCN
------------
49733519430
SQL> select dbms_flashback.get_system_change_number scn from dual;
SCN
---------------
49733520950
--- scn 转换成时间
SQL> select scn_to_timestamp(49733520950) scn from dual;
SCN
---------------------------------------------------------------------------
18-11月-14 04.44.57.000000000 下午
---时间转化成scn
SQL> select timestamp_to_scn(to_timestamp('2014-11-10 18:19:20.123456789','YYYY-MM-DD HH24:MI:SS.FF')) scn from dual;
SCN
---------------
49733322505
scn和时间的对应关系
SQL> select scn,to_char(time_dp,'yyyy-mm-dd hh24:mi:ss') time from sys.smon_scn_time where rownum<10 order by 1,2;
SCN TIME
--------------- ---------------------------------------------------------
49733225694 2014-10-30 22:05:40
49733230790 2014-10-31 00:50:13
49733230906 2014-10-31 00:55:25
49733231047 2014-10-31 01:00:34
49733231152 2014-10-31 01:05:42
49733234525 2014-10-31 03:24:43
49733234648 2014-10-31 03:29:52
49733234760 2014-10-31 03:35:03
49733234861 2014-10-31 03:40:12
9 rows selected.