博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[20160119]V$RMAN_OUTPUT的stamp.txt
阅读量:6848 次
发布时间:2019-06-26

本文共 3949 字,大约阅读时间需要 13 分钟。

[20160119]V$RMAN_OUTPUT的stamp.txt

--今天检查无意中发现2016/1/2日志切换频繁。

--放假回来后检查发现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.

转载地址:http://dhlul.baihongyu.com/

你可能感兴趣的文章
JavaScript 函数节流和函数去抖应用场景辨析
查看>>
log4j的参数配置(转)
查看>>
[C++][基础]1_变量、常量和基本类型
查看>>
Android Service与Runnable整合并用
查看>>
Php综合手册
查看>>
[轉]javascript 的 location 各種用法
查看>>
测地膨胀和膨胀重建—lhMorpRDilate
查看>>
PHP开发Android应用程序(转)
查看>>
Knockout.js随手记(8)
查看>>
mysql 安装过程中的错误:my-template.ini could not be processed and written to XXX\my.ini.Error code-1...
查看>>
计算A/3,不用除法
查看>>
ERStudio的使用
查看>>
git 本地与服务器的同步
查看>>
css鼠标移动到文字上怎样变化背景颜色
查看>>
HBase 实战(1)--HBase的数据导入方式
查看>>
浅谈WEB页面提速(前端向)
查看>>
05 语句处理
查看>>
POJ 3177 Redundant Paths POJ 3352 Road Construction(双连接)
查看>>
ERROR: Java 1.7 or later is required to run Apache Drill.
查看>>
初入android驱动开发之字符设备(一)
查看>>