Tuesday, September 27, 2011

RMAN : Complete database backup and restore example




The primary store for RMAN repository data is always the control file of the target database. The CONTROL_FILE_RECORD_KEEP_TIME initialization parameter controls how long backup records are kept in the control file before those records are re-used to hold information about more recent backups.

SQL> show parameters CONTROL_FILE_RECORD_KEEP_TIME

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time        integer     7 (Days)


C:\Documents and Settings\Administrator>set ORACLE-SID=ORCL

C:\Documents and Settings\Administrator>rman


RMAN> connect target rman/rman

connected to target database: ORCL (DBID=1290314824)

RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 2 days;

using target database control file instead of recovery catalog
new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 2 DAYS;
new RMAN configuration parameters are successfully stored

C:\Documents and Settings\Administrator>set ORACLE-SID=ORCL

C:\Documents and Settings\Administrator>rman

RMAN> connect target rman/rman

connected to target database: ORCL (DBID=1290314824)

This command ensures that RMAN retains three backups of each datafile:

RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 3;

using target database control file instead of recovery catalog
old RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 2 DAYS;
new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO REDUNDANCY 3;
new RMAN configuration parameters are successfully stored

Another copy of the RMAN repository data can also be saved in the recovery catalog.

Configuring Control File Autobackups
The control file can be automatically backed up after each RMAN backup as a way to protect the RMAN repository. The following command configures RMAN to create these control file autobackups:


RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;

new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored

Using a recovery catalog preserves RMAN repository information if the control file is lost, making it much easier to restore and recover following the loss of the control file. (A backup control file may not contain complete information about recent available backups.) The recovery catalog can also store a much more
extensive history of your backups than the control file, due to limits on the number of control file records.
In addition to RMAN repository records, the recovery catalog can also hold RMAN stored scripts, sequences of RMAN commands for common backup tasks. Centralized storage of scripts in the recovery catalog can be more convenient than working with command files.
Except for stored scripts, all of RMAN's features work equally well with or without a recovery catalog.


RMAN> LIST BACKUP OF DATABASE;

List of Backup Sets
===================


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
7       Full    571.29M    DISK        00:00:04     27-SEP-11
        BP Key: 7   Status: AVAILABLE  Compressed: NO  Tag: TAG20110927T145454
        Piece Name: /oradb/app/oracle/flash_recovery_area/DBOLTP2/backupset/2011_09_27/o1_mf_nnndf_TAG20110927T145454_784bjh5b_.bkp
  List of Datafiles in backup set 7
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  2       Full 3420713    27-SEP-11 /oradb/app/oracle/oradata/dboltp/dboltp2/sysaux01.dbf
  3       Full 3420713    27-SEP-11 /oradb/app/oracle/oradata/dboltp/dboltp2/undotbs01.dbf
  4       Full 3420713    27-SEP-11 /oradb/app/oracle/oradata/dboltp/dboltp2/users01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
10      Full    572.41M    DISK        00:00:09     27-SEP-11
        BP Key: 10   Status: AVAILABLE  Compressed: NO  Tag: TAG20110927T150223
        Piece Name: /oradb/app/oracle/flash_recovery_area/DBOLTP2/backupset/2011_09_27/o1_mf_nnndf_TAG20110927T150223_784bykfz_.bkp
  List of Datafiles in backup set 10
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  2       Full 3421495    27-SEP-11 /oradb/app/oracle/oradata/dboltp/dboltp2/sysaux01.dbf
  3       Full 3421495    27-SEP-11 /oradb/app/oracle/oradata/dboltp/dboltp2/undotbs01.dbf
  4       Full 3421495    27-SEP-11 /oradb/app/oracle/oradata/dboltp/dboltp2/users01.dbf




To correlate a channel with a process, run the following query in SQL*Plus while the RMAN job is executing:
SQL> COLUMN CLIENT_INFO FORMAT a30
COLUMN SID FORMAT 999
COLUMN SPID FORMAT 9999
SQL> SQL> SQL> SELECT s.SID, p.SPID, s.CLIENT_INFO FROM V$PROCESS p, V$SESSION s WHERE p.ADDR = s.PADDR AND CLIENT_INFO LIKE 'rman%';
 SID SPID                     CLIENT_INFO
