Solved

catalog a rman backup

Posted on 2003-11-03
25
3,637 Views
Last Modified: 2010-10-05
I made a backup using rman
rman
rman> run {
...
format...
backup (database include current controlfile)
...
I couldn't use it because I completely destroyed the database and i wasn't using a catalog.  It did produce two files.
I now have a catalog on a different database.  Can I catalog those two files somehow and use it to recover the database?
0
Comment
Question by:xoxomos
  • 13
  • 9
  • 3
25 Comments
 
LVL 2

Accepted Solution

by:
Kong earned 150 total points
ID: 9678212
Yes you can! If the rman backup you ran completed successfully...
0
 
LVL 23

Expert Comment

by:seazodiac
ID: 9678548
It depends upon whether how bad your database is and whether you could bring your database to a mounted state or NOT.


Here is the restrictions for RMAN Catalog:
You must be connected to the target database, and the database must be mounted or open. If you use a recovery catalog, then the catalog must be open.

so if your target database is completely destroyed , you cannot mount the database, it seems to me that you cannot do the catalog of the backup.
0
 

Author Comment

by:xoxomos
ID: 9681573
The rman backup ran successfully.  This was before i did the resetlogs.
With the current database I can mount but not start.  That's when I get the message about the controlfile being newer that the resetlogs.  
The backup was not cataloged on the seperate database.  How does RMAN recognize it for the restore?
0
 
LVL 23

Assisted Solution

by:seazodiac
seazodiac earned 150 total points
ID: 9681689
if you have a valid rman backup, and your target database can be mounted.

then try the following:
1. startup mount the crashed database to bring it in mount mode.
2. start up the rman : RMAN catalog rman/rman@<rman_repository_sid> target sys/password@<target_database>

3. at the rman command prompt:
RMAN> register database;
rman will use the target database control file (control file is valid when database in mount mode) to build the catalog information about database.

4. RMAN>catalog backup '<path/to/your/rman/backupfile>';

5. RMAN> restore database;
6. RMAN>recover database;

7. back to the target database , and shutdown immediate

8. restart the database and try to open it.
0
 

Author Comment

by:xoxomos
ID: 9682974
Oracle isn't buying it.

RMAN> register database
2> ;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of register command at 11/04/2003 13:51:12
RMAN-08040: full resync skipped, controlfile is not current or backup

RMAN>

I think this snipet from an article captures my situation here.
".....that's unfortunate because the 'resetlogs' command basically forces the entire database to re-synchronize at time zero, which is fine for getting the database open but is not exactly useful if you ever need to restore
from your prior backups....'


So now what do I have to do ...just delete the database and build it again?
0
 
LVL 23

Expert Comment

by:seazodiac
ID: 9683003
Xoxomos:

Yes, I think you have to do a complete database rebuild.
but watch for these pitfalls:

1. when you do a incompelete recovery, open database with resetlogs, make sure to get a cold database copy right after shutdown the database.
2. almost alway use the CATALOG, don't use control file. this will give a lot of safety bargins on the table.
0
 
LVL 2

Expert Comment

by:Kong
ID: 9683005
Are you using 9i?

Can you mount the database? Ok, I'm getting confused now, too many threads...

Seazodiac, I think the problem is that the current controlfile has recorded a resetlogs and the backup was taken prior to the resetlogs...

You will need to restore the controlfile from your complete rman backup, mount your database & restore database then topping that off with another resetlogs because you've lost one of the redo logs...

Syntax to follow...
0
 

Author Comment

by:xoxomos
ID: 9683059
Yep, I think Kong understands exactly what's happening.  It's something about the SCN business.  Yes the database does mount fine.  Looks like it's ready to go unitl I say OPEN.
0
 

Author Comment

by:xoxomos
ID: 9683141
And yes it's 9i r2
0
 
LVL 2

Expert Comment

by:Kong
ID: 9683143
Before rebuilding the database try this:

- startup nomount
- startup RMAN but do not connect
RMAN> set dbid=<value of dbid from rman backup output>
RMAN> connect target /
RMAN> restore controlfile from '<piece handle>'
eg read from output if output is:
RMAN> alter database mount;

Try the following first:
RMAN> recover database;

If that fails then:
RMAN> run {              
                    set until time=<time stamp>;              
                    recover database;              
                    alter database open resetlogs;          
                   }

It works, just tested it on my ORCL database :-)

Good luck!
K
0
 

Author Comment

by:xoxomos
ID: 9683218
What is  '<piece handle>'?
You mean literally '<piece handle>'?
0
 
LVL 2

Expert Comment

by:Kong
ID: 9683237
Oops.. typo:

'<piece handle>' is taken from the output of your successful backup, it'd look something like this:

channel Channel1: finished piece 1 at NOV 05 2003 10:10:50
piece handle=/ora10/backup/ORCL/b_01f5ltvf_1_1 comment=NONE
channel Channel1: backup set complete, elapsed time: 00:00:59

The piece handle would be: /ora10/backup/ORCL/b_01f5ltvf_1_1

K
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:xoxomos
ID: 9683341

RMAN> restore controlfile from 'ustage/xoxomos/rman/HAYPSDMD_6_1'
2> ;

Starting restore at 04-NOV-03

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 11/04/2003 16:12:45
RMAN-12010: automatic channel allocation initialization failed
RMAN-06171: not connected to target database

