Video Screencast Help

Oracle Restore

Created: 29 Mar 2013 | 4 comments

I am trying to perform a Oracle Restore and it failed, I have very limited experience so my troubleshooting skills are limited.

Any idea of what I am doing incorrectly?

from RMAN I did the following, I am trying to restore the entire Database from a specific day. In this case a Full Oracle Backup I did this morning.

RMAN> {
  # set time to just before data was lost.
  SET UNTIL TIME 'Mar 29 2013 12:55:00'; 
  RESTORE CONTROLFILE;  
  ALTER DATABASE MOUNT; 
  RESTORE DATABASE;
  RECOVER DATABASE;
}2> 3> 4> 5> 6> 7> 8> 
9> 
10> 
 
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "end-of-file": expecting one of: "exit"
RMAN-01007: at line 10 column 1 file: standard input
 
Operating Systems:
Discussion Filed Under:

Comments 4 CommentsJump to latest comment

Yasuhisa Ishikawa's picture

THis is syntax error in RMAN - not related with NetBackup. Please ask Oracle DBA or experts to check your command lines.

IF you want to restore backups taken by Netbackup, you need to allocate SBT channel. But no such statement here.

Authorized Symantec Consultant(ASC) Data Protection in Tokyo, Japan

Ankit Maheshwari's picture

Please suggest how to Restore Oracle Data.. can we restore from Master server..

Please share any technote...

Ankit Maheshwari

Ankit Maheshwari

Yasuhisa Ishikawa's picture

can we restore from Master server..

NO, you need to run RMAN command on the Oracle server.
Recovery procedure is various, and it depends on current state. I'm not sure the cammands you post is correct for you current status, but as I wrote,  you need to add "allocate channel t1 type sbt;" to restore from backup pieces stored in MML(=NetBackup in this case).
 
Please try below. If you get error, please ask Oracle DBA to confirm the commands you type is correct.
 
RMAN> SET UNTIL TIME 'Mar 29 2013 12:55:00'; 
RMAN> RUN {
1>  ALLOCATE CHANNEL t1 TYPE sbt;
2>  RESTORE CONTROLFILE;  
3>  RELEASE CHANNEL t1;
4> }
RMAN>  ALTER DATABASE MOUNT; 
RMAN> RUN { 
1>  ALLOCATE CHANNEL t1 TYPE sbt;
2>  RESTORE DATABASE;
3>  RECOVER DATABASE;
4>  RELEASE CHANNEL t1;
5> }

Authorized Symantec Consultant(ASC) Data Protection in Tokyo, Japan

vjuhola's picture

Are you using recovery catalog or nocatalog? Or autobackup? Is the backup on a filesystem or on external media (tape or disk)?

You need to have the database in nomount state when you are restoring controlfile. You can do that as follows:

su - oracle

export ORACLE_SID=DBSID

sqlplus / as sysdba

shutdown immediate;

startup nomount;

For recovery:

This restores controlfile and puts the database in mount state so you can continue with database restore. Note that you need put the client name and policy there, and also edit the timestamp to which you want to do the point-in-time recovery. Also you need to put DBID before you start. Everything is done in RMAN.

SET DBID=<bunch of numbers here>;

RUN {
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE' parms='ENV=(NB_ORA_CLIENT=client_name@here.com,NB_ORA_POLICY=policy_name_here)';
set until time "to_date('2010 Jan 31 21:30','yyyy mon dd hh24:mi')";
restore controlfile;
sql 'alter database mount';
}

This restores and does a recovery for the database. Note that you need put the client name and policy there, and also edit the timestamp to which you want to do the point-in-time recovery.

RUN {
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE' parms='ENV=(NB_ORA_CLIENT=client_name@here.com,NB_ORA_POLICY=policy_name_here)';
set until time "to_date('2010 Mar 21 21:30','yyyy mon dd hh24:mi')";
restore database;
recover database;
}

After that you need to open the database using either resetlogs or noresetlogs. Resetlogs zeros the sequence numbering, noresetlogs doesn't. It is recommended that you use resetlogs and do the database opening in sqlplus.

sqlplus / as sysdba

alter database open resetlogs;

-v