Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: rman backups without a catalog
Actually the controlfile knows where to look for the backup files. However,
you do need an after image of the controlfile to know which sets comprise
the latest backup. A nocatalog backup only takes a before image.
Ruth
-----Original Message-----
From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org]On Behalf Of Schauss, Peter
Sent: Tuesday, July 13, 2004 1:46 PM
To: Oracle-L (E-mail)
Subject: rman backups without a catalog
I am trying to set up rman to do hot backups without a catalog My script is shown below. My rationale for backing up the control file outside of rman is that I need to have a control file in place in order for rman to know where to look for the backup files to restore.
--------------Backup script -------------------------------------------
export ORACLE_BASE=/opt/oracle export BACKUP_DIR=/orabkup/$1/hot_copies export ORAENV_ASK=NO export ORACLE_SID=$1
echo " "
signon=`cat $ORACLE_BASE/maint/dba.ctl/dba.$1`
#
BASE_NAME=`date +$1_%y%m%d%H%M%S`
#
rman target $signon nocatalog <<EOF
run {
allocate channel ch1 type disk format '$BACKUP_DIR/${BASE_NAME}_1.rbk';
allocate channel ch2 type disk format '$BACKUP_DIR/${BASE_NAME}_2.rbk';
allocate channel ch3 type disk format '$BACKUP_DIR/${BASE_NAME}_3.rbk';
backup database; sql 'ALTER SYSTEM ARCHIVE LOG CURRENT';}
gzip $BACKUP_DIR/${BASE_NAME}_1.rbk gzip $BACKUP_DIR/${BASE_NAME}_2.rbk gzip $BACKUP_DIR/${BASE_NAME}_3.rbk
#
# Backup the control file which now contains a record
# of this backup.
#
file=`date +$1_control.%y%m%d.bak`
sqlplus $signon <<EOF
alter database backup controlfile to '$BACKUP_DIR/${file}';
exit
EOF
#
------------------------end of backup script ----------------------------------------
Using the three backup files and one backup control file, I am able to
restore the database
to another machine using the following procedure:
Is there a better way to do this?
Thanks,
Peter Schauss
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html ----------------------------------------------------------------- ---------------------------------------------------------------- Please see the official ORACLE-L FAQ: http://www.orafaq.com ---------------------------------------------------------------- To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line. -- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------Received on Tue Jul 13 2004 - 13:14:33 CDT