Solved

backup and restore

Posted on 2012-12-31
11
753 Views
Last Modified: 2013-03-10
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...?
0
Comment
Question by:walkerdba
  • 6
  • 4
11 Comments
 
LVL 34

Expert Comment

by:johnsone
ID: 38732396
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.
0
 
LVL 1

Expert Comment

by:hraja77
ID: 38732512
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
0
 
LVL 1

Expert Comment

by:hraja77
ID: 38732517
in rman do:
restore the controlfile from autobackup
0
 

Author Comment

by:walkerdba
ID: 38733813
[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
0
 
LVL 1

Accepted Solution

by:
hraja77 earned 500 total points
ID: 38736886
which script did you use to backup the database with - did you specify that you wanted to back up the controlfile - what is in the autobackup folder ?

try:

rman target=/
restore controlfile from autobackup
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:walkerdba
ID: 38743278
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
0
 
LVL 1

Expert Comment

by:hraja77
ID: 38743463
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!
0
 
LVL 1

Expert Comment

by:hraja77
ID: 38743479
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
0
 

Author Comment

by:walkerdba
ID: 38749801
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>
0
 
LVL 1

Expert Comment

by:hraja77
ID: 38922038
just do a :

alter database open resetlogs;
0
 

Author Closing Comment

by:walkerdba
ID: 38971932
ok
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now