---- ------------------------ ------------------------------
 217 14417924                 rman channel=ORA_DISK_1
 226 11600448                 rman channel=ORA_DISK_2
 235 6226442                  rman channel=ORA_DISK_3
To calculate the progress of an RMAN job, run the following query in SQL*Plus while the RMAN job is executing:
SQL> SELECT SID, SERIAL#, CONTEXT, SOFAR,TOTALWORK,ROUND(SOFAR/TOTALWORK*100,2) "% COMPLETE" FROM V$SESSION_LONGOPS WHERE OPNAME LIKE 'RMAN%' AND OPNAME NOT LIKE '%aggregate%'  AND TOTALWORK != 0 AND SOFAR <> TOTALWORK;  5

no rows selected
Hands on:

Case1:
Created to database instances “ORCL” and “targetdb”.
Created two schemas called SOE and SH  with data on instance ORCL using swinngbench-OEWizard.
Objective: Backing up SOE from “ORCL”  using RMAN and restore it to “targetdb”.
Creating RMAN environment on ORCL:
create tablespace rmants datafile 'C:\ORACLE_HOME\ORADATA\ORCL\rman.dbf' size 50M;
create user rman identified by rman default tablespace rmants quota unlimited on rmants;
grant recovery_catalog_owner, connect, resource to rman;
C:\Documents and Settings\Administrator>rman
Recovery Manager: Release 11.2.0.1.0 - Production on Fri Sep 23 15:00:18 2011

RMAN> CONNECT CATALOG rman/rman
connected to recovery catalog database
RMAN> CREATE CATALOG TABLESPACE rmants;
recovery catalog created
C:\Documents and Settings\Administrator>rman target rman/rman
RMAN> show all;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name ORCL are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'C:\ORACLE_HOME\PRODUCT\11.2.0\DBHOME_1\DATABASE\SNCFORCL.ORA'; # default

I want to play with the tablespace “SOE” for which data file is:
C:\ORACLE_HOME\PRODUCT\11.2.0\DBHOME_1\DATABASE\SOE.DBF

C:\Documents and Settings\Administrator>rman target rman/rman
connected to target database: ORCL (DBID=1290314824)
RMAN> SQL 'ALTER TABLESPACE SOE OFFLINE IMMEDIATE';
using target database control file instead of recovery catalog
sql statement: ALTER TABLESPACE SOE OFFLINE IMMEDIATE
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of sql command on default channel at 09/23/2011 15:59:18
RMAN-11003: failure during parse/execution of SQL statement: ALTER TABLESPACE SOE OFFLINE IMMEDIATE
ORA-01145: offline immediate disallowed unless media recovery enabled


RMAN> SQL 'ALTER TABLESPACE SOE OFFLINE';
using target database control file instead of recovery catalog
sql statement: ALTER TABLESPACE SOE OFFLINE
Use the RMAN CONFIGURE command to configure channels, specifying persistent settings for the channels RMAN should allocate by default if you do not explicitly allocate channels for a particular task. The channels allocated as a result of configured settings are sometimes referred to as automatic channels. If any channels are explicitly allocated then the configured channel settings are ignored.

RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 3;
new RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK PARALLELISM 3 BACKUP TYPE TO BACKUPSET;
new RMAN configuration parameters are successfully stored

RMAN> backup TABLESPACE SOE;

Starting backup at 23-SEP-11
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=9 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=69 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=130 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=C:\ORACLE_HOME\PRODUCT\11.2.0\DBHOME_1\DATABASE\SOE.DBF
channel ORA_DISK_1: starting piece 1 at 23-SEP-11
channel ORA_DISK_1: finished piece 1 at 23-SEP-11
piece handle=C:\ORACLE_HOME\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2011_09_23\O1_MF_NNNDF_TAG20110923T160718_77RRBZL2_.BKP
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
Finished backup at 23-SEP-11

After the backup is complete you have bring the table spaces online either via RMAN or by SQL*PLUS:
ALTER TABLESPACE SOE ONLINE;
ALTER TABLESPACE SOEINDEX ONLINE;

Full DB backup:
Need to take the database in arch log mode. Check the arch log mode:
SQL> archive log list
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     163
Current log sequence           165

