cancel
Showing results for 
Search instead for 
Did you mean: 

Restore Backup From Tape

SOLVED
Go to solution
Adrian Sobers2
Super Advisor

Restore Backup From Tape

I would like to restore a full backup from tape to return to the point in time the backup was done. The backup was a full, cold database backup and was written to tape.

To recover what is the procedure I have to follow? I'm assuming I have to:

#restore the archive from tape
tar -xvf /dev/rmt/0m

Thing is do I have to shutdown the database and mount it (but not fully open it)? This is the first time I'm doing this and I would like to have some guidance. Thanks in advance.

Miscellaneous Info.

Oracle 8.0.5.2 running on HP-UX 11.00 64-bit
287MB RAM on D-CLASS 9000 server
12 REPLIES
Jeff Lightner_1
Frequent Advisor
Solution

Re: Restore Backup From Tape

Adrian,

Assumptions from your question:
-Your database is in cooked filesystems rather than raw devices.
-Your database was completely down at the time of the backup (cold backup means this)
-You used tar to do the backup.
-The "mount" you mention is the SQL mount database command rather than the OS mount filesystem command.

Assuming all those are correct the answer is to completely shutdown and do NOT mount the database (but DO mount the filesystem). Then do the restore as you've indicated.
Adrian Sobers2
Super Advisor

Re: Restore Backup From Tape

Yes all of your assumptions are correct. But I have a follow up question:

When you say do not mount the database but mount the filesystem. Do I just shutdown the database and with filesystems mounted (as they would be during normal daily operation), and just run the tar command?
Chris Xu
Trusted Contributor

Re: Restore Backup From Tape

Yes, you just shutdown the database and the filesystems should still stay mounted. One thing to consider is you don't have to restore Oracle installation (ORACLE_HOME) if no changes made to Oracle configs and restore time is a consideration.

Chris
Chris Xu
Trusted Contributor

Re: Restore Backup From Tape

Just to clarify database start/stop
You can start Oracle db with "NOMOUNT", "MOUNT" and "OPEN" optional state. A db in any of the states is considered still running. To be double sure, just grep oracle processes after you shut it down to see if anything still running.
Yogeeraj_1
Honored Contributor

Re: Restore Backup From Tape

hi Adrian,

if you are testing backup and recovery for oracle database, it would be preferable that you use RMAN.

RMAN decreases the chance of you making a mistake.

I prefer to use RMAN because of the other advantages:

1. It is much (MUCH) faster than OS file copies by a long shot. I can fully backup small databases even on Windows in a few minutes.

2. It deals with the backup process at the block level so it waits for each block to become consistent to back it up, therefore no "cracked blocks" like file copying.

3. You can "easily" parallelize backup and much more importantly it can parallelize recovery.

4. Backup retension scheduling is built-in, no more do I delete this backup or not, it's part of your design and deployment process.

5. It can manage the archived redo log automatically for you (getting them off the system to somewhere safe is important) including deleting the old logs.
6. It deals with cold backups (if anybody actually wants to do one anymore).

7. One RMAN catalog database can manage a complete enterprise, Unix, Windows who cares and it can do it concurrently because the Oracle database Server is doing the real work.

8. Testing backups without restoring is built-in and that's nice as well.

9. No more putting tablespaces in backup mode and hammering the daylights out of the redo log system.

10. Making standby databases and cloning is way simpler under RMAN becuse it is designed to do that for you.

These are only a few of my favorite things.

hope this helps

regards
yogeeraj

No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Adrian Sobers2
Super Advisor

Re: Restore Backup From Tape

I have started the restoration. I shutdown Oracle and entered the following command at the prompt:

tar -xvf /dev/rmt/0m

it seems to be recovering, but one question....

in the output to screen I see the following....

x opt/oracle1/IRDS/archives/arch.log1_2939.dbf, 10486784 bytes, 20482 tape blocks

What is that "x" at the beginning of the line? What does it indicate?

This is the first time I'm attempting to recover information from a tape on UNIX.

Thanks
Victor BERRIDGE
Honored Contributor

Re: Restore Backup From Tape

Hi Adrian,
It just saying Its eXtracted the file to disk...


Nothing to worry about

All the best
Victor
Adrian Sobers2
Super Advisor

Re: Restore Backup From Tape

Ok I restored the database but when I tried to open it I got an error saying that file 16 needs media recovery. I tried to then recover the file but ran into some problems. Does anyone know about this HP-UX error? 9: Bad File number?

My situation looking bleak here...

=============================================

SVRMGR> ALTER DATABASE RECOVER AUTOMATIC DATAFILE '/opt/oracle3/oradata/IRDS/assessdata01.dbf';
ALTER DATABASE RECOVER AUTOMATIC DATAFILE '/opt/oracle3/oradata/IRDS/assessdata01.dbf'
*
ORA-00283: recovery session canceled due to errors
ORA-01114: IO error writing block to file 16 (block # 1)
ORA-01110: data file 16: '/opt/oracle3/oradata/IRDS/assessdata01.dbf'
ORA-27072: skgfdisp: I/O error
HP-UX Error: 9: Bad file number
Additional information: 1
SVRMGR>
Victor BERRIDGE
Honored Contributor

Re: Restore Backup From Tape

Hi Adrian,
I would see if a DBA would help you by verfying all the datafiles (same timestamp?...) and try creating the controlfile again, no space trouble (bdf...)?


All the best
Victor

Adrian Sobers2
Super Advisor

Re: Restore Backup From Tape

uhhhhh...DBA? that would be me...LOL

I am now copying the file in question from the tape to disk now. I got the DB started without the error and will see what happens once the file is completely copied to disk...

Victor BERRIDGE
Honored Contributor

Re: Restore Backup From Tape

I forgot to add:
Check all the restored files to see if owner/group ADN permissions are correct!

Good luck
Victor
Patti Johnson
Respected Contributor

Re: Restore Backup From Tape

Adrian,

Victor is correct about the file permissions being the cause of the HP-UX error 9.

But you should not have gotten the message that the db needs recovery if you did a complete restore from a cold backup.
When you did the db backup did you backup the control files? And restore them to the location in the init.ora?

When you shutdown for a cold backup you should copy all the data files, control files, online redo logs (they will be empty, but it makes recovery easier).

The controlfile contains the last system change# (SCN) for each datafile. If your controlfile does not match your datafile you will get the message that recover is needed and you will be prompted for all the redo logs ( archive log files ) generated since the backup - up to the timestamp on the controlfile. A cold backup should contain the controlfile as well as the .bdf files.

Patti