双机使用linux+heartbeat+drbd+oracle11.2实现.
oracle_home为drbd共享磁盘并挂载在/oradata下。一下脚本可以添加进两台节点内执行定期任务自动清理ORACLE产生的日志文件,相应目录请用户根据实际进行修改。
#!/bin/bash
##It's name is bash_del_history_file.sh##crontab:
##0 1 * * * /home/oracle/fhit/bash_del_history_file.shORACLE_HOME=/oradata/product/10.2.0/db_1
DEL_HISTORY_DIR=$ORACLE_HOME/log/ DEL_HISTORY_FILE=$ORACLE_HOME/log/del_history_file.logif [ -d "$DEL_HISTORY_DIR" ]; then
date > ${DEL_HISTORY_FILE}
ORACLE_DBMS=/oradata/admin/orcl ORACLE_LOG=$ORACLE_HOME/network/log find $ORACLE_DBMS/adump -name "*.aud" -mtime +2 -exec rm {} \; find $ORACLE_DBMS/bdump -name "*.trc" -mtime +2 -exec rm {} \; find $ORACLE_DBMS/udump -name "*.trc" -mtime +2 -exec rm {} \; cat /dev/null > $ORACLE_LOG/listener.logfi
unset ORACLE_DBMS
unset ORACLE_LOG unset ORACLE_HOME unset DEL_HISTORY_FILE unset DEL_HISTORY_DIR