SQL> shutdown;
startup mount;
ALTER DATABASE ARCHIVELOG;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> ORACLE instance started.
Database mounted.
SQL>Database altered.
SQL> alter database open;
Database altered.
SQL> archive log list
Database log mode              Archive Mode
RMAN> BACKUP AS COPY DATABASE;
Starting backup at 27-SEP-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=82 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=92 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=101 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/oradb/app/oracle/oradata/dboltp/dboltp2/system01.dbf
channel ORA_DISK_2: starting datafile copy
input datafile file number=00002 name=/oradb/app/oracle/oradata/dboltp/dboltp2/sysaux01.dbf
channel ORA_DISK_3: starting datafile copy
input datafile file number=00006 name=/oradb/app/oracle/oradata/dbdss/dbdss2/soeindex.dbf
output file name=/oradb/app/oracle/flash_recovery_area/DBOLTP2/datafile/o1_mf_soeindex_784b9qtc_.dbf tag=TAG20110927T145119 RECID=1 STAMP=762965483
channel ORA_DISK_3: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_3: starting datafile copy
input datafile file number=00004 name=/oradb/app/oracle/oradata/dboltp/dboltp2/users01.dbf
output file name=/oradb/app/oracle/flash_recovery_area/DBOLTP2/datafile/o1_mf_soe_784bb620_.dbf tag=TAG20110927T145119 RECID=5 STAMP=762965495
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile copy
input datafile file number=00008 name=/oradb/app/oracle/oradata/dboltp/dboltp2/test01.dbf
output file name=/oradb/app/oracle/flash_recovery_area/DBOLTP2/datafile/o1_mf_testts_784bb7o9_.dbf tag=TAG20110927T145119 RECID=6 STAMP=762965495
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=/oradb/app/oracle/flash_recovery_area/DBOLTP2/datafile/o1_mf_undotbs1_784bb6f6_.dbf tag=TAG20110927T145119 RECID=8 STAMP=762965496
channel ORA_DISK_2: datafile copy complete, elapsed time: 00:00:02
channel ORA_DISK_2: starting full datafile backup set
channel ORA_DISK_2: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ORA_DISK_2: starting piece 1 at 27-SEP-11
output file name=/oradb/app/oracle/flash_recovery_area/DBOLTP2/datafile/o1_mf_rmants_784bb833_.dbf tag=TAG20110927T145119 RECID=7 STAMP=762965496
channel ORA_DISK_3: datafile copy complete, elapsed time: 00:00:02
output file name=/oradb/app/oracle/flash_recovery_area/DBOLTP2/controlfile/o1_mf_TAG20110927T145119_784bb8q0_.ctl tag=TAG20110927T145119 RECID=9 STAMP=762965496
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:00
channel ORA_DISK_2: finished piece 1 at 27-SEP-11
piece handle=/oradb/app/oracle/flash_recovery_area/DBOLTP2/backupset/2011_09_27/o1_mf_nnsnf_TAG20110927T145119_784bb8ts_.bkp tag=TAG20110927T145119 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:01
Finished backup at 27-SEP-11

RMAN> BACKUP AS BACKUPSET DATABASE;
Starting backup at 27-SEP-11
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00002 name=/oradb/app/oracle/oradata/dboltp/dboltp2/sysaux01.dbf
input datafile file number=00003 name=/oradb/app/oracle/oradata/dboltp/dboltp2/undotbs01.dbf
input datafile file number=00004 name=/oradb/app/oracle/oradata/dboltp/dboltp2/users01.dbf

RMAN> BACKUP VALIDATE DATABASE ARCHIVELOG ALL;

