1826056 Members
4298 Online
109690 Solutions
New Discussion

Re: COLD BACKUP

 
SOLVED
Go to solution
crontab is not running
Occasional Advisor

COLD BACKUP

Hi guys my OS is SunOS 5.10.
I am tring to create cold backup script.
this is my script.

1 dt=`date "+%d%m%c%y"`
2 echo "\nSHUTDOWN DATABASE at " `date`
3 sqlplus "/as sysdba" < 4 shutdown immediate
5 exit;
6 EOF
7 echo "\Copying files to backup directory" `date`
8 cp /oradata/RFID/*.dbf /oradata/cold_bkp/
9 cp /oradata/RFID/*.ctl /oradata/cold_bkp/
10 cp /oradata/RFID/*.log /oradata/cold_bkp/
11 sqlplus "/as sysdba"<12 startup
13 exit
14 EOF2
but after line 6 it stops executing the momoent it comes out of sqlplus it doesnot understand OS cp command.( These line number i have put for ur understanding it doesnot exist in scripts).
so it doesnot copy my dbf,ctl and logfiles to backup dirctory.
Need Help
Regards
Musaddaq
8 REPLIES 8
Steven Schweda
Honored Contributor
Solution

Re: COLD BACKUP

http://forum.java.sun.com/index.jspa?tab=solaris

Be prepared to explain what you mean by "it
doesnot understand OS cp command".

Also, attaching the actual script might
reveal if you made a simple error like
having white space before "EOF".
crontab is not running
Occasional Advisor

Re: COLD BACKUP

Bingo
That's it man. The space was the problem.
Thanks
Musaddaq
Steven Schweda
Honored Contributor

Re: COLD BACKUP

Nice-looking indentation is, in general,
incompatible with a "here document". (It's
not a bug, it's a feature.)
Cem Tugrul
Esteemed Contributor

Re: COLD BACKUP

Hi Musaddaq,
Are you sure that your "oracle" closed
before starting cp???
so it would be nice to check if any oracle
process exist or not BEFORE starting cp

Good Luck,
Our greatest duty in this life is to help others. And please, if you can't
crontab is not running
Occasional Advisor

Re: COLD BACKUP

Hi Cem
Its showing me that database is having a clean Shutdown. But if u have some Suggestions please Do let me know.
Regards
Musaddaq
Cem Tugrul
Esteemed Contributor

Re: COLD BACKUP

Hello Musaddaq,
Here is a small part of my BaaN Erp+Oracle Db
for to take offline scheduled backup script over omniback
#
#

if [ `ps -ef|egrep -i ora_|grep -v rman|grep -v grep|wc -l` -ne 0 ]
then
echo "ORACLE(baan01) is still active!!!"
exit 1
else
echo "Oracle(baan01) is successfully closed!!!"
su - ${ORACLE_USER} -c "${ORACLE_HOME}/bin/lsnrctl stop"

so i do not have any experience about Sun
but i guess you can use "ps -ef" for to check oracle daemons exist or not

Good Luck,
Our greatest duty in this life is to help others. And please, if you can't
Yogeeraj_1
Honored Contributor

Re: COLD BACKUP

hi Musaddaq!

if the logs are showing a clean shutdown, this should not be a problem.

You can also do a ps -ef|grep |grep -i oracle to determine if any oracle processes are still running.

still, the only way to verify that the backup is OK, is to recover from it and see if the database starts properly.

hope this helps too!

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
crontab is not running
Occasional Advisor

Re: COLD BACKUP

Thanks Cem
I will include that in my script.
Thanks for the info once again
Regards
Musaddaq