检查两天内的需要重视的信息:
vi alter_error.sh
echo "Check Alter Error:"
cat $TRACE/alert_$ORACLE_SID.log | grep -E ^ORA-\|Reconfig\|abort\|Shut\|^Start\|error\|Instance\|Suspend\|Resuming\|Deadlock\|"`date "+%b %d"`"\|"`date -d last-day "+%b %d"`"
配置环境变量
vi /home/oracle/.bash_profile
export ORACLE_BASE=/u01/app
export ORACLE_HOME=$ORACLE_BASE/product/11gR2/db
export ORACLE_SID=shark
export SERVICE_NAMES=erp
export DBUNAME=sharkdb
export TRACE=$ORACLE_BASE/diag/rdbms/$DBUNAME/$ORACLE_SID/trace压缩告警文件
mv_alterlog.sh
mv $TRACE/alert_$ORACLE_SID.log $TRACE/bak_alter_$ORACLE_SID.`date +%F_%H`.log
gzip -1 $TRACE/bak_alter_$ORACLE_SID.`date +%F_%H`.log
ls -lh $TRACE/bak_alter_$ORACLE_SID.`date +%F_%H`.log.gz
原文:http://blog.csdn.net/zengmuansha/article/details/39756441