24.12.2012 Views

Backing Up Oracle - Computing at Cornell

Backing Up Oracle - Computing at Cornell

Backing Up Oracle - Computing at Cornell

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Archive log backup sets are restored as needed to perform a recovery. They<br />

are restored to the current archive log destin<strong>at</strong>ion as specified in the init.ora<br />

file.<br />

12.3 Recovery examples<br />

In the following sections we provide some examples of recovery using RMAN.<br />

12.3.1 D<strong>at</strong>a file recovery<br />

To test a d<strong>at</strong>afile recovery with RMAN, we performed following steps:<br />

The <strong>Oracle</strong> instance beach was up and running, and a backup of the<br />

d<strong>at</strong>abase was taken.<br />

User scott in a SQL*Plus session connected to beach, cre<strong>at</strong>ed a new table<br />

oops in the USERS tablespace, inserted a row, and committed the changes.<br />

The d<strong>at</strong>abase was shut down with the shutdown immedi<strong>at</strong>e command.<br />

The USERS d<strong>at</strong>a file was destroyed by the command<br />

C:\oracle\orad<strong>at</strong>a\beach>echo hello > users01.dbf<br />

The d<strong>at</strong>abase was started with the startup command, an error was<br />

returned.<br />

The alertlog file of the instance contained the following entries.<br />

Errors in file c:\oracle\admin\beach\bdump\beachDBW0.TRC:<br />

ORA-01157: cannot identify/lock d<strong>at</strong>a file 3 - see DBWR trace file<br />

ORA-01110: d<strong>at</strong>a file 3: 'C:\ORACLE\ORADATA\BEACH\USERS01.DBF'<br />

ORA-27048: skgfifi: file header inform<strong>at</strong>ion is invalid<br />

OSD-04004: invalid file header<br />

Next, we cre<strong>at</strong>ed the following RMAN command file and executed it<br />

RMAN> run {<br />

alloc<strong>at</strong>e channel t1 type 'sbt_tape';<br />

restore d<strong>at</strong>afile 'C:\ORACLE\ORADATA\BEACH\USERS01.DBF';<br />

recover d<strong>at</strong>afile 'C:\ORACLE\ORADATA\BEACH\USERS01.DBF';<br />

release channel t1;<br />

alter d<strong>at</strong>abase open;<br />

}<br />

Chapter 12. Recovering <strong>Oracle</strong> d<strong>at</strong>abases on Windows 2000 191

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!