Solved

How can i restore a Hot backup?

Posted on 2003-10-29
6
919 Views
Last Modified: 2012-05-04
I am exploring options for database backup and recovery for oracle. I implemented a cold backup and was able to restore it successfully, however i have not been able to restore the Hot Backups i took.
Is there a way i can do this and if so how can i do it?


Thanks.
0
Comment
Question by:dayiku
  • 3
  • 2
6 Comments
 
LVL 23

Expert Comment

by:seazodiac
Comment Utility
All you need to do is turn on the ARCHIVELOG MODE.

in the init.ora file you need to have these lines:

LOG_ARCHIVE_START=true
LOG_ARCHIVE_DEST=</path/to/archivefiles>
LOG_ARCHIVE_FORMAT= %s_%t.arc


Then save your init.ora file and

STARTUP your database in the mount mode.
SQL> STARTUP MOUNT EXCLUSIVE

SQL>ALTER DATABASE ARCHIVELOG;

SQL> shutdown immediate;

do a possible full database backup.
then restart the database
SQL>STARTUP

then your database will start in archivlog mode from now on.

From there,  anytime you want to do a hot backup you can issue.

SQL>alter tablespace <ts_name> begin backup;
SQL>host  cp <datafile_path> <a new location>
SQL>alter tablespace <ts_name> end backup;

that's all. it's advisable to do the hotbackup one tablespace after another.
0
 
LVL 2

Expert Comment

by:Kong
Comment Utility
"however i have not been able to restore the Hot Backups i took."

What kind of restore are you trying to do? Full database restore or point it time? Your cold backup would have restored it to when it was backed up, any changes after would have been lost. Hot backup would cover all changes made after backup (provided you haven't lost the archive logs & unarchived redo logs).

Follow seazodiac's advice on procedure.

0
 

Author Comment

by:dayiku
Comment Utility
I know how to take a hot backup, i am trying to restore it now, can you give me some information on that?
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.

 
LVL 2

Accepted Solution

by:
Kong earned 50 total points
Comment Utility
Media recovery:

- Shutdown your database.
- Rename a datafile eg system.dbf to system.dbf.old
- Startup your database
- It'll complain about datafile #1 missing etc...
- Copy system.dbf from your hot backup to expected directory
- Login as sysdba and execute: recover database;
- You've recovered your datafile, now you can delete system.dbf.old

Point in time recovery:

- Log in as sysdba and execute: archive log list
- Note the value of "Current log sequence" (say 100)
- Execute 10 times: alter system archive log current;
- Create a table foo (col1 number); for verification purposes
- Shutdown your database
- Copy (replace) all datafiles (EXCLUDE CONTROLFILES) in your oradata directory with the ones from the backup (TEMP tablespace can be handled seperately, but for simplicity assume you've backed up TEMP as well)
- Log in as sysdba, executing startup gives similar error to media recovery example, execute: recover database until cancel;
- Keep pressing enter until it asks for archive log you recorded in step 2 (say 100)
- Press control-c or read the message on your screen on how to cancel recovery
- Issue: alter database open resetlogs;
- If all goes well, your database is restored to the point prior to the 10 log switches and table foo should not be there.
- One other thing, your hot backup is almost useless now as you've reset your logs, if you want to recover from the hot backup, it's a bit more involved...

Lots of other fun and interesting hot recovery scenarios available in your "Oracle9i User managed backup & recovery guide", acquaint yourself with it.
0
 

Author Comment

by:dayiku
Comment Utility
Thanks for your help. I am using oracle 8i.
I'll try this now.
0
 
LVL 2

Expert Comment

by:Kong
Comment Utility
No problem. Let us know if you're still having problems.

K
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

Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

743 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

11 Experts available now in Live!

Get 1:1 Help Now