[Oracle Script] Log switch status
select inst_id,to_char(first_time,'yyyy/mm/dd') "Date",
sum(decode(to_char(first_time,'HH24'),'00',1,0)) H00,sum(decode(to_char(first_time,'HH24'),'01',1,0)) H01,sum(decode(to_char(first_time,'HH24'),'02',1,0)) H02,
sum(decode(to_char(first_time,'HH24'),'03',1,0)) H03,sum(decode(to_char(first_time,'HH24'),'04',1,0)) H04,sum(decode(to_char(first_time,'HH24'),'05',1,0)) H05,
sum(decode(to_char(first_time,'HH24'),'06',1,0)) H06,sum(decode(to_char(first_time,'HH24'),'07',1,0)) H07,sum(decode(to_char(first_time,'HH24'),'08',1,0)) H08,
sum(decode(to_char(first_time,'HH24'),'09',1,0)) H09,sum(decode(to_char(first_time,'HH24'),'10',1,0)) H10,sum(decode(to_char(first_time,'HH24'),'11',1,0)) H11,
sum(decode(to_char(first_time,'HH24'),'12',1,0)) H12,sum(decode(to_char(first_time,'HH24'),'13',1,0)) H13,sum(decode(to_char(first_time,'HH24'),'14',1,0)) H14,
sum(decode(to_char(first_time,'HH24'),'15',1,0)) H15,sum(decode(to_char(first_time,'HH24'),'16',1,0)) H16,sum(decode(to_char(first_time,'HH24'),'17',1,0)) H17,
sum(decode(to_char(first_time,'HH24'),'18',1,0)) H18,sum(decode(to_char(first_time,'HH24'),'19',1,0)) H19,sum(decode(to_char(first_time,'HH24'),'20',1,0)) H20,
sum(decode(to_char(first_time,'HH24'),'21',1,0)) H21,sum(decode(to_char(first_time,'HH24'),'22',1,0)) H22,sum(decode(to_char(first_time,'HH24'),'23',1,0)) H23,
count(1) "Total", round(count(1)/24,2) "Avg Per Hour"
from gv$log_history group by inst_id,to_char(first_time,'yyyy/mm/dd')
order by 1 asc,2 desc
sum(decode(to_char(first_time,'HH24'),'00',1,0)) H00,sum(decode(to_char(first_time,'HH24'),'01',1,0)) H01,sum(decode(to_char(first_time,'HH24'),'02',1,0)) H02,
sum(decode(to_char(first_time,'HH24'),'03',1,0)) H03,sum(decode(to_char(first_time,'HH24'),'04',1,0)) H04,sum(decode(to_char(first_time,'HH24'),'05',1,0)) H05,
sum(decode(to_char(first_time,'HH24'),'06',1,0)) H06,sum(decode(to_char(first_time,'HH24'),'07',1,0)) H07,sum(decode(to_char(first_time,'HH24'),'08',1,0)) H08,
sum(decode(to_char(first_time,'HH24'),'09',1,0)) H09,sum(decode(to_char(first_time,'HH24'),'10',1,0)) H10,sum(decode(to_char(first_time,'HH24'),'11',1,0)) H11,
sum(decode(to_char(first_time,'HH24'),'12',1,0)) H12,sum(decode(to_char(first_time,'HH24'),'13',1,0)) H13,sum(decode(to_char(first_time,'HH24'),'14',1,0)) H14,
sum(decode(to_char(first_time,'HH24'),'15',1,0)) H15,sum(decode(to_char(first_time,'HH24'),'16',1,0)) H16,sum(decode(to_char(first_time,'HH24'),'17',1,0)) H17,
sum(decode(to_char(first_time,'HH24'),'18',1,0)) H18,sum(decode(to_char(first_time,'HH24'),'19',1,0)) H19,sum(decode(to_char(first_time,'HH24'),'20',1,0)) H20,
sum(decode(to_char(first_time,'HH24'),'21',1,0)) H21,sum(decode(to_char(first_time,'HH24'),'22',1,0)) H22,sum(decode(to_char(first_time,'HH24'),'23',1,0)) H23,
count(1) "Total", round(count(1)/24,2) "Avg Per Hour"
from gv$log_history group by inst_id,to_char(first_time,'yyyy/mm/dd')
order by 1 asc,2 desc
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24237320/viewspace-2145702/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [Oracle Script] Undo Usage Per statusOracle
- Script – List status of all submitted DBMS jobs(轉)MIT
- log file switch
- Query the duration of log switch
- oracle scriptOracle
- redo_log_switch_date
- LOG FILE SWITCH等待事件事件
- [Oracle Script] LockOracle
- Oracle Database ScriptOracleDatabase
- STATUS OF ORACLE INSTANCEOracle
- Archive Log模式下Redo Log、Check Point和Switch LogHive模式
- alter system archive log current / all / switch logfileHive
- 如何修復 Ubuntu 上“…script returned error exit status 1”的錯誤UbuntuError
- [Oracle Script] Top sqlOracleSQL
- [Oracle Script] check userOracle
- [Oracle Script] check latchOracle
- Oracle kill session scriptOracleSession
- ORACLE常用Script(轉)Oracle
- ORACLE常用Script (轉)Oracle
- Oracle ASM Partnership and Status TableOracleASM
- 理解 oracle 的 “lsnrctl status”Oracle
- switch logfile command 等待事件事件
- log file switch相關等待事件事件
- alter database archivelog manual__導致oracle10g switch logfile不自動歸檔DatabaseHiveOracle
- alter system archive log current和alter system switch logfileHive
- 理解 oracle 的 “lsnrctl status”(ZT)Oracle
- [Oracle Script] check active sessionOracleSession
- [Oracle Script] check lock infoOracle
- [Oracle Script] latch holderOracle
- [Oracle Script] Temporary Sort UsageOracle
- [Oracle Script] Rollback Segment UsageOracle
- [Oracle Script] check Literal SQLOracleSQL
- oracle switch logfile日誌切換及alter system checkpoint作了什麼Oracle
- 關於log file switch and checkpoint機制
- log file switch (checkpoint incomplete)等待事件事件
- Log Switch Triggers 及Force SCN
- Switch log 掛起的小問題
- 【等待事件】log file switch (checkpoint incomplete)事件