Home » RDBMS Server » Backup & Recovery » How To Restore full backup on a media (Oracle. 11g, RHEL 5.0)
How To Restore full backup on a media [message #554334] Sun, 13 May 2012 01:06 Go to next message
oraeki
Messages: 3
Registered: May 2012
Location: Indonesia
Junior Member

Dear Masters,

Need yours advices for my restore scenario bellow.
I have hot full backup that processed by NetBackup Policy. the backup policy are;

1. Full backup database in Monday. Daily_Monday_RMAN <- 1 volume pool=1 media
2. Full backup database in Tuesday .Daily_Tuesday_RMAN <- 1 volume pool=1 media
3. Full backup database in Wednesday. Daily_Wednesday_RMAN <- 1 volume pool=1 media
4. Full backup database in Thursday. Daily_Thursday_RMAN <- 1 volume pool=1 media
5. Full backup database in Friday. Daily_Friday_RMAN <- 1 volume pool=1 media
6. Full backup database in Saturday. Daily_Saturday_RMAN <- 1 volume pool=1 media

How to restore database from one of medias?

Thanks & regards,
Rizki

Re: How To Restore full backup on a media [message #554336 is a reply to message #554334] Sun, 13 May 2012 01:28 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
How to restore database from one of medias?


What do you mean exactly?
I'd say, just execute RESTORE RMAN command.

Regards
Michel
Re: How To Restore full backup on a media [message #554357 is a reply to message #554336] Sun, 13 May 2012 21:00 Go to previous messageGo to next message
oraeki
Messages: 3
Registered: May 2012
Location: Indonesia
Junior Member

Hi Michael,

I have try to restore by script bellow;
===================================================
ORACLE_SID=MNSG
ORACLE_HOME=/u02/db/11.2.0
export ORACLE_SID ORACLE_HOME
LOG_FILE=/usr/openv/netbackup/ext/db_ext/oracle/restore_`date +%d%m%y`.log
echo "Shutdown Target Database" >> $LOG_FILE
sqlplus "/ as sysdba" <<EOF >> $LOG_FILE
shutdown immediate;
startup mount;
exit
EOF
echo "Restoring Database from Tape...." >> $LOG_FILE
rman catalog=rman/rman@rman target / <<EOF >> $LOG_FILE
RUN
{
allocate channel t0 type 'SBT_TAPE';
send 'NB_ORA_CLIENT=DBSVR';
restore database;
recover database;
release channel t0;
}
EXIT
EOF
echo "End Restore and Recover Database..." >> $LOG_FILE
echo "Open Database Target..." >> $LOG_FILE
sqlplus "/ as sysdba" <<EOF >> $LOG_FILE
alter database open;
exit
EOF
echo "End Of Restore Process..." >> $LOG_FILE
===================================================
The script only restore from the last available backup which we don't want.
the restore that we want is based on the media (e.g monday, tuesday and so on), because each day has its own database.
We want the backup to overwrite the previous data based on the day, hence theres only 1 media for each day.
So how do we make sure that we can restore from the media that we desire?
Re: How To Restore full backup on a media [message #554365 is a reply to message #554357] Sun, 13 May 2012 23:22 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Set SET UNTIL TIME command to choose the day/backup you want.

Regards
Michel
Re: How To Restore full backup on a media [message #554396 is a reply to message #554365] Mon, 14 May 2012 02:22 Go to previous messageGo to next message
oraeki
Messages: 3
Registered: May 2012
Location: Indonesia
Junior Member

Dear Michael,

I have try to set until time like script bellow, but The script still only restore from the last available backup.
===============================
.
.
RUN
{
allocate channel t0 type 'SBT_TAPE';
send 'NB_ORA_CLIENT=dbsvr';
startup mount;
restore database until time "to_date('May 05 2012 02:00:00','Mon DD YYYY HH24:MI:SS')";
recover database until time "to_date('May 05 2012 02:00:00','Mon DD YYYY HH24:MI:SS')";
release channel t0;
}
.
.
===============================
Thanks & regards,
Rizki
Re: How To Restore full backup on a media [message #554400 is a reply to message #554396] Mon, 14 May 2012 03:17 Go to previous message
John Watson
Messages: 8922
Registered: January 2010
Location: Global Village
Senior Member
I had the same problem a couple of months ago, look up
Bug 11694127 : RMAN DUPLICATE NOT HONORING TIME FOR "UNTIL TIME"

Previous Topic: backup full database throws an error
Next Topic: how to hot backup files to other severs?
Goto Forum:
  


Current Time: Fri Mar 29 05:08:53 CDT 2024