一、将指定的时间(timestamp)转换为scn
SQL> select sysdate from dual;
SYSDATE
---------
03-NOV-17
2. 查询当前时间和scn
SQL> select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') Time,
timestamp_to_scn(sysdate) SCN from dual;
TIME SCN
------------------- ----------
2017-11-03 21:20:48 939576
3. 转换为scn
SQL> select timestamp_to_scn('03-NOV-17 09:20:48.000000000 PM') SCN from dual;
SCN
----------
939576
------------------------------------------------------------------------------
格式1:linux下 sqlplus scott/tiger
1. 查询当前系统时间格式SQL> select sysdate from dual;
SYSDATE
---------
03-NOV-17
2. 查询当前时间和scn
SQL> select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') Time,
timestamp_to_scn(sysdate) SCN from dual;
TIME SCN
------------------- ----------
2017-11-03 21:20:48 939576
3. 转换为scn
SQL> select timestamp_to_scn('03-NOV-17 09:20:48.000000000 PM') SCN from dual;
SCN
----------
939576
------------------------------------------------------------------------------