Hi RajeshKumar
I suggest you do every action have a result code to validate every step is
ok .
if not to do so ,some mistake might be lead the backup to failed
entirely.......
because your backup is cool backup ..
Best Regards
bing.[Email address protected]
Phone number:021-65432211
ext:6621
-----邮件原件-----
发件人: [mailto:oracledba-ezmlmshield-x20486442.[Email address protected]
发送时间: 2006年9月29日 13:49
收件人: LazyDBA Discussion
主题: RE: DB not shutting while taking a cold backup through script
Hi Praveen,
I am forwarding the script also.
#!/bin/ksh
########################################################################
# Program Name - backup_full.sh #
# Purpose - To perform a cold backup of the ARD4 database #
# Author - RAJESH.KUMAR.MATHUR #
# Created Date - 09/28/2006 #
########################################################################
. /u01/app/oracle/PROFILE_920.profile
LOG_FILE=/u01/log/BKP/backup.log
########################################################################
# Execute the backup procedure #
########################################################################
echo `date +%c` >> $LOG_FILE
echo "Database ARD4 BACKUP starting." >> $LOG_FILE
sqlplus "/as sysdba" << EOF shutdown abort; startup restrict; shutdown
immediate; exit; EOF
if [ $? -eq 0 ] then echo "Database ARD4 shutdown." >> $LOG_FILE
echo "Cold backup being performed." >> $LOG_FILE
cp /u02/oradata/ARD4/*.dbf /u03/ARD4_backup/
cp /u07/oradata/ARD4/*.dbf /u03/ARD4_backup/
cp /u06/oradata/ARD4/*.dbf /u03/ARD4_backup/
cp /u03/oradata/ARD4/*.dbf /u03/ARD4_backup/
cp /u04/oradata/ARD4/*.dbf /u03/ARD4_backup/
cp /u05/oradata/ARD4/*.dbf /u03/ARD4_backup/
cp /u03/oradata/ARD4/*.tmp /u03/ARD4_backup/ echo `date +%c` >> $LOG_FILE
echo "Restarting Database ARD4." >> $LOG_FILE
sqlplus "/as sysdba" <<EOF startup exit EOF
if [ $? -eq 0 ] then
echo "Database ARD4 started up." >> $LOG_FILE
else
echo "Database ARD4 will NOT start up." >> $LOG_FILE fi
echo "Compressing the backup files." >> $LOG_FILE
cd /u03/ARD4_backup/
date
gzip *.dbf
gzip *.tmp
date
echo ' Compressing using gzip has been completed successfully on
ARD4 '>>LOG_FILE
else
echo "Database ARD4 failed to shut down." >> $LOG_FILE fi
echo `date +%c` >> $LOG_FILE
echo "Database ARD4 BACKUP has completed." >> $LOG_FILE mailx -s
"ARD4 shutdown unsuccessful !!! Please check the database Status "
########################################################################
#########
Thanks & Regards,
Rajesh Kumar Mathur
Techmahindra Ltd.
Sharda Center, Erandwane.
Pune (MH) - 04
Ph: +91 20 - 56018100 Ext. 1475
-----Original Message-----
From: Parveen Kumar
[mailto:oracledba-ezmlmshield-x98630747.[Email address protected]
Sent: Friday, September 29, 2006 10:48 AM
To: LazyDBA Discussion
Subject: Re: DB not shutting while taking a cold backup through script
what i understand from your question is that you are using shutdown or
shutdown immediate command while you have users logged in and some work is
there in undo to be rolled back . check the sessions and running jobs
which are using undo segments or use shutdown abort (be careful you won't be
able to restore uncomitted work)
Try this
Shutdown abort
startup restrict
shutdown
take a cold backup
and then restart the database
use all three steps otherwise backup won't be consistent
RajeshKumar wrote:
> Hi DBA's
>
> DB is not shutting down while taking a cold backup & the same is
working
> fine for others DB.
> Env: solaris
> O-ver:9i
>
>
> Thanks & Regards,
>
> Rajesh Kumar Mathur
>
> Techmahindra Ltd.
>
> Sharda Center, Erandwane.
>
> Pune (MH) - 04
>
> Ph: +91 20 - 56018100 Ext. 1475
>
>
>
========================================================================
====================================================
>
> Tech Mahindra, formerly Mahindra-British Telecom.
>
> Disclaimer:
>
> This message and the information contained herein is proprietary and
confidential and subject to the Tech Mahindra policy statement, you may
review at <a
href="http://www.techmahindra.com/Disclaimer.html">http://www.techmahind
ra.com/Disclaimer.html</a> externally and <a
href="http://tim.techmahindra.com/Disclaimer.html">http://tim.techmahind
ra.com/Disclaimer.html</a> internally within Tech Mahindra.
>
>
========================================================================
====================================================
>
>
> ---------------------------------------------------------------------
> TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY To post
> a dba job: http://jobs.lazydba.com To Subscribe :
> http://www.LazyDBA.com To unsubscribe:
> http://www.lazydba.com/unsubscribe.html
>
>
---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY To post a dba
job: http://jobs.lazydba.com To Subscribe : http://www.LazyDBA.com To
unsubscribe: http://www.lazydba.com/unsubscribe.html
============================================================================
================================================
Tech Mahindra, formerly Mahindra-British Telecom.
Disclaimer:
This message and the information contained herein is proprietary and
confidential and subject to the Tech Mahindra policy statement, you may
review at <a
href="http://www.techmahindra.com/Disclaimer.html">http://www.techmahindra.c
om/Disclaimer.html</a> externally and <a
href="http://tim.techmahindra.com/Disclaimer.html">http://tim.techmahindra.c
om/Disclaimer.html</a> internally within Tech Mahindra.
============================================================================
================================================
---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY To post a dba
job: http://jobs.lazydba.com To Subscribe : http://www.LazyDBA.com To
unsubscribe: http://www.lazydba.com/unsubscribe.html
Oracle LazyDBA home page