ORACLE dump ksh
$ more exp_full_db.ksh
#!/usr/bin/ksh
HostName='hostname'
LogName='whoami'
EnvFlag='echo $LogName|cut -c1-1'
OsName='uname'
case $OsName in
AIX ) echo $OsName ...
GET_ACL="aclget"
MAIL="mailx"
ZIP="/usr/bin/gzip"
LogName='/usr/bin/whoami'
export LogName
;;
HP-UX ) echo $OsName ...
GET_ACL="getacl"
MAIL="mailx -m"
ZIP="/usr/contrib/bin/gzip"
LogName='/usr/bin/whoami'
export LogName
;;
SunOS ) echo $OsName ...
LogName='/usr/ucb/whoami'
ZIP="/usr/bin/gzip"
MAIL="mailx"
export LogName
GET_ACL="getfacl"
;;
Linux ) echo $OsName ...
LogName='/usr/bin/whoami'
MAIL="mailx"
ZIP="gzip"
export LogName
GET_ACL="getfacl"
;;
esac
Cnt=`echo $#`
if [ $Cnt -ne 3 ]
then
echo "Usage : exp_full_db.ksh
echo " e.g. exp_full_db.ksh testdb /optware/oracle/10.2/db /optware/oracle/exportdmp"
exit 0
fi
dbname=$1
ORACLE_HOME=$2
EXPDIR=$3
export ORACLE_HOME
ORACLE_SID=$dbname
export ORACLE_SID
PATH=$ORACLE_HOME/bin:$PATH
export PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export LD_LIBRARY_PATH
if [ ! -d ${ORACLE_HOME} ]
then
echo "ORACLE_HOME ${ORACLE_HOME} does not exist "
exit 0
fi
if [ ! -d ${EXPDIR} ]
then
echo "EXPDIR ${EXPDIR} does not exist "
exit 0
fi
if [ ! -d ${EXPDIR}/log ]
then
mkdir -p ${EXPDIR}/log
fi
dd=`date +%d`
TODAY=`date +'%d-%m-%Y'`
time_to_delete='date +"%d%m%Y%H%M%S"'
LOG=${EXPDIR}/log/exp_full_db_${TODAY}.log
ORA_VER_CHK='11'
### echo exp file=${EXPDIR}/exp_db_${ORACLE_SID}_$dd.dmp log=${EXPDIR}/log/exp_db_${ORACLE_SID}_$dd.log buffer=512000 compres
s=y rows=y statistics=none
echo "/ as sysdba" |exp file=${EXPDIR}/exp_db_${ORACLE_SID}_$dd.dmp log=${EXPDIR}/log/exp_db_${ORACLE_SID}_$dd.log buffer=512
000 compress=y rows=y statistics=none
if [ `grep EXP- ${EXPDIR}/log/exp_db_${ORACLE_SID}_$dd.log | wc -l ` -eq 0 ]
then
echo "Export DB$ table is successful... " >> $LOG
else
echo "Export DB is failed..." >> $LOG
fi
$
[@more@]來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8337095/viewspace-1052058/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- KSH 學習
- oracle dump blockOracleBloC
- ORACLE BLOCK DUMPOracleBloC
- oracle dump 命令Oracle
- oracle dump詳解Oracle
- oracle dump 函式Oracle函式
- oracle dump commandOracle
- Oracle dump函式Oracle函式
- Oracle常用dump命令Oracle
- dump oracle events(轉)Oracle
- Oracle 常用dump命令Oracle
- In Oracle,How to use dumpOracle
- Oracle的dump函式Oracle函式
- 轉:Oracle常用dump命令Oracle
- Oracle 常用dump命令 - 轉Oracle
- Oracle常用dump命令(轉)Oracle
- ZT:Oracle常用dump命令Oracle
- 【備查】oracle dump命令Oracle
- Oracle Dump Redo Log FileOracle
- 獲取兩天內的告警日誌(AIX|ksh|shell|oracle)AIOracle
- oracle之 如何 dump logfileOracle
- Oracle dump函式的用法Oracle函式
- Oracle:dump轉儲檔案Oracle
- Oracle跟蹤事件和dumpOracle事件
- Oracle常用dump命令,備查。Oracle
- Oracle使用dump匯入資料Oracle
- oracle跟蹤事件(dump)總結Oracle事件
- 轉載-Oracle 常用的dump命令Oracle
- (轉)Oracle常用dump命令介紹Oracle
- (轉)oracle dump block格式說明OracleBloC
- ORACLE中的DUMP轉儲方法Oracle
- oracle redo internal 之 dump logfileOracle Redo
- oracle redo internal 之 dump logfileOracle
- Oracle 常用 Dump 命令收集(轉帖)Oracle
- Oracle中DUMP轉儲方法 收藏Oracle
- Oracle中DUMP的轉儲方法Oracle
- oracle實驗記錄 (dump undo)Oracle
- Oracle AMDU- ASM Metadata Dump UtilityOracleASM