SQL脚本:监控当前重做日志文件使用情况
生活随笔
收集整理的這篇文章主要介紹了
SQL脚本:监控当前重做日志文件使用情况
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
這個腳本可以用來分析當前重做日志文件(redo logfile)已被用到了什么位置(position)、還剩余多少空間和已使用的百分比: set linesize 200 pagesize 1400;
select le.leseq "Current log sequence No",100 * cp.cpodr_bno / le.lesiz "Percent Full",(cpodr_bno - 1) * 512 "bytes used exclude header",le.lesiz * 512 - cpodr_bno * 512 "Left space",le.lesiz *512 "logfile size"from x$kcccp cp, x$kccle lewhere LE.leseq = CP.cpodr_seqand bitand(le.leflg, 24) = 8;
Sample:
SQL> set linesize 200 pagesize 1400; SQL> select le.leseq "Current log sequence No",2 100 * cp.cpodr_bno / le.lesiz "Percent Full",3 (cpodr_bno - 1) * 512 "bytes used exclude header",4 le.lesiz * 512 - cpodr_bno * 512 "Left space",5 le.lesiz *512 "logfile size"6 from x$kcccp cp, x$kccle le7 where LE.leseq = CP.cpodr_seq8 and bitand(le.leflg, 24) = 8;Current log sequence No Percent Full bytes used exclude header Left space logfile size ----------------------- ------------ ------------------------- ---------- ------------189 90.7612305 95169536 9687552 104857600/* 如上結果顯示當前重做日志號為189,使用量百分比是90.7%當前日志被使用到了95169536+512 bytes(重做日志文件頭)的位置,還剩余9687552 bytes的空間,該重做日志的總大小為104857600=100MB */總結
以上是生活随笔為你收集整理的SQL脚本:监控当前重做日志文件使用情况的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: mysql的字符串函数
- 下一篇: win7 安装apache2.2服务错误