Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 冲浪宝典 > 网络资源 > show log file info and log switches
【标  题】:show log file info and log switches
【关键字】:show,log,file,info,and,log,switches
【来  源】:http://blog.csdn.net/jiawancai/archive/2007/02/27/1516330.aspx

show log file info and log switches

Your Ad Here
column	day	format a16		heading 'Day'column	d_0	format a3		heading '00'column	d_1	format a3		heading '01'column	d_2	format a3		heading '02'column	d_3	format a3		heading '03'column	d_4	format a3		heading '04'column	d_5	format a3		heading '05'column	d_6	format a3		heading '06'column	d_7	format a3		heading '07'column	d_8	format a3		heading '08'column	d_9	format a3		heading '09'column	d_10	format a3		heading '10'column	d_11	format a3		heading '11'column	d_12	format a3		heading '12'column	d_13	format a3		heading '13'column	d_14	format a3		heading '14'column	d_15	format a3		heading '15'column	d_16	format a3		heading '16'column	d_17	format a3		heading '17'column	d_18	format a3		heading '18'column	d_19	format a3		heading '19'column	d_20	format a3		heading '20'column	d_21	format a3		heading '21'column	d_22	format a3		heading '22'column	d_23	format a3		heading '23'column  Total   format 9999column status  format a8column member  format a40column archived heading "Archived" format a8column bytes heading "Bytes|(MB)" format 9999Ttitle  "Log Info"  skip 2select l.group#,f.member,l.archived,l.bytes/1078576 bytes,l.status,f.type  from v$log l, v$logfile f where l.group# = f.group#/Ttitle offprompt =========================================================================================================================Ttitle  "Log Switch on hour basis"  skip 2select to_char(FIRST_TIME,'DY, DD-MON-YYYY') day,       decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'00',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'00',1,0))) d_0,       decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'01',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'01',1,0))) d_1,       decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'02',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'02',1,0))) d_2,       decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'03',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'03',1,0))) d_3,       decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'04',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'04',1,0))) d_4,       decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'05',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'05',1,0))) d_5,       decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'06',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'06',1,0))) d_6,       decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'07',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'07',1,0))) d_7,       decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'08',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'08',1,0))) d_5,       decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'09',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'09',1,0))) d_9,       decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'10',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'10',1,0))) d_10,       decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'11',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'11',1,0))) d_11,       decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'12',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'12',1,0))) d_12,       decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'13',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'13',1,0))) d_13,       decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'14',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'14',1,0))) d_14,       decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'15',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'15',1,0))) d_15,       decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'16',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'16',1,0))) d_16,       decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'17',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'17',1,0))) d_17,       decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'18',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'18',1,0))) d_18,       decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'19',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'19',1,0))) d_19,       decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'20',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'20',1,0))) d_20,       decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'21',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'21',1,0))) d_21,       decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'22',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'22',1,0))) d_22,       decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'23',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'23',1,0))) d_23,       count(trunc(FIRST_TIME)) "Total"  from v$log_history group by to_char(FIRST_TIME,'DY, DD-MON-YYYY') order by to_date(substr(to_char(FIRST_TIME,'DY, DD-MON-YYYY'),5,15) )/Ttitle offprompt =========================================================================================================================           
/NCLDBA/CY01 > @log_switch

Log Info

                                                             Bytes
    GROUP# MEMBER                                   Archived  (MB) STATUS   TYPE
---------- ---------------------------------------- -------- ----- -------- -------
         1 /cy/cy_u000/CY01/CY01_LOG001_01.rdo      YES          5 INACTIVE ONLINE
         1 /cy/cy_u001/CY01/CY01_LOG001_02.rdo      YES          5 INACTIVE ONLINE
         2 /cy/cy_u003/CY01/CY01_LOG002_01.rdo      NO           5 CURRENT  ONLINE
         2 /cy/cy_u001/CY01/CY01_LOG002_02.rdo      NO           5 CURRENT  ONLINE
         3 /cy/cy_u000/CY01/CY01_LOG003_01.rdo      YES          5 INACTIVE ONLINE
         3 /cy/cy_u003/CY01/CY01_LOG003_02.rdo      YES          5 INACTIVE ONLINE

6 rows selected.

=========================================================================================================================

Log Switch on hour basis

