Solved

How can i restore a Hot backup?

Posted on 2003-10-29
6
928 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

738 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