Welcome 微信登录

首页 / 数据库 / MySQL / Oracle的SCN增长间隔时间

查看Oracle数据库版本
·SQL> select * from v$version;BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE11.2.0.1.0Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production·查看当前scn,如下:
·SQL>select dbms_flashback.get_system_change_number from dualGET_SYSTEM_CHANGE_NUMBER
------------------------
1155901
·SQL> select current_scn from v$database;CURRENT_SCN
-----------
1155934·采用scn_to_timestamp获取scn与时间的对应关系如下:
·SQL> select scn_to_timestamp(&scn) from dual;
Enter value for scn: 1155901
old1: select scn_to_timestamp(&scn) from dual
new1: select scn_to_timestamp(1155901) from dualSCN_TO_TIMESTAMP(1155901)
---------------------------------------------------------------------------
05-APR-12 01.20.41.000000000 AMSQL> /
Enter value for scn: 1155902
old1: select scn_to_timestamp(&scn) from dual
new1: select scn_to_timestamp(1155902) from dualSCN_TO_TIMESTAMP(1155902)
---------------------------------------------------------------------------
05-APR-12 01.20.44.000000000 AMSQL> select scn_to_timestamp(1155901) from dual;SCN_TO_TIMESTAMP(2608762)
---------------------------------------------------------------------------
05-APR-12 01.20.41.000000000 AM
·scn_to_timestamp以及timestamp_to_scn的相互转化:
SQL> select timestamp_to_scn(to_timestamp("05-4月 -12 01.20.41.000000000 上午"))from dual;
select timestamp_to_scn(to_timestamp("05-4月 -12 01.20.41.000000000 上午")) from
dual
*
ERROR at line 1:
ORA-01843: not a valid month
·SQL> select timestamp_to_scn(to_timestamp("05-APR-12 01.20.41.000000000 AM")) from dual;TIMESTAMP_TO_SCN(TO_TIMESTAMP("05-APR-12 01.20.41.000000000 AM"))
---------------------------------------------------------------
1155901·SQL> select timestamp_to_scn(to_timestamp("05-04-12 01.20.41.000000000 AM")) from dual;TIMESTAMP_TO_SCN(TO_TIMESTAMP("05-04-12 01.20.41.000000000 AM"))
---------------------------------------------------------------
1155901诊断并解决ORA-04031 错误Linux数据库创建与数据导入相关资讯      Oracle数据库基础教程 
  • 在Oracle数据库中插入含有&符号的  (03/06/2013 09:20:14)
  • Oracle 执行计划更改导致数据加工  (02/13/2013 14:45:04)
  • 判断Oracle Sequence是否存在  (02/13/2013 14:32:26)
  • Oracle数据库中无法对数据表进行  (02/26/2013 14:24:58)
  • Oracle 在同一台主机上建立用户管  (02/13/2013 14:40:58)
  • Oracle em 无法启动,报not found错  (02/13/2013 14:29:48)
本文评论 查看全部评论 (0)
表情: 姓名: 字数