[20170310]V$RMAN_OUTPUT的stamp 2.txt

简介: [20170310]V$RMAN_OUTPUT的stamp 2.txt http://blog.itpub.net/267265/viewspace-1979123/ --//以前写的,今天才发现自己再次犯严重的错误.

[20170310]V$RMAN_OUTPUT的stamp 2.txt

http://blog.itpub.net/267265/viewspace-1979123/

--//以前写的,今天才发现自己再次犯严重的错误.重新写一篇,实际上oracle的时间戳都是按照如下公式计算的:
time = (((((yyyy - 1988) * 12 + mm - 1) * 31 + dd - 1) * 24 + hh) * 60 + mi) * 60 + ss;

--//oracle强行按每月31天来计算时间戳,实际上发现这个是因为2月才28天,我昨天发现到3月存在明显的跳跃.
--//重新验证看看:

1.环境:
SYS@book> @ &r/ver
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

--建立如下脚本执行它:
$ cat aa.rman
# !/bin/bash
rman target /  append <<EOF
host "date +'%Y/%m/%d %T'>> aa.log";
host "sleep 10";
host "date +'%Y/%m/%d %T'>> aa.log";
EOF

$ cat aa.log
2017/03/10 09:30:55
2017/03/10 09:31:05

SYS@book> select * from V$RMAN_OUTPUT where session_key=453;
SID RECID      STAMP SESSION_RECID SESSION_STAMP OUTPUT                RMAN_STATUS_RECID RMAN_STATUS_STAMP SESSION_KEY
--- ----- ---------- ------------- ------------- --------------------- ----------------- ----------------- -----------
232    53  938251855           453     938251855                                     453         938251855         453
232    54  938251855           453     938251855                                     453         938251855         453
232    55  938251855           453     938251855 host command complete               453         938251855         453
232    56  938251855           453     938251855                                     453         938251855         453
232    57  938251855           453     938251855                                     453         938251855         453
232    58  938251865           453     938251855 host command complete               453         938251855         453
232    59  938251865           453     938251855                                     453         938251855         453
232    60  938251865           453     938251855                                     453         938251855         453
232    61  938251865           453     938251855 host command complete               453         938251855         453
232    62  938251865           453     938251855                                     453         938251855         453
232    63  938251865           453     938251855                                     453         938251855         453
232    64  938251865           453     938251855                                     453         938251855         453
232    65  938251865           453     938251855                                     453         938251855         453
14 rows selected.

--//stamp=938251855,938251865,相差10,说明单位是秒.

$ cat stamp.sql
SELECT &&1 stamp,to_date(yyyy||'/'||mm||'/'||dd||' '||hh||':'||mi||':'||ss,'yyyy-mm-dd hh24:mi:ss') stamp_conv_time  from (
SELECT &&1
        ,FLOOR (&&1 / (86400*31*12))+1988 yyyy
        ,FLOOR (MOD (&&1 / (86400*31),12))+1 mm
        ,FLOOR (MOD (&&1 / 86400, 31))+1 dd
        ,FLOOR (MOD (&&1 / 3600, 24)) hh
        ,FLOOR (MOD (&&1 / 60, 60)) mi
        ,MOD (&&1, 60) ss
        from dual);

SYS@book> @ &r/stamp 938251855
     STAMP STAMP_CONV_TIME
---------- -------------------
938251855 2017-03-10 09:30:55

SYS@book> @ &r/stamp 938251865
     STAMP STAMP_CONV_TIME
---------- -------------------
938251865 2017-03-10 09:31:05

--//与aa.log文件内显示的时间一致.看来oracle内部time时间戳应该都是按照这个来计算的.特此更正.

目录
相关文章
perhaps your file is in a different file format and youneed to use a different restore operator?
perhaps your file is in a different file format and youneed to use a different restore operator?
155 0
|
缓存 Oracle 关系型数据库
[20171128]rman input memory buffer 3.txt
[20171128]rman input memory buffer 3.txt --//Input Memory Buffers如何测试,不清楚.不过找到一本电子书.
1112 0
|
缓存 Oracle 关系型数据库
[20171129]rman input memory buffer 5.txt
[20171129]rman input memory buffer 5.txt --//Input Memory Buffers如何测试,不清楚.不过找到一本电子书.
926 0
|
缓存 Oracle 关系型数据库
[20171129]rman input memory buffer 4.txt
[20171129]rman input memory buffer 4.txt --//Input Memory Buffers如何测试,不清楚.不过找到一本电子书.
920 0
|
缓存 Oracle 关系型数据库
[20171128]rman Input or output Memory Buffers.txt
[20171128]rman Input or output Memory Buffers.txt --//Input Memory Buffers如何测试,不清楚.不过找到一本电子书.
1076 0
|
Oracle 关系型数据库 Shell
[20171121]rman backup as copy 2.txt
[20171121]rman backup as copy 2.txt --//昨天测试backup as copy ,备份时备份文件的文件头什么时候更新.是最后完成后还是顺序写入备份文件.
1011 0
|
Oracle 关系型数据库 Linux
[20171121]rman backup as copy.txt
[20171121]rman backup as copy.txt --//上个星期做数据文件块头恢复时,提到使用rman备份数据文件时,文件头数据库信息是最后写入备份集文件的,在filesperset=1的情况 --//下写入备份集文件中的倒数第2块就是文件头的备份.
1225 0
|
Oracle 关系型数据库 Linux
[20171101]rman to destination.txt
[20171101]rman to destination.txt --//国庆放假,看了一些rman方面的书,看到一个不常用的参数to destination,测试看看.
939 0
|
Oracle 关系型数据库 数据库
[20170616]recover copy of datafile 6.txt
[20170616]no copy of datafile 6 found to recover.txt --//最近几天一直被这个问题纠缠,我虽然不知道问题在哪来,还是找到简单的解决方法,做1个记录: --//链接:http://www.
1150 0