Avatar of walkerdba
walkerdba
 asked on

backup and restore

I have a database named orcl

I backup the data using rman ...

the backup is in this locationn
[oracle@wtu flash_recovery_area]$ cd orcl/
[oracle@wtu orcl]$ ls
control02.ctl
[oracle@wtu orcl]$ cd ..
[oracle@wtu flash_recovery_area]$ cd ORCL/
[oracle@wtu ORCL]$ ls
archivelog  autobackup  backupset  flashback  onlinelog
[oracle@wtu ORCL]$ cd backupset/
[oracle@wtu backupset]$ ls
2012_10_17  2012_10_29  2012_12_31
[oracle@wtu backupset]$ cd 2012_12_31/
[oracle@wtu 2012_12_31]$ ls
o1_mf_annnn_TAG20121231T022129_8g2ssc7g_.bkp
o1_mf_annnn_TAG20121231T022442_8g2szbtp_.bkp
o1_mf_nnndf_TAG20121231T022236_8g2svf3z_.bkp

and then I deleted the

[oracle@wtu oradata]$ cd orcl/
[oracle@wtu orcl]$ ls
control01.ctl  redo01.log  redo03.log    system01.dbf  undotbs01.dbf
example01.dbf  redo02.log  sysaux01.dbf  temp01.dbf    users01.dbf
[oracle@wtu orcl]$ rm -rf *



Then I tried to connect rman to restore and recovery..

Meanwhile i shutdown the database....
SQL> shutdown immediate
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/u01/app/oracle/oradata/orcl/control01.ctl'
ORA-27041: unable to open file
Linux Error: 2: No such file or directory
Additional information: 3


Then I tried to connect rman for restore and recovery..
But is shows the error ....


[oracle@wtu orcl]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on Mon Dec 31 02:42:30 2012

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

SQL> exit
[oracle@wtu orcl]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Mon Dec 31 02:42:35 2012

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-06003: ORACLE error from target database:
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/u01/app/oracle/oradata/orcl/control01.ctl'
ORA-27041: unable to open file
Linux Error: 2: No such file or directory
Additional information: 3
[oracle@wtu orcl]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on Mon Dec 31 02:44:33 2012

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

I shows error



Can you help me to solve...?
Oracle Database

Avatar of undefined
Last Comment
walkerdba

8/22/2022 - Mon
johnsone

I would suggest looking at the documentation.  This should be a helpful link:

http://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmadvre.htm#i1006453

This link takes you to disaster recovery, which is more or less the scenario that you are trying to test.  The reason that you are getting an error is that you have deleted the control file and that needs to be restored first.
hraja77

do a "shutdown abort"
then do a "startup nomount"
you then need to restore the controlfile from the backup;
then you can restore the database

cheersH
hraja77

in rman do:
restore the controlfile from autobackup
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
walkerdba

ASKER
[oracle@wtu backupset]$ cd 2012_12_31/
[oracle@wtu 2012_12_31]$ ls
o1_mf_annnn_TAG20121231T022129_8g2ssc7g_.bkp
o1_mf_annnn_TAG20121231T022442_8g2szbtp_.bkp
o1_mf_nnndf_TAG20121231T022236_8g2svf3z_.bkp
[oracle@wtu 2012_12_31]$ pwd
/u01/app/oracle/flash_recovery_area/ORCL/backupset/2012_12_31
[oracle@wtu 2012_12_31]$

there are three backup pieces in the above folder...
when we give

restore controlfile from '    '   which one I will give for controlfile


which one I will give for spfile.
which one for redo log
ASKER CERTIFIED SOLUTION
hraja77

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
walkerdba

ASKER
I did until this
what is next step..


SQL> startup
ORACLE instance started.

Total System Global Area 1707446272 bytes
Fixed Size                  1336988 bytes
Variable Size            1124075876 bytes
Database Buffers          570425344 bytes
Redo Buffers               11608064 bytes
ORA-00205: error in identifying control file, check alert log for more info


SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@wtu ~]$ rman target=/

Recovery Manager: Release 11.2.0.1.0 - Production on Fri Jan 4 02:20:08 2013

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ORCL (not mounted)

RMAN> restore controlfile from autobackup;

Starting restore at 04-JAN-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=18 device type=DISK

