oracle的熱備指令碼

BTxigua發表於2007-08-18

#!/bin/sh

#
# 該指令碼在linux執行成功,指令碼還需要改進,在指令碼中沒有異常處理機制。
# 在這裡需要重新設定指令碼的備份目錄和oracle的環境變數
#

#
#set backup destination
#
BACKUP_DIR=/backup/hot_wholebackup; export BACKUP_DIR
BACKUP_BACK_DIR=$BACKUP_DIR/bak; export BACKUP_BACK_DIR
ARCHIVE_BACK_DIR=$BACKUP_DIR/archivebak; export ARCHIVE_BACK_DIR
LOG=$BACKUP_DIR/log`date +%Y%m%d%H%M%S`.txt

#
#set oracle environment variable. if the user is oracle,you can skip this step.
#
ORACLE_BASE=/home/oracle;export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/9.2.0;export ORACLE_HOME
ORACLE_SID=test; export RACLE_SID

ORACLE_NLS=$ORACLE_HOME/ocommon/nls/admin/data; export ORACLE_NLS
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK; export NLS_LANG
PATH=$ORACLE_HOME/bin:$PATH;export PATH
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib; export LD_LIBRARY_PATH

[@more@]# #Check the oracle archive mode # sqlplus /nolog >$LOG conn /as sysdba spool $BACKUP_DIR/arch.txt archive log list; spool off quit !EO #if Noarchived mode then return ARCHIVED=`grep -i "No Archive Mode" $BACKUP_DIR/arch.txt|wc -l`

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10867315/viewspace-963992/,如需轉載,請註明出處,否則將追究法律責任。

相關文章