| #!/bin/ksh
################################################################
# aFullColdBackup.sh
# Dated: 18-Jan-2000
# Author: Teddy
Graham, teddy@exzilla.net
# Developer
Contact: Teddy Graham
# Subject:
A FULL COLD BACKUP scripts
# Edition:
1.0
################################################################
# Step to A full
cold backup
# 1. shutdown
database
# 2. copy all
datafile include parameter file and password file.
# 3. startup
database
################################################################
# Please change below
variable for macth your environment
# Change below
for your backup distination directory
BACKUPDES=/ub11h/oraBackup
# Change for
your Oracle SID
export ORACLE_SID=viper
# Change for
your Oracle home
export ORACLE_HOME=/oracle/OraHome1
#####################################################
MYTMPFILE=/tmp/xx01.sql
MYDATAFILES=/tmp/xx02.txt
MYSTARTUP=/tmp/startup01.sql
MYSHUTDOWN=/tmp/shutdown01.sql
#####################################################
##Make a script file
for list name of all files ###
cat > $MYTMPFILE
<< 0xff
set heading
off
set pagesize
0
set feedback
off
set echo off
spool $MYDATAFILES
select 'cp '|| name
|| ' $BACKUPDES' from v\$datafile;
select 'cp
'|| name || ' $BACKUPDES' from v\$controlfile;
spool off
exit
0xff
##end list all file
scripts ###
#####################################################
#####################################################
# Create Os command
for backup all data file
#####################################################
sqlplus system/manager
@$MYTMPFILE
#check all file for
test all files that this scripts created
#echo "\necho
from " $MYTMPFILE "\n"
#cat $MYTMPFILE
#echo "\necho
from " $MYSTARTUP "\n"
#cat $MYSTARTUP
#echo "\necho
from " $MYSHUTDOWN "\n"
#cat $MYSHUTDOWN
clear
#echo "\necho from
" $MYDATAFILES "\n"
#cat $MYDATAFILES
############ Core
Part ##########################
# shutdown DB
echo "\n*** Shutdown
Database for Backup *****"
svrmgrl <<
0xff
connect internal
shutdown immediate
exit
0xff
# Backup whole datafile
echo "\n\n*****
Start copy all datafiles to backup Destination *****\n\n"
# Backup all
datafile
echo "\n Wait
for copy all data files :-| \n"
#cat $MYDATAFILES
sh $MYDATAFILES
echo "Finished copy
all files :-) ,if you don't see any error text that mean
completed ! "
# Backup parameters
file and password file
#echo "cp $ORACLE_HOME/dbs/orapw$ORACLE_SID
$BACKUPDES"
cp $ORACLE_HOME/dbs/orapw$ORACLE_SID
$BACKUPDES
#echo "cp $ORACLE_HOME/admin/$ORACLE_SID/pfile/init$ORACLE_SID.ora
$BACKUPDES
cp $ORACLE_HOME/admin/$ORACLE_SID/pfile/init$ORACLE_SID.ora
$BACKUPDES
echo "\n\n***** End
copy all datafiles to backup Destination *****\n\n"
# startup DB
echo "\n*** Startup
Database for Backup *****"
svrmgrl <<
0xff
connect internal
startup
exit
0xff
############ END
Core Part ##########################
#### Clear
all scripts ########
rm $MYTMPFILE
rm $MYDATAFILES
#### End clear
all scripts ########
|