Practice: Complete Recovery in Archivelog Mode

 

This practice covers the steps necessary to perform a complete recovery in archivelog mode using RMAN.

 

 

Assumptions

 

·        You have an Oracle 9i database and it is not running.

·        The database is in archivelog mode.

·        ORACLE_SID is set to the target database.

·        You are not using a recovery catalog.

 

Instructions

 

1.      Connect to RMAN and startup mount the database. 

 

C:\>rman target sys/oracle

 

Recovery Manager: Release 9.0.1.0.0 - Beta

 

(c) Copyright 2001 Oracle Corporation.  All rights reserved.

 

connected to target database (not started)

 

RMAN> startup mount

 

Oracle instance started

database mounted

 

Total System Global Area     202141568 bytes

 

Fixed Size                      282496 bytes

Variable Size                142606336 bytes

Database Buffers              58720256 bytes

Redo Buffers                    532480 bytes

 

 

2.      Restore the database.

 

RMAN> restore database;

 

Starting restore at 04-MAR-03

 

using target database controlfile instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=9 devtype=DISK

channel ORA_DISK_1: starting datafile backupset restore

channel ORA_DISK_1: specifying datafile(s) to restore from backup set

restoring datafile 00001 to C:\ORACLE\ORA91\ORADATA\DB01\SYSTEM01.DBF

restoring datafile 00002 to C:\ORACLE\ORA91\ORADATA\DB01\UNDOTBS01.DBF

restoring datafile 00003 to C:\ORACLE\ORA91\ORADATA\DB01\CWMLITE01.DBF

restoring datafile 00004 to C:\ORACLE\ORA91\ORADATA\DB01\DRSYS01.DBF

restoring datafile 00005 to C:\ORACLE\ORA91\ORADATA\DB01\EXAMPLE01.DBF

restoring datafile 00006 to C:\ORACLE\ORA91\ORADATA\DB01\INDX01.DBF

restoring datafile 00007 to C:\ORACLE\ORA91\ORADATA\DB01\TOOLS01.DBF

restoring datafile 00008 to C:\ORACLE\ORA91\ORADATA\DB01\USERS01.DBF

channel ORA_DISK_1: restored backup piece 1

piece handle=D:\BACKUP\DF_DB01_2.BAK tag=null params=NULL

channel ORA_DISK_1: restore complete

Finished restore at 04-MAR-03

 

 

 

3.      Recover the database.

 

RMAN> recover database;

 

Starting recover at 04-MAR-03

using channel ORA_DISK_1

 

 

 

starting media recovery

media recovery complete

 

 

 

4.      Open the database.

 

RMAN> alter database open;

 

database opened

 

RMAN>

 

 

This completes this practice.

 

 

 

ã Oracle Corporation, 2002

Practice #<number>: <topic title>

Practice: Restoring Datafiles to Different Locations

 

This practice covers the steps necessary to perform a complete recovery in archivelog mode using RMAN and restore datafiles to different locations.

 

 

Assumptions

 

·        You have an Oracle 9i database and it is running.

·        The database is in archivelog mode.

·        ORACLE_SID is set to the target database.

·        You are not using a recovery catalog.

 

Instructions

 

1.      Connect to RMAN and startup mount the database. 

 

C:\>rman target sys/oracle

 

Recovery Manager: Release 9.0.1.0.0 - Beta

 

(c) Copyright 2001 Oracle Corporation.  All rights reserved.

 

connected to target database: DB01 (DBID=1119055895)

 

RMAN> shutdown immediate

 

database closed

database dismounted

Oracle instance shut down

 

RMAN> startup mount

 

connected to target database (not started)

Oracle instance started

database mounted

 

Total System Global Area     202141568 bytes

 

Fixed Size                      282496 bytes

Variable Size                142606336 bytes

Database Buffers              58720256 bytes

Redo Buffers                    532480 bytes

 

RMAN>

 

 

2.      Restore the database moving the system01.dbf datafile to a new location.

 

Note: Since we are renaming a datafile, we have to use the run command so that all operations are done as part of a single operation.

 

RMAN> run{

2> set newname for datafile 1 to 'd:\oradata\system01.dbf';

3> restore database;

4> switch datafile all;

5> recover database;

6> alter database open;}

 

executing command: SET NEWNAME

 

Starting restore at 05-MAR-03

 

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=9 devtype=DISK

channel ORA_DISK_1: starting datafile backupset restore

channel ORA_DISK_1: specifying datafile(s) to restore from backup set

restoring datafile 00001 to D:\ORADATA\SYSTEM01.DBF