recovery area destination: /u01/app/oracle/flash_recovery_area
database name (or database unique name) used for search: ORCL
channel ORA_DISK_1: AUTOBACKUP /u01/app/oracle/flash_recovery_area/ORCL/autobackup/2012_12_31/o1_mf_s_803442284_8g2szfd5_.bkp found in the recovery area
AUTOBACKUP search with format "%F" not attempted because DBID was not set
channel ORA_DISK_1: restoring control file from AUTOBACKUP /u01/app/oracle/flash_recovery_area/ORCL/autobackup/2012_12_31/o1_mf_s_803442284_8g2szfd5_.bkp
channel ORA_DISK_1: control file restore from AUTOBACKUP complete
output file name=/u01/app/oracle/oradata/orcl/control01.ctl
output file name=/u01/app/oracle/flash_recovery_area/orcl/control02.ctl
Finished restore at 04-JAN-13

RMAN> startup force mount

Oracle instance started
database mounted

Total System Global Area    1707446272 bytes

Fixed Size                     1336988 bytes
Variable Size               1124075876 bytes
Database Buffers             570425344 bytes
Redo Buffers                  11608064 bytes
hraja77

ok - thats restored your controlfie which is great;
all you need to do now is to restore the database;
in rman issue: "restore database"
after that issue "recover database"

thats should do it!
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
hraja77

rememeber if your controlfile was the last thing you backed up after the database your fine - however if its the first thing you backed up you will need to register your backup pieces in rman using:

CATALOG BACKUPPIECE '/2012_12_31//o1_mf_annnn_TAG20121231T022129_8g2ssc7g_.bkp';

do this for each piece
walkerdba

ASKER
After that this is the problem..


Recovery Manager complete.
[oracle@wtu ~]$ export ORACLE_SID=orcl
[oracle@wtu ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sun Jan 6 21:12:42 2013

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> startup nomount
ORA-01081: cannot start already-running ORACLE - shut it down first
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@wtu ~]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Sun Jan 6 21:12:54 2013

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ORCL (DBID=1321380463, not open)

RMAN> startup up force mount;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "up": expecting one of: "dba, force, mount, newline, nomount, pfile, ;"
RMAN-01007: at line 1 column 9 file: standard input

RMAN> startup force mount;

Oracle instance started
database mounted

Total System Global Area    1707446272 bytes

Fixed Size                     1336988 bytes
Variable Size               1124075876 bytes
Database Buffers             570425344 bytes
Redo Buffers                  11608064 bytes

RMAN> CATALOG BACKUPPIECE '/u01/app/oracle/flash_recovery_area/ORCL/backupset/2012_12_31/o1_mf_annnn_TAG20121231T022129_8g2ssc7g_.bkp';

using target database control file instead of recovery catalog
cataloged backup piece
backup piece handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/2012_12_31/o1_mf_annnn_TAG20121231T022129_8g2ssc7g_.bkp RECID=15 STAMP=804028761

RMAN> CATALOG BACKUPPIECE '/u01/app/oracle/flash_recovery_area/ORCL/backupset/2012_12_31/o1_mf_annnn_TAG20121231T022442_8g2szbtp_.bkp';

cataloged backup piece
backup piece handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/2012_12_31/o1_mf_annnn_TAG20121231T022442_8g2szbtp_.bkp RECID=16 STAMP=804028820

RMAN> CATALOG BACKUPPIECE '/u01/app/oracle/flash_recovery_area/ORCL/backupset/2012_12_31/o1_mf_nnndf_TAG20121231T022236_8g2svf3z_.bkp';

cataloged backup piece
backup piece handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/2012_12_31/o1_mf_nnndf_TAG20121231T022236_8g2svf3z_.bkp RECID=17 STAMP=804028854

RMAN> restore database;

Starting restore at 06-JAN-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=18 device type=DISK

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/orcl/system01.dbf
channel ORA_DISK_1: restoring datafile 00002 to /u01/app/oracle/oradata/orcl/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/orcl/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/orcl/example01.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/ORCL/backupset/2012_12_31/o1_mf_nnndf_TAG20121231T022236_8g2svf3z_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/2012_12_31/o1_mf_nnndf_TAG20121231T022236_8g2svf3z_.bkp tag=TAG20121231T022236
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:01:36
Finished restore at 06-JAN-13

RMAN> recover database;

Starting recover at 06-JAN-13
using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 59 is already on disk as file /home/oracle/Desktop/stby/1_59_793599730.dbf
archived log file name=/home/oracle/Desktop/stby/1_59_793599730.dbf thread=1 sequence=59
unable to find archived log
archived log thread=1 sequence=60
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 01/06/2013 21:24:44
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 60 and starting SCN of 1667468

RMAN>
hraja77

just do a :

alter database open resetlogs;
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
walkerdba

ASKER
ok