Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3702
  • Last Modified:

catalog a rman backup

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
xoxomos
Asked:
xoxomos
  • 13
  • 9
  • 3
2 Solutions
 
KongCommented:
Yes you can! If the rman backup you ran completed successfully...
0
 
seazodiacCommented:
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
 
xoxomosAuthor Commented:
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
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
seazodiacCommented:
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
 
xoxomosAuthor Commented:
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
 
seazodiacCommented:
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
 
KongCommented:
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
 
xoxomosAuthor Commented:
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
 
xoxomosAuthor Commented:
And yes it's 9i r2
0
 
KongCommented:
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
 
xoxomosAuthor Commented:
What is  '<piece handle>'?
You mean literally '<piece handle>'?
0
 
KongCommented:
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
 
xoxomosAuthor Commented:

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
 
KongCommented:
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
 
xoxomosAuthor Commented:
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
 
xoxomosAuthor Commented:
What is the <time stamp>?
0
 
xoxomosAuthor Commented:
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
 
KongCommented:
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
 
xoxomosAuthor Commented:
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
 
KongCommented:
Try:

rman
RMAN> set dbid...
RMAN> connect target /
RMAN> restore database from '/ustage/neil/rman/HAYPSDMD_6_1';
RMAN> recover database;
....
0
 
xoxomosAuthor Commented:
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
 
KongCommented:
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
 
xoxomosAuthor Commented:
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
 
KongCommented:
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
 
xoxomosAuthor Commented:
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 13
  • 9
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now