Solved

How can i restore a Hot backup?

Posted on 2003-10-29
6
923 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Encryption Decryption in Oracle 12 108
Oracle - Stored Procedure Privilge access 3 39
sql query 9 38
PL SQL Search Across Columns 4 22
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 …
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 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 shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

863 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

18 Experts available now in Live!

Get 1:1 Help Now