[20160119]V$RMAN_OUTPUT的stamp.txt

简介: [20160119]V$RMAN_OUTPUT的stamp.txt --今天检查无意中发现2016/1/2日志切换频繁。http://blog.itpub.net/267265/viewspace-1979024/ --放假回来后检查发现dg磁盘空间满了,当时清除我并有仔细看,因为没有相关记录,我想看看当时如何执行一些操作, --查询V$RMAN_OUTPUT发现里面并没有明显的时间记录,仅仅存在STAMP,SESSION_STAMP,RMAN_STATUS_STAMP字段。

[20160119]V$RMAN_OUTPUT的stamp.txt

--今天检查无意中发现2016/1/2日志切换频繁。http://blog.itpub.net/267265/viewspace-1979024/
--放假回来后检查发现dg磁盘空间满了,当时清除我并有仔细看,因为没有相关记录,我想看看当时如何执行一些操作,
--查询V$RMAN_OUTPUT发现里面并没有明显的时间记录,仅仅存在STAMP,SESSION_STAMP,RMAN_STATUS_STAMP字段。

--我自己想做一些尝试,是否可以把stamp转换为时间:

--//更正:严重错误,应该按照如下公式计算:
time = (((((yyyy - 1988) * 12 + mm - 1) * 31 + dd - 1) * 24 + hh) * 60 + mi) * 60 + ss;
--//参考新链接:
http://blog.itpub.net/267265/viewspace-2135046/

1.环境:
SYS@book> @ &r/ver1
PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

--在测试环境下我重启数据库,我检查发现V$RMAN_OUTPUT没有输出,并且如果我登录rman后有输出,另外我发现stamp是增加的比原来。
--也就是讲这个东西应该是某个日期以来记录的一个单位。到底是什么呢?

2.测试:
--建立如下脚本执行它:

$ 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

SYS@book> column OUTPUT format a52
SYS@book> select * from V$RMAN_OUTPUT where session_key=204;
SID RECID      STAMP SESSION_RECID SESSION_STAMP OUTPUT                                               RMAN_STATUS_RECID RMAN_STATUS_STAMP SESSION_KEY
--- ----- ---------- ------------- ------------- ---------------------------------------------------- ----------------- ----------------- -----------
101   190  901555071           204     901555071 connected to target database: BOOK (DBID=1337401710)               204         901555071         204
101   191  901555071           204     901555071                                                                    204         901555071         204
101   192  901555071           204     901555071                                                                    204         901555071         204
101   193  901555071           204     901555071 host command complete                                              204         901555071         204
101   194  901555071           204     901555071                                                                    204         901555071         204
101   195  901555071           204     901555071                                                                    204         901555071         204
101   196  901555081           204     901555071 host command complete                                              204         901555071         204
101   197  901555081           204     901555071                                                                    204         901555071         204
101   198  901555081           204     901555071                                                                    204         901555071         204
101   199  901555081           204     901555071 host command complete                                              204         901555071         204
101   200  901555082           204     901555071                                                                    204         901555071         204
101   201  901555082           204     901555071                                                                    204         901555071         204
101   202  901555082           204     901555071                                                                    204         901555071         204
101   203  901555082           204     901555071                                                                    204         901555071         204

14 rows selected.

$ cat aa.log
2016/01/19 15:57:51
2016/01/19 15:58:01

--从上面stamp的数值901555081-901555071=10,正好10秒。说明stamp的单位应该是秒。

SYS@book> select to_date('2016/01/19 15:57:51','yyyy/mm/dd hh24:mi:ss')-901555071/86400 C20 from dual;
C20
--------------------
1987-06-26 00:00:00

--从这里看出这个日期非常规整。不知道这个日期对于oracle意味着什么?

3.有了这个起点,确定时间就方便了。

