#!/bin/ksh
export ORACLE_HOME=/oracle/product/9.2.0
export ORACLE_OWNER=oracle
export ORACLE_SID=mcpay
. ${ORACLE_HOME}/.profile
_LOC=/usr/bin
_LOG=/backup/online_backup
_SRC=/backup/online_backup
_BCK=/backup/online_backup
DATE=`date +%y%m%d`
#########################################
######### Hotbackup Script Create ############
#########################################
#${_SRC}/cr_hotbackup.sh
$ORACLE_HOME/bin/sqlplus "/ as sysdba"<< EOF
set heading off
set echo off
set feedback off
set linesize 150
set pagesize 0
set long 10000
spool ${_SRC}/hotbackup_t1.sql
@${_SRC}/begin_backup
@${_SRC}/src.sql
@${_SRC}/end_backup
spool off
exit
EOF
${_LOC}/egrep -v '(SQL>)' ${_SRC}/hotbackup_t1.sql > ${_SRC}/hotbackup.sql
${_LOC}/rm ${_SRC}/hotbackup_t1.sql
#########################################
############ Hotbackup Exec ###############
#########################################
$ORACLE_HOME/bin/sqlplus "/ as sysdba"<< EOF
spool ${_LOG}/hotbackup_$DATE.log
@${_SRC}/hotbackup
alter system switch logfile;
alter database backup controlfile to '${_BCK}/backup_$DATE.ctl';
spool off
exit
EOF
#########################################
########### Archive log backup ##############
#########################################
${_SRC}/arc_del_make.sh
댓글 없음:
댓글 쓰기