Day              00  01  02  03  04  05  06  07  05  09  10  11  12  13  14  15  16  17  18  19  20  21  22  23  Total
---------------- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -----
MON, 29-JAN-2007 -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   1   -   11  4      16
TUE, 30-JAN-2007 -   1   -   -   1   -   2   -   1   1   -   -   1   -   -   1   -   -   1   -   1   -   9   4      23
WED, 31-JAN-2007 -   1   -   1   -   -   1   -   -   1   -   3   -   -   1   -   1   -   -   1   -   -   9   4      23
THU, 01-FEB-2007 2   -   -   1   -   -   1   -   1   -   -   1   -   -   1   -   1   -   -   1   -   -   9   4      22
FRI, 02-FEB-2007 2   -   -   1   -   -   1   -   1   -   -   1   -   -   1   -   1   -   -   1   -   -   10  4      23
SAT, 03-FEB-2007 2   -   -   1   -   1   8   -   1   -   1   -   -   1   -   -   1   -   1   -   1   -   -   4      22
SUN, 04-FEB-2007 1   2   -   -   1   -   -   1   -   -   1   -   1   -   -   1   -   -   1   -   -   1   -   4      14
MON, 05-FEB-2007 2   -   -   1   -   1   -   1   -   -   1   -   -   1   1   -   -   1   -   -   1   -   11  4      25
TUE, 06-FEB-2007 2   -   -   1   -   1   -   1   -   1   -   -   1   -   -   1   -   1   -   -   1   -   9   4      23
WED, 07-FEB-2007 3   -   -   1   -   -   1   -   1   -   -   1   -   -   1   -   1   -   1   -   -   1   9   5      25
THU, 08-FEB-2007 -   -   1   -   -   1   -   1   -   -   1   -   1   -   -   1   -   1   -   -   1   -   9   4      21
FRI, 09-FEB-2007 2   -   -   1   -   -   1   -   1   -   -   1   -   1   -   -   1   -   -   1   -   1   9   10     29
SAT, 10-FEB-2007 -   -   1   -   -   1   9   -   1   -   -   1   -   1   -   -   1   -   1   -   -   1   -   8      25
SUN, 11-FEB-2007 -   -   1   -   -   1   -   -   1   -   1   -   -   1   -   -   -   1   -   1   -   -   1   5      13
MON, 12-FEB-2007 -   3   -   -   1   -   1   -   1   -   -   1   -   -   1   -   1   -   -   1   -   -   12  6      28
TUE, 13-FEB-2007 1   2   -   1   -   -   1   -   1   -   -   1   -   -   1   -   1   -   -   1   -   1   8   6      25
WED, 14-FEB-2007 1   -   -   1   -   -   1   2   -   -   1   -   1   -   -   1   -   -   1   -   1   -   10  4      24
THU, 15-FEB-2007 -   1   -   -   1   -   -   3   -   -   1   -   -   1   -   1   -   -   1   -   1   -   9   8      27
FRI, 16-FEB-2007 2   -   -   1   -   -   1   -   1   -   -   1   -   1   -   -   1   -   1   -   -   1   10  7      27
SAT, 17-FEB-2007 2   -   -   1   -   1   9   -   -   1   -   1   -   -   1   -   1   -   -   1   -   -   1   9      28
SUN, 18-FEB-2007 -   -   1   -   -   1   -   -   1   -   1   -   -   1   -   -   1   -   -   1   -   -   1   8      16
MON, 19-FEB-2007 2   -   -   1   -   -   1   -   1   -   -   1   -   -   1   -   1   -   -   1   -   -   12  8      29
TUE, 20-FEB-2007 2   -   -   1   -   1   -   -   1   -   -   1   -   -   1   -   1   -   -   1   -   -   10  8      27
WED, 21-FEB-2007 2   -   -   1   -   -   1   -   1   1   -   -   1   -   1   -   -   1   -   -   1   -   10  4      24
THU, 22-FEB-2007 2   -   -   1   -   -   1   -   1   1   -   -   -   -   -   -   -   -   -   -   -   -   -   -       6

25 rows selected.

=========================================================================================================================
/NCLDBA/CY01 >    
put your own progress information in V$SESSION_LONGOPS:【上一篇】
数据库中Split功能的实现--自定义函数(源码):【下一篇】
【相关文章】
  • put your own progress information in V$SESSION_LONGOPS
  • 发现了个不错的Blog,GemBlog
  • 2.5动态对话框(Dynamic Dialogs)
  • 2.6 Qt提供的控件和对话框类(Built-in Widget and Dialog Classes)
  • Directshow开发的一些基本概念和技巧
  • Understanding Complex Declarations in C/C++
  • 总结 tar: file name too long
  • dba对redolog的文件及其使用率的检查调整
  • Underdstanding Complex Declarations in C/C++
  • 2.4能够改变的对话框(Shape-Changing Dialogs)
  • 【随机文章】
  • void main(void) - the Wrong Thing
  • 如何用shell脚本实现自动telnet
  • 常用46个搜索引擎
  • FlashGet使用教程
  • 快速恢复Ghost定制“无忧系统”
  • 高级shell编程技巧4(转载)
  • 使用“安全模式”
  • DreamWeaver,经典50问(一)
  • 创建引导盘
  • CLR Profiler介绍
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 bbb软讯网络 All Rigths Reserved.