oracle備份指令碼_user_password
#!/bin/sh
#
DATE=`date +%w`
DIR="/export/home/oracle/ORA_BAK"
BAK_CONF="${DIR}/bin"
RBAK_HOME="/backup/orabackup"
export DATE DIR BAK_HOME
# export oracle dump file
dumpdb()
{
cd $DIR/DATA
$ORACLE_HOME/bin/exp file=$1_$DATE.dmp log=$1_$DATE.log # compress=n
}
zip()
{
cd $DIR/DATA
if [ -f ${DIR}/DATA/$1_$DATE.dmp ] ; then
echo "$1 dmp is dump ... now compress ..."
rm -rf $DIR/DATA/$1_$DATE.dmp.Z
compress $1_$DATE.dmp
echo "database dmp compress OK...."
else
echo "$1 dmp isn't dump "
echo "datatbase dump not failed...."
fi
if [ -f ${DIR}/DATA/$1_$DATE.log ] ; then
echo "$1 log is dump ... now compress ..."
rm -rf $DIR/DATA/$1_$DATE.log.Z
compress $1_$DATE.log
echo "database log compress OK...."
else
echo "$1 log isn't dump "
echo "datatbase log not failed...."
fi
}
# remote copy
rscp()
{
scp ${DIR}/DATA/$3
}
rftp()
{
ftp -n<
user $2 $3
bin
prom off
lcd ${DIR}/DATA
cd ${RBAK_HOME}/DATA
mput $4
close
bye
EOF
}
# loop execu export
#cd $DIR/DATA
IFS=":"
while read username password
do
if [ "$password" == "" ] ; then
#echo "UserName $username"
continue
else
#echo "UserName $username" "PassWord $password"
dumpdb ${username} ${password} $ORACLE_SID
#echo ${username} ${password} $ORACLE_SID
zip $username
fi
done < $BAK_CONF/dbuser.list
IFS=$SAVEDIFS
# copy datafile to backup host
#rftp 192.168.1.20 backup backup123 "*_${DATE}.*.Z"
============dbuser.list
user:password
#!/bin/sh
#
DATE=`date +%w`
DIR="/export/home/oracle/ORA_BAK"
BAK_CONF="${DIR}/bin"
RBAK_HOME="/backup/orabackup"
export DATE DIR BAK_HOME
# export oracle dump file
dumpdb()
{
cd $DIR/DATA
$ORACLE_HOME/bin/exp file=$1_$DATE.dmp log=$1_$DATE.log # compress=n
}
zip()
{
cd $DIR/DATA
if [ -f ${DIR}/DATA/$1_$DATE.dmp ] ; then
echo "$1 dmp is dump ... now compress ..."
rm -rf $DIR/DATA/$1_$DATE.dmp.Z
compress $1_$DATE.dmp
echo "database dmp compress OK...."
else
echo "$1 dmp isn't dump "
echo "datatbase dump not failed...."
fi
if [ -f ${DIR}/DATA/$1_$DATE.log ] ; then
echo "$1 log is dump ... now compress ..."
rm -rf $DIR/DATA/$1_$DATE.log.Z
compress $1_$DATE.log
echo "database log compress OK...."
else
echo "$1 log isn't dump "
echo "datatbase log not failed...."
fi
}
# remote copy
rscp()
{
scp ${DIR}/DATA/$3
}
rftp()
{
ftp -n<
user $2 $3
bin
prom off
lcd ${DIR}/DATA
cd ${RBAK_HOME}/DATA
mput $4
close
bye
EOF
}
# loop execu export
#cd $DIR/DATA
IFS=":"
while read username password
do
if [ "$password" == "" ] ; then
#echo "UserName $username"
continue
else
#echo "UserName $username" "PassWord $password"
dumpdb ${username} ${password} $ORACLE_SID
#echo ${username} ${password} $ORACLE_SID
zip $username
fi
done < $BAK_CONF/dbuser.list
IFS=$SAVEDIFS
# copy datafile to backup host
#rftp 192.168.1.20 backup backup123 "*_${DATE}.*.Z"
============dbuser.list
user:password
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8806316/viewspace-949644/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ORACLE備份指令碼Oracle指令碼
- oracle 備份指令碼Oracle指令碼
- ORACLE日常備份指令碼Oracle指令碼
- Oracle 集中備份指令碼Oracle指令碼
- oracle RMAN備份指令碼Oracle指令碼
- oracle_備份指令碼Oracle指令碼
- Oracle冷備份(一致備份)指令碼Oracle指令碼
- [Oracle] rman備份指令碼(2)Oracle指令碼
- oracle for linux 備份指令碼OracleLinux指令碼
- Oracle邏輯備份指令碼Oracle指令碼
- oracle rman備份指令碼收集Oracle指令碼
- Oracle物理冷備份指令碼Oracle指令碼
- 分享Oracle Rman的備份指令碼Oracle指令碼
- ORACLE常用定時備份指令碼Oracle指令碼
- oracle自動冷備份指令碼Oracle指令碼
- oracle rman 定時備份指令碼Oracle指令碼
- ORACLE自動備份shell指令碼Oracle指令碼
- Oracle用指令碼執行備份Oracle指令碼
- [Oracle] rman備份的指令碼(1)Oracle指令碼
- ORACLE RMAN備份的指令碼配置Oracle指令碼
- Oracle物理熱備份指令碼(ZT)Oracle指令碼
- 備份指令碼指令碼
- oracle11g Rman 備份指令碼Oracle指令碼
- linux下oracle熱備份指令碼LinuxOracle指令碼
- windows 下的Oracle 冷備份指令碼WindowsOracle指令碼
- oracle 自動冷備份指令碼(轉)Oracle指令碼
- rman備份和增量備份指令碼指令碼
- mysqldump 備份指令碼MySql指令碼
- rman 備份指令碼指令碼
- mysqldump備份指令碼MySql指令碼
- innobackupex備份指令碼指令碼
- SQLServer備份指令碼SQLServer指令碼
- SQL 備份指令碼SQL指令碼
- Mongodb 備份指令碼MongoDB指令碼
- rman備份指令碼指令碼
- mysql備份指令碼MySql指令碼
- oracle資料庫使用rman備份指令碼Oracle資料庫指令碼
- Oracle多例項資料庫備份指令碼Oracle資料庫指令碼