« What Kind Of DBA we need-我们需要什么样的DBA? | Blog首页 | Install MT WYSIWYG plugin FCKeditor »
Oracle HowTo:如何使用split命令分割alert文件
作者:eygle |【转载时请以超链接形式标明文章出处和作者信息及本声明】
链接:http://www.eygle.com/archives/2005/12/oracle_howto_split_alert_file.html
很多时候,由于种种原因,数据库的警告日志(alert_<sid>.log)文件会变得很大,不方便查看。链接:http://www.eygle.com/archives/2005/12/oracle_howto_split_alert_file.html
在Unix/Linux上我们可以通过split命令,把alert文件分割为较小的文件,便于查看。
$ which split /bin/split $ split -b 10m -a 3 alert_mmsdb.log alert $ ls -l al* -rw-r--r-- 1 oracle dba 187266549 Dec 2 10:43 alert_mmsdb.log -rw-r--r-- 1 oracle dba 10485760 Dec 2 10:45 alertaaa -rw-r--r-- 1 oracle dba 10485760 Dec 2 10:45 alertaab -rw-r--r-- 1 oracle dba 10485760 Dec 2 10:45 alertaac -rw-r--r-- 1 oracle dba 10485760 Dec 2 10:45 alertaad -rw-r--r-- 1 oracle dba 10485760 Dec 2 10:45 alertaae -rw-r--r-- 1 oracle dba 10485760 Dec 2 10:45 alertaaf -rw-r--r-- 1 oracle dba 10485760 Dec 2 10:45 alertaag -rw-r--r-- 1 oracle dba 10485760 Dec 2 10:45 alertaah -rw-r--r-- 1 oracle dba 10485760 Dec 2 10:45 alertaai -rw-r--r-- 1 oracle dba 10485760 Dec 2 10:45 alertaaj -rw-r--r-- 1 oracle dba 10485760 Dec 2 10:45 alertaak -rw-r--r-- 1 oracle dba 10485760 Dec 2 10:45 alertaal -rw-r--r-- 1 oracle dba 10485760 Dec 2 10:45 alertaam -rw-r--r-- 1 oracle dba 10485760 Dec 2 10:45 alertaan -rw-r--r-- 1 oracle dba 10485760 Dec 2 10:45 alertaao -rw-r--r-- 1 oracle dba 10485760 Dec 2 10:45 alertaap -rw-r--r-- 1 oracle dba 10485760 Dec 2 10:45 alertaaq -rw-r--r-- 1 oracle dba 9008629 Dec 2 10:45 alertaar |
以上用到的参数,-b指定分割的每个piece的大小,-a指定后缀的位数,最后的alert为指定的文件名前缀。
本例是Solaris上的操作示范,Linux上稍有不同。
历史上的今天...
>> 2007-12-02文章:
>> 2006-12-02文章:
------
这篇 【Oracle HowTo:如何使用split命令分割alert文件】来自 eygle.com | CSDN网摘| del.icio.us|Google订阅 | 鲜果订阅 | 抓虾订阅
By eygle on 2005-12-02 11:02 | Comments (1) | Posted to HowTo | Edit |Pageviews:
| 相关文章 | 随机文章 |
|
年终难终 我们有多少时间能浪费 《深入浅出Oracle》技术交流会PPT下载 美丽的樱花 IBM ThinkPad-如何激活和关闭数字小键盘 龙门石窟-卢舍那大佛 |
搜索本站:
留言 (1)
I will run the scripts below once about half month
LG=alert_mmsdb.log && cat $LG | gzip -9c > bak/$LG.bak.`date +%Y%m%d`.gz && cat /dev/null > $LG
简单的LG=alert_mmsdb.log 换成其他LOG file名字,如listener.log就可以用来backup listener log^
Posted by: rollingpig at February 2, 2006 2:28 PM