RMAN>
0
 
LVL 2

Expert Comment

by:Kong
ID: 9683364
Is the database started in nomount?

Did you run rman from the prompt eg:

rman
RMAN> set dbid=<value of dbid from rman backup output>
RMAN> connect target /
RMAN> restore controlfile from 'ustage/xoxomos/rman/HAYPSDMD_6_1'

You need to give the full path, 'ustage/xoxomos/rman/HAYPSDMD_6_1' is not correct...

0
 

Author Comment

by:xoxomos
ID: 9683419
Sorry, I forgot to do the connect / before.


RMAN> connect target /

connected to target database:  (not mounted)

RMAN> restore controlfile from '/ustage/neil/rman/HAYPSDMD_6_1';

Starting restore at 04-NOV-03

using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=10 devtype=DISK
channel ORA_DISK_1: restoring controlfile
channel ORA_DISK_1: restore complete
replicating controlfile
input filename=/u01/app/oracle/oradata/haypsdmd/control01.ctl
output filename=/u01/app/oracle/oradata/haypsdmd/control02.ctl
output filename=/u01/app/oracle/oradata/haypsdmd/control03.ctl
Finished restore at 04-NOV-03
0
 

Author Comment

by:xoxomos
ID: 9683423
What is the <time stamp>?
0
 

Author Comment

by:xoxomos
ID: 9683444
Yeah, this failed :
RMAN> alter database mount;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 11/04/2003 16:28:57
ORA-00000: normal, successful completion

RMAN>

so
If that fails then:
RMAN> run {              
                    set until time=<time stamp>;              
                    recover database;              
                    alter database open resetlogs;          
                   }

It works, just tested it on my ORCL database :-)


but what is <time stamp>???
0
 
LVL 2

Expert Comment

by:Kong
ID: 9683456
Looking good :-)

Just log into SQL*Plus as sysdba and issue:

SQL> recover database;

If that fails (because you've lost an online redo & have not multiplexed it), then you'll need to issue:

SQL> recover database until cancel;

Press enter until you've reached that lost redo log and type cancel, then:

SQL> alter database open resetlogs;
0
 

Author Comment

by:xoxomos
ID: 9683551
I think this message is because the system people have taken everything off /u02 to reconfigure.  I'll try putting it back temporarily.   Will let you know tomorrow.  Tune in same time.




SQL> recover database until cancel using backup controlfile;
ORA-00283: recovery session canceled due to errors
ORA-01110: data file 1: '/u02/app/oracle/oradata/haypsdmd/system01.dbf'
ORA-01157: cannot identify/lock data file 1 - see DBWR trace file
ORA-01110: data file 1: '/u02/app/oracle/oradata/haypsdmd/system01.dbf'

0
 
LVL 2

Expert Comment

by:Kong
ID: 9683625
Try:

rman
RMAN> set dbid...
RMAN> connect target /
RMAN> restore database from '/ustage/neil/rman/HAYPSDMD_6_1';
RMAN> recover database;
....
0
 

Author Comment

by:xoxomos
ID: 9683828
This oracle is brutal....still complaining

SQL> recover database until cancel;
ORA-00283: recovery session canceled due to errors
ORA-01610: recovery using the BACKUP CONTROLFILE option must be done


SQL> recover database until cancel using backup controlfile;
ORA-00283: recovery session canceled due to errors
ORA-01190: controlfile or data file 1 is from before the last RESETLOGS
ORA-01110: data file 1: '/u02/app/oracle/oradata/haypsdmd/system01.dbf'

0
 
LVL 2

Expert Comment

by:Kong
ID: 9683924
Did you issue the restore database command in rman?

Looks like you've restored only part of the database, in this case probably only controlfile...
0
 

Author Comment

by:xoxomos
ID: 9684247
Probably so

There were actually two files, a haypsdmd_6_1 and haypsdmd_7_1.
  I've got this statement
RMAN> restore controlfile from '/ustage/neil/rman/HAYPSDMD_6_1';

but there's nothing restored from the haypsdmd_7_1.
How do i tell it to recover the haypsdmd_7_1?
0
 
LVL 2

Expert Comment

by:Kong
ID: 9684299
Ahhh... Forgot about that bit :-)

Ok try this after connecting as directed b4 (you must be an expert by now :-P):

run {
allocate channel Channel1 type disk format '/ustage/neil/rman/<your backup format>';
allocate channel Channel2 type disk format '/ustage/neil/rman/<your backup format>';
restore ( tablespace 'SYSTEM', '...');
}

note: <your backup format> can be derived from the output of the successful backup.

then in SQL:

SQL> recover database until cancel using backup controlfile;

It'd be helpful if you pasted the output of the successful rman backup session.

K
0
 

Author Comment

by:xoxomos
ID: 9696266
Well Kong, i'm sure it would have worked only I had gotten out, did something so when I got back to try it complained about the sys password I have used.  Can't even get to that database through EM, only as sys/ as sysdba.  Anyhow I'll post a rman backup session and some stuff from the catalog to get an Idea how I should have gone about it although I'm planning to stay strictly away from that RESETLOGS!!!.
Thanks
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

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

744 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

13 Experts available now in Live!

Get 1:1 Help Now