Oracle DataBase Cold Backup scritp


Oracle DataBase Cold Backup scritp

Oracle DataBase Cold Backup scritp. . . 
It will help your work and easy to use.
Please drop a comment to tell me, if U find the wrong script or this script is not working.

1.

file name : cold_backup.sh

#!/bin/sh
date
echo " Performing Cold backup . . . "
echo " --------------------------------"
echo " Shuting down the databse . . ."
echo " --------------------------------"
./shutdb.sh
echo " Copy data file  . . . "
echo " --------------------------------"
cp -R -p /media/data1/oracle/oradata/ /media/data1/backup/oradata/
echo " --------------------------------"
echo " Restarting the database . . . "
echo " --------------------------------"
./startdb.sh

2.

file name : shutdb.sh


sqlplus / as sysdba << EOF
set feedback on
set echo on
shutdown immediate;

exit
EOF

3.

file name : startdb.sh


lsnrctl start
sqlplus / as sysdba << EOF
set feedback on
set echo on
startup;

exit
EOF


note :
i'm working under  *Ubuntu 10.10 and using *Oracle 10g.