Solved

How can i restore a Hot backup?

Posted on 2003-10-29
6
930 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
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.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.
Suggested Courses

627 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