Solved

How can i restore a Hot backup?

Posted on 2003-10-29
6
926 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
ID: 9646111
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
ID: 9646851
"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
ID: 9649742
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
ID: 9654231
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
ID: 9657365
Thanks for your help. I am using oracle 8i.
I'll try this now.
0
 
LVL 2

Expert Comment

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

K
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
join 2 views with 5 conditions 3 61
selective queries 7 38
oracle sqlplus query delimiter 8 24
plsql job on oracle 18 41
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…
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

821 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