Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: rman backups without a catalog

RE: rman backups without a catalog

From: Ruth Gramolini <rgramolini_at_tax.state.vt.us>
Date: Tue, 13 Jul 2004 14:17:13 -0400
Message-ID: <003f01c46905$9ee6b810$8459699f@vttaxnet.tax.state.vt.us>


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 -------------------------------------------

#!/bin/ksh
#
# rman_bkup.ksh
#
# Backup a database using rman
#

echo " "
echo " * set Oracle environment variables " export PATH=${PATH}:/usr/local/bin
export ORACLE_BASE=/opt/oracle
export BACKUP_DIR=/orabkup/$1/hot_copies
export ORAENV_ASK=NO
export ORACLE_SID=$1

. /usr/local/bin/oraenv
export ORAENV_ASK=

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';
}
exit
EOF
#
# Compress the backup files
#
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:

  1. Copy the backup files to a directory with the same path as the ones where they were created.
  2. gunzip the backup files.
  3. Copy the backup control to control01.ctl, control02.ctl, and control03.ctl in the directory where the init<sid>.ora says that they should be.
  4. rman target system/password nocatalog rman > startup mount;
  5. From a separate session run sqlplus internal and determine the scn number from v$archived_log.
  6. rman > run{ set until scn=<value determined in step 4>; allocate channel ch1 type disk; allocate channel ch2 type disk; allocate channel ch3 type disk; restore database; recover database; alter database open resetlogs; }

Is there a better way to do this?

Thanks,
Peter Schauss



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
-----------------------------------------------------------------

----------------------------------------------------------------
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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US