Oracle Linux 备份脚本

        在RHEL5.4上测试成功,Oracle为10g,脚本为:

ora_env文件(设置Oracle环境变量)
# User specific environment for ORACLE backup and restore.
export ORACLE_BASE=/usr/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_SID=test
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export LANG=zh_CN.GBK
export NLS_LANG="SIMPLIFIED CHINESE_CHINA".ZHS16GBK

backup_oracle.sh文件(备份脚本)

#!/bin/sh
# Script for backup oracle database
# File Name backup_oracle.sh
. $HOME/ora_env                   
rq=`date +%Y-%m-%d`
exp hmilyfe/hmilyfe FILE=/backup/oracle/data/dmb_oracle_$rq.dmp LOG=/backup/oracle/log/dmb_oracle_$rq.log

最后把backup_oracle.sh脚本放到crontab中调用。

你可能感兴趣的:(oracle,linux,脚本,职场,休闲)