Jennifer Lin’s Weblog

March 13, 2009

Oracle RMAN – Restore from any Disk Location

Filed under: RMAN — jennyca @ 9:26 pm

RMAN looks for the backupfiles to restore within its catalog and therefore there is no RESTORE DATABASE FROM command. You can circumvent this constraint using the RMAN command CATALOG START WITH .

Oracle DB => RMAN backup Backup Set to default location (configure channel device type disk format ;)

RMAN> catalog start with ;
RMAN restore Backup Set from

Example:

1. Copy the Backup Set Files to any Disk Location

cp /tmp/backup

2. Mount the Database

sqlplus / as sysdba
startup mount;

3. Cleanup RMAN Catalog

rman target /

crosscheck backup;
delete noprompt expired backup of database;
delete noprompt expired backup of controlfile;
delete noprompt expired backup of archivelog all;
list backup;

At this point no backup should be available !

4. Make new Backup Location visible to RMAN Catalog

catalog start with ‘/tmp/backup’;

searching for all files that match the pattern
/tmp/backup

List of Files Unknown to the Database
=====================================
File Name: /tmp/backup/PROD_datafile_14_1.bak
File Name: /tmp/backup/PROD_controlfile_17.bak
File Name: /tmp/backup/PROD_archivelog_16_1.bak
File Name: /tmp/backup/PROD_datafile_15_1.bak

Do you really want to catalog the above files
(enter YES or NO)? yes

List of Cataloged Files
=======================
File Name: /tmp/backup/PROD_datafile_14_1.bak
File Name: /tmp/backup/PROD_controlfile_17.bak
File Name: /tmp/backup/PROD_archivelog_16_1.bak
File Name: /tmp/backup/PROD_datafile_15_1.bak

list backup;

At this point the backup must be available !

5. Restore and Recover the Database

restore database;
recover database;
alter database open;

http://www.akadia.com/

July 6, 2008

RMAN-20202

Filed under: RMAN error — jennyca @ 1:37 pm

Symptoms

RMAN convert returns error:
Starting backup at 07-MAR-06
using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=521 devtype=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 03/07/2006 11:00:38
RMAN-20202: tablespace not found in the recovery catalog
RMAN-06019: could not translate tablespace name “test”

Cause

Tablespace name is not being matched within the database. Name must be entered in uppercase
within single quotes.

Error clearly shows the tablespace is not found.

Solution

To implement the solution, please execute the following steps:

Rather than using:

convert tablespace ‘test’ to platform=’……………….

Use:

convert tablespace ‘TEST’ to platform=’……………….

February 8, 2008

To execute a SQL statement or a PL/SQL stored procedure from within Recovery Manager

Filed under: RMAN — jennyca @ 7:11 pm

If the string that RMAN passes to PL/SQL contains a filename, then the filename must be enclosed in duplicate single quotes and the entire string following the SQL keyword must be enclosed in double quotes. For example, use the following syntax:

 SQL "CREATE TABLESPACE temp1 DATAFILE ''?/oradata/trgt/temp1.dbf'' SIZE 10M
 TEMPORARY";

If you attempt to use single quotes for the string following the SQL keyword or use only one set of single quotes for the filename, then the command fails.

You cannot execute SELECT statements.

This example issues a PL/SQL stored procedure called scott.update_log:

RUN { SQL ' BEGIN scott.update_log; END; '; }

http://www.acs.ilstu.edu/docs/oracle/server.101/b10770/rcmsynta59.htm

Blog at WordPress.com.