restoring datafile 00002 to C:\ORACLE\ORA91\ORADATA\DB01\UNDOTBS01.DBF

restoring datafile 00003 to C:\ORACLE\ORA91\ORADATA\DB01\CWMLITE01.DBF

restoring datafile 00004 to C:\ORACLE\ORA91\ORADATA\DB01\DRSYS01.DBF

restoring datafile 00005 to C:\ORACLE\ORA91\ORADATA\DB01\EXAMPLE01.DBF

restoring datafile 00006 to C:\ORACLE\ORA91\ORADATA\DB01\INDX01.DBF

restoring datafile 00007 to C:\ORACLE\ORA91\ORADATA\DB01\TOOLS01.DBF

restoring datafile 00008 to C:\ORACLE\ORA91\ORADATA\DB01\USERS01.DBF

restoring datafile 00009 to C:\ORACLE\ORA91\ORADATA\DB01\OEM_REPOSITORY.DBF

 

channel ORA_DISK_1: restored backup piece 1

piece handle=D:\BACKUP\DF_DB01_3.BAK tag=null params=NULL

channel ORA_DISK_1: restore complete

Finished restore at 05-MAR-03

 

datafile 1 switched to datafile copy

input datafilecopy recid=51 stamp=487853314 filename=D:\ORADATA\SYSTEM01.DB

F

 

Starting recover at 05-MAR-03

using channel ORA_DISK_1

 

 

 

starting media recovery

media recovery complete

 

Finished recover at 05-MAR-03

 

database opened

 

 

 

This completes this practice.

 

 

 

ã Oracle Corporation, 2002

Practice #<number>: <topic title>

Practice: Relocate and Recover a Tablespace

 

This practice covers the steps necessary to perform a tablespace recovery in archivelog mode using RMAN and restore datafiles to different locations.

 

 

Assumptions

 

·        You have an Oracle 9i database and it is running.

·        The database is in archivelog mode.

·        That the ORACLE_SID is set to the target database.

·        You are not using a recovery catalog.

 

Instructions

 

1.      From RMAN generate a script that will perform a tablespace recovery on the USERS tablespace. 

 

RMAN> run{

2> sql "alter tablespace users offline immediate";

3> restore tablespace users;

4> switch datafile all;

5> recover tablespace users;

6> sql "alter tablespace users online";

7> }

 

sql statement: alter tablespace users offline immediate

 

Starting restore at 05-MAR-03

 

using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backupset restore

channel ORA_DISK_1: specifying datafile(s) to restore from backup set

restoring datafile 00008 to C:\ORACLE\ORA91\ORADATA\DB01\USERS01.DBF

channel ORA_DISK_1: restored backup piece 1

piece handle=D:\BACKUP\DF_DB01_3.BAK tag=null params=NULL

channel ORA_DISK_1: restore complete

Finished restore at 05-MAR-03

 

 

Starting recover at 05-MAR-03

using channel ORA_DISK_1

 

 

 

starting media recovery

media recovery complete

 

Finished recover at 05-MAR-03

 

sql statement: alter tablespace users online

 

 

2.      Restore the tablespace moving the users01.dbf datafile to a new location.

 

RMAN> run{

2> sql "alter tablespace users offline immediate";

3> set newname for datafile 8 to 'C:\ORACLE\ORA91\ORADATA\DB01\users01.dbf'

;

4> restore tablespace users;

5> switch datafile all;

6> recover tablespace users;

7> sql "alter tablespace users online";

8> }

 

sql statement: alter tablespace users offline immediate

 

executing command: SET NEWNAME

 

Starting restore at 05-MAR-03

 

using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backupset restore

channel ORA_DISK_1: specifying datafile(s) to restore from backup set

restoring datafile 00008 to C:\ORACLE\ORA91\ORADATA\DB01\USERS01.DBF

channel ORA_DISK_1: restored backup piece 1

piece handle=D:\BACKUP\DF_DB01_3.BAK tag=null params=NULL

channel ORA_DISK_1: restore complete

Finished restore at 05-MAR-03

 

datafile 8 switched to datafile copy

input datafilecopy recid=41 stamp=487852772 filename=C:\ORACLE\ORA91\ORADAT

A\DB01\USERS01.DBF

 

Starting recover at 05-MAR-03

using channel ORA_DISK_1

 

 

 

starting media recovery

media recovery complete

 

Finished recover at 05-MAR-03

 

sql statement: alter tablespace users online

 

 

 

This completes this practice.

 

 

 

ã Oracle Corporation, 2002

1