Oracle TUNE V$UNDOSTAT
在一个18摸AIX上跑的一台11g的库,检查的时候发现视图V$UNDOSTAT的数据很诡异,第1条的记录时间段竟然一直没有被切割过,开始时间是2011-12-26 09:52:08结束时间是2013-05-14 15:20:34,当然归档表也没记录。
正常情况下该视图应该被没10分钟的数据给填充满,一直持续4天,也就是 6*24*4=576 条记录,之后会重用这个表;相关的历史记录会归档到DBA_HIST_UNDOSTAT中去。
记录按照时间从近到远的倒序插入,其中第1条记录是最后一次收集的结束点到当前的时间间隔,你可以看到END_TIME是不断在刷新的。
来看下正常情况的是怎么样的。
[sql]
[oracle@LINUXDB ~]$ export NLS_DATE_FORMAT='yyyy-mm-dd hh24:mi:ss'
[oracle@LINUXDB ~]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.3.0 Production on Tue May 14 15:19:58 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select begin_time,end_time from v$undostat;
BEGIN_TIME END_TIME
------------------- -------------------
2013-05-14 15:16:04 2013-05-14 15:20:00
2013-05-14 15:06:04 2013-05-14 15:16:04
2013-05-14 14:56:04 2013-05-14 15:06:04
2013-05-14 14:46:04 2013-05-14 14:56:04
2013-05-14 14:36:04 2013-05-14 14:46:04
2013-05-14 14:26:04 2013-05-14 14:36:04
2013-05-14 14:16:04 2013-05-14 14:26:04
2013-05-14 14:06:04 2013-05-14 14:16:04
2013-05-14 13:56:04 2013-05-14 14:06:04
2013-05-14 13:46:04 2013-05-14 13:56:04
2013-05-14 13:36:04 2013-05-14 13:46:04
BEGIN_TIME END_TIME
------------------- -------------------
2013-05-14 13:26:04 2013-05-14 13:36:04
2013-05-14 13:16:04 2013-05-14 13:26:04
2013-05-14 13:06:04 2013-05-14 13:16:04
2013-05-14 12:56:04 2013-05-14 13:06:04
2013-05-14 12:46:04 2013-05-14 12:56:04
2013-05-14 12:36:04 2013-05-14 12:46:04
2013-05-14 12:26:04 2013-05-14 12:36:04
2013-05-14 12:16:04 2013-05-14 12:26:04
2013-05-14 12:06:04 2013-05-14 12:16:04
2013-05-14 11:56:04 2013-05-14 12:06:04
2013-05-14 11:46:04 2013-05-14 11:56:04
22 rows selected.
SQL> select begin_time,end_time from dba_hist_undostat;
BEGIN_TIME END_TIME
------------------- -------------------
2013-05-14 11:46:04 2013-05-14 11:56:04
2013-05-14 12:56:04 2013-05-14 13:06:04
2013-05-14 13:06:04 2013-05-14 13:16:04
2013-05-14 13:16:04 2013-05-14 13:26:04
2013-05-14 13:26:04 2013-05-14 13:36:04
2013-05-14 13:36:04 2013-05-14 13:46:04
2013-05-14 13:46:04 2013-05-14 13:56:04
2013-05-14 11:56:04 2013-05-14 12:06:04
2013-05-14 12:06:04 2013-05-14 12:16:04
2013-05-14 12:16:04 2013-05-14 12:26:04
2013-05-14 12:26:04 2013-05-14 12:36:04
BEGIN_TIME END_TIME
------------------- -------------------
2013-05-14 12:36:04 2013-05-14 12:46:04
2013-05-14 12:46:04 2013-05-14 12:56:04
2013-05-14 13:56:04 2013-05-14 14:06:04
2013-05-14 14:06:04 2013-05-14 14:16:04
2013-05-14 14:16:04 2013-05-14 14:26:04
2013-05-14 14:26:04 2013-05-14 14:36:04
2013-05-14 14:36:04 2013-05-14 14:46:04
2013-05-14 14:46:04 2013-05-14 14:56:04
19 rows selected.
现在来看看没有切割的情况:
AIX Version 6
Copyright IBM Corporation, 1982, 2011.
login: oracle
oracle's Password:
*******************************************************************************
* *
* *
* Welcome to AIX Version 6.1! *
* *
* *
* Please see the README file in /usr/lpp/bos for information pertinent to *
* this release of the AIX Operating System. *
* *
* *
*******************************************************************************
Last unsuccessful login: Fri May 3 21:52:33 GMT+08:00 2013 on /dev/pts/6 from 10.46.154.32
Last login: Tue May 14 15:11:11 GMT+08:00 2013 on /dev/pts/6 from 10.46.160.207
AIXDB:/oracle$ export NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'
AIXDB:/oracle$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.2.0 Production on Tue May 14 15:20:12 2013
Copyright (c) 1982, 2010, Oracle. All rights reserved.