SYS@book> select date '1987-06-26' +stamp/86400 c20 ,a.* from V$RMAN_OUTPUT a where a.session_key=204;
C20                  SID RECID      STAMP SESSION_RECID SESSION_STAMP OUTPUT                                               RMAN_STATUS_RECID RMAN_STATUS_STAMP SESSION_KEY
-------------------- --- ----- ---------- ------------- ------------- ---------------------------------------------------- ----------------- ----------------- -----------
2016-01-19 15:57:51  101   190  901555071           204     901555071 connected to target database: BOOK (DBID=1337401710)               204         901555071         204
2016-01-19 15:57:51  101   191  901555071           204     901555071                                                                    204         901555071         204
2016-01-19 15:57:51  101   192  901555071           204     901555071                                                                    204         901555071         204
2016-01-19 15:57:51  101   193  901555071           204     901555071 host command complete                                              204         901555071         204
2016-01-19 15:57:51  101   194  901555071           204     901555071                                                                    204         901555071         204
2016-01-19 15:57:51  101   195  901555071           204     901555071                                                                    204         901555071         204
2016-01-19 15:58:01  101   196  901555081           204     901555071 host command complete                                              204         901555071         204
2016-01-19 15:58:01  101   197  901555081           204     901555071                                                                    204         901555071         204
2016-01-19 15:58:01  101   198  901555081           204     901555071                                                                    204         901555071         204
2016-01-19 15:58:01  101   199  901555081           204     901555071 host command complete                                              204         901555071         204
2016-01-19 15:58:02  101   200  901555082           204     901555071                                                                    204         901555071         204
2016-01-19 15:58:02  101   201  901555082           204     901555071                                                                    204         901555071         204
2016-01-19 15:58:02  101   202  901555082           204     901555071                                                                    204         901555071         204
2016-01-19 15:58:02  101   203  901555082           204     901555071                                                                    204         901555071         204
14 rows selected.

目录
相关文章
|
5月前
|
数据库 OceanBase
min restore scn of backup set file is greater than restore scn. can't use to restor
min restore scn of backup set file is greater than restore scn. can't use to restor
25 1
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?
101 0
|
Oracle 关系型数据库 测试技术
[20171204]guaranteed restore point.txt
[20171204]guaranteed restore point.txt --//昨天帮别人升级再次遇到关于相关问题,实际上主要问题在于升级文档没有完成后取消restore point的设置.
1252 0
|
缓存 Oracle 关系型数据库
[20171128]rman Input or output Memory Buffers.txt
[20171128]rman Input or output Memory Buffers.txt --//Input Memory Buffers如何测试,不清楚.不过找到一本电子书.
1058 0
|
缓存 Oracle 关系型数据库
[20171122]rman filesystemio_options.txt
[20171122]rman备份与参数filesystemio_options设置.txt --//这几天写了几篇filesystemio_options参数设置的文章,单独测试这个参数对rman备份以及os缓存的影响.
959 0
|
Oracle 关系型数据库 Shell
[20171121]rman backup as copy 2.txt
[20171121]rman backup as copy 2.txt --//昨天测试backup as copy ,备份时备份文件的文件头什么时候更新.是最后完成后还是顺序写入备份文件.
993 0
|
Oracle 关系型数据库 Linux
[20171121]rman backup as copy.txt
[20171121]rman backup as copy.txt --//上个星期做数据文件块头恢复时,提到使用rman备份数据文件时,文件头数据库信息是最后写入备份集文件的,在filesperset=1的情况 --//下写入备份集文件中的倒数第2块就是文件头的备份.
1202 0
|
Oracle 关系型数据库 Linux
[20171101]rman to destination.txt
[20171101]rman to destination.txt --//国庆放假,看了一些rman方面的书,看到一个不常用的参数to destination,测试看看.
918 0
|
Oracle 关系型数据库 数据库
[20170616]recover copy of datafile 6.txt
[20170616]no copy of datafile 6 found to recover.txt --//最近几天一直被这个问题纠缠,我虽然不知道问题在哪来,还是找到简单的解决方法,做1个记录: --//链接:http://www.
1128 0

热门文章

最新文章