Home » RDBMS Server » Backup & Recovery » Help using RMAN newbie (Oracle 11.2.0.3.0 2.6.32-358.18.1.el6.x86_64 )
Help using RMAN newbie [message #600544] Thu, 07 November 2013 13:33 Go to next message
sinhora1
Messages: 7
Registered: July 2010
Location: Toronto
Junior Member
Hello
I'm new to oracle - just started and previous DBA left in place scripts with NO INSTRUCTIONS - i need to restore a database instance into a new server using RMAN command from a backup, the target database was created the same as the source e.g. each have 2 control - I tried to restore using the command restore database however failed, i have looked in oracle docs but the instructions are vague - can someone please help me out?


- this is the script that is currently in use for backup

#### Flush Archivelog
$ORACLE_HOME/bin/sqlplus ' / as sysdba' <<EOF >> $LOGFILE 2>&1
alter system switch logfile;
EOF

#### Perform full database backup including control file and archived logs
#### Delete backed up archived logs
$ORACLE_HOME/bin/rman nocatalog <<EOF >> $LOGFILE 2>&1
connect target
change archivelog all crosscheck;
run {
allocate channel d1 type disk format='$BACKUP_DIR/%d_db_%s_`date +"%b%d"`';
backup
full
filesperset 30
tag daily_full_db_bkup
database;
release channel d1;
allocate channel d1 type disk format='$BACKUP_DIR/%d_al_%s_`date +"%b%d"`';
sql 'ALTER SYSTEM ARCHIVE LOG CURRENT';
backup
filesperset 100
archivelog all;
release channel d1;
}
EOF

#### Backup control file
$ORACLE_HOME/bin/sqlplus ' / as sysdba' <<EOF >> $LOGFILE 2>&1
alter database backup controlfile to trace;
alter database backup controlfile to '$BACKUP_DIR/TDHIPRD_ctl.bak_$TIME';
EOF

#### Perform database backup validation
$ORACLE_HOME/bin/rman nocatalog <<EOF >> $LOGFILE 2>&1
connect target
run {
allocate channel d1 type disk;
restore database validate;
release channel d1;
}
EOF

#### Delete obsolete backup file / Archive logs
$ORACLE_HOME/bin/rman nocatalog <<EOF >> $LOGFILE 2>&1
connect target
run {
delete noprompt obsolete;
}
EOF

#### Capture database file structure
VLOGFILE='v'"$"'logfile'; export VLOGFILE
VCONTROL='v'"$"'controlfile'; export VCONTROL
VPARAMS='v'"$"'parameter'; export VPARAMS

$ORACLE_HOME/bin/sqlplus -s " / as sysdba" <<EOF >> $LOGFILE 2>&1
set pagesize 0 heading off feedback off
spool $BACKUP_DIR/TDHIPRD.txt
select file_name from dba_data_files;
select file_name from dba_temp_files;
select member from $VLOGFILE;
select name from $VCONTROL;
select value from $VPARAMS where name like '%dest%' and value is not null;
spool off
Re: Help using RMAN newbie [message #600547 is a reply to message #600544] Thu, 07 November 2013 14:01 Go to previous messageGo to next message
John Watson
Messages: 4862
Registered: January 2010
Location: Global Village
Senior Member
Ana, what instructions were you following that you found "vague"? you probably need to look at this
http://docs.oracle.com/cd/E16655_01/backup.121/e17630/rcmdupdb.htm#BRADV010
and follow the routine for duplicating a database without a target or catalog connection.
Re: Help using RMAN newbie [message #600589 is a reply to message #600544] Fri, 08 November 2013 14:53 Go to previous messageGo to next message
LKBrwn_DBA
Messages: 449
Registered: July 2003
Location: WPB, FL
Senior Member
Hi Ana,

If you have the source (original) database open, the best would be to "clone" it unto the new server with the "DUPLICATE" command as per instructions in the link posted by Mr Watson.

If you need to restore from the rman backups created by the scripts you posted, it is not impossible but would be a very tedious process.

Good luck!

[Updated on: Fri, 08 November 2013 15:15] by Moderator

Report message to a moderator

Re: Help using RMAN newbie [message #600726 is a reply to message #600589] Mon, 11 November 2013 12:08 Go to previous messageGo to next message
sinhora1
Messages: 7
Registered: July 2010
Location: Toronto
Junior Member
thank you all for all the help -
i did created from a back and from the data from the script about a new oracle instance - actually was easy -;) much easier then what i thought.
now i have another question - i would like to apply to the same instance the logs as i have them going from server A to server B and i i would like to restore the database B to a point and time how do i perform that ?
Re: Help using RMAN newbie [message #600727 is a reply to message #600726] Mon, 11 November 2013 12:45 Go to previous messageGo to next message
BlackSwan
Messages: 23155
Registered: January 2009
Senior Member
If database B was opened & brought online, you can not apply the REDO log files from A.

You could restore again from backups & the use RECOVER UNTIL to apply REDO log files from A
Re: Help using RMAN newbie [message #600729 is a reply to message #600727] Mon, 11 November 2013 13:03 Go to previous messageGo to next message
sinhora1
Messages: 7
Registered: July 2010
Location: Toronto
Junior Member
thank you so much - so we have shipping for the logs from production to a DR server when can we use them ? as they are shipped daily on a hourly basis
i know in sybase i can load them in the database as "load database from '/path'"
thank you again
Re: Help using RMAN newbie [message #600731 is a reply to message #600729] Mon, 11 November 2013 13:05 Go to previous message
BlackSwan
Messages: 23155
Registered: January 2009
Senior Member
http://www.oracle.com/pls/db121/search?remark=quick_search&word=data+guard&partno=
Previous Topic: RMAN restore off autobackup
Next Topic: Why do I have multiple backup sets for a single 'backup database'
Goto Forum:
  


Current Time: Sat Dec 20 18:49:53 CST 2014

Total time taken to generate the page: 0.07798 seconds