Starting backup at 27-SEP-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=38 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=47 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=57 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00002 name=/oradb/app/oracle/oradata/dboltp/dboltp2/sysaux01.dbf
input datafile file number=00003 name=/oradb/app/oracle/oradata/dboltp/dboltp2/undotbs01.dbf
input datafile file number=00004 name=/oradb/app/oracle/oradata/dboltp/dboltp2/users01.dbf
channel ORA_DISK_2: starting full datafile backup set
channel ORA_DISK_2: specifying datafile(s) in backup set
input datafile file number=00006 name=/oradb/app/oracle/oradata/dbdss/dbdss2/soeindex.dbf
input datafile file number=00005 name=/oradb/app/oracle/oradata/dbdss/dbdss2/soe.dbf
channel ORA_DISK_3: starting full datafile backup set
channel ORA_DISK_3: specifying datafile(s) in backup set
input datafile file number=00001 name=/oradb/app/oracle/oradata/dboltp/dboltp2/system01.dbf
input datafile file number=00007 name=/oradb/app/oracle/oradata/dboltp/RMANDATA/rman.dbf
input datafile file number=00008 name=/oradb/app/oracle/oradata/dboltp/dboltp2/test01.dbf
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
List of Datafiles
=================
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
2    OK     0              19844        89613           3443113
  File Name: /oradb/app/oracle/oradata/dboltp/dboltp2/sysaux01.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              23238
  Index      0              19876
  Other      0              26642

File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
3    OK     0              156          30080           3443113
  File Name: /oradb/app/oracle/oradata/dboltp/dboltp2/undotbs01.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              0
  Index      0              0
  Other      0              29924

File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
4    OK     0              4754         49280           1570477
  File Name: /oradb/app/oracle/oradata/dboltp/dboltp2/users01.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              27075
  Index      0              16068
  Other      0              1383

channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=165 RECID=1 STAMP=762965693
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:01
List of Datafiles
=================
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
5    OK     0              14358        43520           2398370
  File Name: /oradb/app/oracle/oradata/dbdss/dbdss2/soe.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              27960
  Index      0              19
  Other      0              1183

File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
6    OK     0              16452        87040           2397624
  File Name: /oradb/app/oracle/oradata/dbdss/dbdss2/soeindex.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              0
  Index      0              68601
  Other      0              1987

channel ORA_DISK_2: starting archived log backup set
channel ORA_DISK_2: specifying archived log(s) in backup set
input archived log thread=1 sequence=166 RECID=2 STAMP=762967599
channel ORA_DISK_3: backup set complete, elapsed time: 00:00:01
List of Datafiles
=================
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
1    OK     0              14708        90882           3443107
  File Name: /oradb/app/oracle/oradata/dboltp/dboltp2/system01.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              60910
  Index      0              12675
  Other      0              2587

File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
7    OK     0              6229         6400            3345568
  File Name: /oradb/app/oracle/oradata/dboltp/RMANDATA/rman.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              30
  Index      0              1
  Other      0              140

File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
8    OK     0              148          2560            3353310
  File Name: /oradb/app/oracle/oradata/dboltp/dboltp2/test01.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              2238
  Index      0              0
  Other      0              174

channel ORA_DISK_3: starting full datafile backup set
channel ORA_DISK_3: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:00
List of Archived Logs
=====================
Thrd Seq     Status Blocks Failing Blocks Examined Name
---- ------- ------ -------------- --------------- ---------------
1    165     OK     0              55751           /oradb/app/oracle/flash_recovery_area/DBOLTP2/archivelog/2011_09_27/o1_mf_1_165_784bjfls_.arc
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:00
List of Archived Logs
=====================
Thrd Seq     Status Blocks Failing Blocks Examined Name
---- ------- ------ -------------- --------------- ---------------
1    166     OK     0              6490            /oradb/app/oracle/flash_recovery_area/DBOLTP2/archivelog/2011_09_27/o1_mf_1_166_784dcz1s_.arc
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:00
List of Control File and SPFILE
===============================
File Type    Status Blocks Failing Blocks Examined
------------ ------ -------------- ---------------
SPFILE       OK     0              2
channel ORA_DISK_3: backup set complete, elapsed time: 00:00:00
List of Control File and SPFILE
===============================
File Type    Status Blocks Failing Blocks Examined
------------ ------ -------------- ---------------
Control File OK     0              470
Finished backup at 27-SEP-11



RESTORE EXAMPLES
I shutdown the database  then from the database dboltp2 I took a datafile : “/oradb/app/oracle/oradata/dbdss/dbdss2/soe.dbf
Then I corrupted that file as
1. ls l > /oradb/app/oracle/oradata/dbdss/dbdss2/soe.dbf
2. Another time mv /oradb/app/oracle/oradata/dbdss/dbdss2/soe.dbf / oradb/app/oracle/oradata/dbdss/dbdss2/x
Then while I tried to start the db got the error below:
ORA-01157: cannot identify/lock data file 5 - see DBWR trace file
ORA-01110: data file 5: '/oradb/app/oracle/oradata/dbdss/dbdss2/soe.dbf'

RMAN> connect target rman/rman
connected to target database: DBOLTP2 (DBID=4034393997, not open)
RMAN> STARTUP FORCE MOUNT;

Oracle instance started
database mounted
RMAN> RESTORE DATABASE;
Starting restore at 27-SEP-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=217 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=226 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=235 device type=DISK
channel ORA_DISK_1: restoring datafile 00001
input datafile copy RECID=3 STAMP=762965491 file name=/oradb/app/oracle/flash_recovery_area/DBOLTP2/datafile/o1_mf_system_784b9qs7_.dbf
destination for restore of datafile 00001: /oradb/app/oracle/oradata/dboltp/dboltp2/system01.dbf
channel ORA_DISK_2: starting datafile backup set restore
channel ORA_DISK_2: specifying datafile(s) to restore from backup set
channel ORA_DISK_2: restoring datafile 00002 to /oradb/app/oracle/oradata/dboltp/dboltp2/sysaux01.dbf
channel ORA_DISK_2: restoring datafile 00003 to /oradb/app/oracle/oradata/dboltp/dboltp2/undotbs01.dbf
channel ORA_DISK_2: restoring datafile 00004 to /oradb/app/oracle/oradata/dboltp/dboltp2/users01.dbf
channel ORA_DISK_2: reading from backup piece /oradb/app/oracle/flash_recovery_area/DBOLTP2/backupset/2011_09_27/o1_mf_nnndf_TAG20110927T150223_784bykfz_.bkp
channel ORA_DISK_3: restoring datafile 00005
input datafile copy RECID=5 STAMP=762965495 file name=/oradb/app/oracle/flash_recovery_area/DBOLTP2/datafile/o1_mf_soe_784bb620_.dbf
destination for restore of datafile 00005: /oradb/app/oracle/oradata/dbdss/dbdss2/soe.dbf
1_mf_nnndf_TAG20110927T150223_784bykfz_.bkp tag=TAG20110927T150223
channel ORA_DISK_2: restored backup piece 1
channel ORA_DISK_2: restore complete, elapsed time: 00:00:14
channel ORA_DISK_3: copied datafile copy of datafile 00007
output file name=/oradb/app/oracle/oradata/dboltp/RMANDATA/rman.dbf RECID=0 STAMP=0
channel ORA_DISK_1: copied datafile copy of datafile 00008
output file name=/oradb/app/oracle/oradata/dboltp/dboltp2/test01.dbf RECID=0 STAMP=0
Finished restore at 27-SEP-11
RMAN> RECOVER DATABASE;
Starting recover at 27-SEP-11
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
starting media recovery
media recovery complete, elapsed time: 00:00:02
Finished recover at 27-SEP-11
RMAN> ALTER DATABASE OPEN;
database opened
You can go and check in the location that physical file has been re copied by RMAN.


RMAN Errors:
1. RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup plus archivelog command at 09/27/2011 14:54:59

RMAN-03009: failure of backup command on ORA_DISK_2 channel at 09/27/2011 14:54:58
ORA-19809: limit exceeded for recovery files
ORA-19804: cannot reclaim 52428800 bytes disk space from 4039114752 limit
RMAN-03009: failure of backup command on ORA_DISK_3 channel at 09/27/2011 14:54:56
ORA-19809: limit exceeded for recovery files
ORA-19804: cannot reclaim 52428800 bytes disk space from 4039114752 limit




Solution:
SQL> show parameter db_recovery_file_dest_size
NAME                                 TYPE        VALUE
------------------------------------ ----------- -----------------------------
db_recovery_file_dest_size           big integer 3852M

SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE=16156459008 SCOPE=BOTH;
System altered.
SQL> shutdown abort;
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.
SQL> show parameter db_recovery_file_dest_size

NAME                                 TYPE        VALUE
------------------------------------ ----------- -----------------------------
db_recovery_file_dest_size           big integer 15408M

No comments:

Post a Comment