Friday, May 30, 2014

Validate current controlfile

1. Validate current controlfile
 validate current controlfile;

2.Ouput of the script output
RMAN> validate current controlfile;

Starting validate at 30-05-2014 05:18:54
using channel ORA_DISK_1
using channel ORA_DISK_2
channel ORA_DISK_1: starting validation of datafile
channel ORA_DISK_1: specifying datafile(s) for validation
including current control file for validation
channel ORA_DISK_1: validation complete, elapsed time: 00:00:01
List of Control File and SPFILE
===============================
File Type    Status Blocks Failing Blocks Examined
------------ ------ -------------- ---------------
Control File OK     0              638
Finished validate at 30-05-2014 05:19:01

Wednesday, May 28, 2014

Replace RMAN Script

(1) Edit or replace the script stored in the recovery catalog using replace script command
RMAN> print script l_bkp_archivelog_like;

printing stored script: l_bkp_archivelog_like
{
backup
archivelog like '+DATA/cvrman/archivelog/2014_05_28/thread_1_seq_%'
tag 'bkp_archivelog_like';
}

RMAN> replace script l_bkp_archivelog_like
2> {
3> backup
4> archivelog like '+DATA/cvrman/archivelog/2014_05_28/thread_1_seq_%'
5> tag 'bkp_archivelog_like'
6> delete all input;
7> }


Configure channel using net service name

1.Script to configure channel using net service name
run
{
allocate channel c2 device type disk
connect 'sys/sys123@CVRMAN';
backup tablespace users;
}

 run
2> {
3> allocate channel c2 device type disk
4> connect 'sys/sys123@CVRMAN';
5> backup tablespace users;
6> }

allocated channel: c2
channel c2: SID=58 device type=DISK

Starting backup at 28-MAY-14
channel c2: starting compressed full datafile backup set
channel c2: specifying datafile(s) in backup set
input datafile file number=00004 name=+DATA/cvrman/datafile/users.259.847354795
channel c2: starting piece 1 at 28-MAY-14
channel c2: finished piece 1 at 28-MAY-14
piece handle=+DATA/cvrman/backupset/2014_05_28/nnndf0_tag20140528t110852_0.409.848747337 tag=TAG20140528T110852 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:07
Finished backup at 28-MAY-14
released channel: c2


Create global rman script

1.Create global script in the catalog database
rman target / catalog="rcat_owner/rcat_owner@cvrcat"

Recovery Manager: Release 11.2.0.4.0 - Production on Wed May 28 03:56:51 2014

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: CVRMAN (DBID=657566608)
connected to recovery catalog database

RMAN> create global script g_bkp_database
2> {
3> backup database
4> tag="bkp_database";
5> }

created global script g_bkp_database

2.Print the global script
RMAN> print global script g_bkp_database;

printing stored global script: g_bkp_database
{
backup database
tag="bkp_database";
}

3.Run the script
RMAN> run
2> {
3> execute script g_bkp_database;
4> }

executing global script: g_bkp_database

Starting backup at 28-MAY-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=23 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=28 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=59 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=53 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=27 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=00001 name=+DATA/cvrman/datafile/system.256.847354793
channel ORA_DISK_1: starting piece 1 at 28-MAY-14
channel ORA_DISK_2: starting full datafile backup set
channel ORA_DISK_2: specifying datafile(s) in backup set
input datafile file number=00002 name=+DATA/cvrman/datafile/sysaux.257.847354793
input datafile file number=00004 name=+DATA/cvrman/datafile/users.259.847354795
channel ORA_DISK_2: starting piece 1 at 28-MAY-14
channel ORA_DISK_3: starting full datafile backup set
channel ORA_DISK_3: specifying datafile(s) in backup set
input datafile file number=00005 name=+DATA/cvrman/datafile/example_new.dbf
input datafile file number=00006 name=+DATA/cvrman/datafile/tbs1_new.dbf
channel ORA_DISK_3: starting piece 1 at 28-MAY-14
channel ORA_DISK_4: starting full datafile backup set
channel ORA_DISK_4: specifying datafile(s) in backup set
input datafile file number=00003 name=+DATA/cvrman/datafile/undotbs1.318.848201233
input datafile file number=00007 name=+DATA/cvrman/datafile/tbs2.328.848469625
channel ORA_DISK_4: starting piece 1 at 28-MAY-14
channel ORA_DISK_4: finished piece 1 at 28-MAY-14
piece handle=+DATA/cvrman/backupset/2014_05_28/nnndf0_bkp_database_0.344.848723355 tag=BKP_DATABASE comment=NONE
channel ORA_DISK_4: backup set complete, elapsed time: 00:00:26
channel ORA_DISK_3: finished piece 1 at 28-MAY-14
piece handle=+DATA/cvrman/backupset/2014_05_28/nnndf0_bkp_database_0.370.848723351 tag=BKP_DATABASE comment=NONE
channel ORA_DISK_3: backup set complete, elapsed time: 00:01:17
channel ORA_DISK_1: finished piece 1 at 28-MAY-14
piece handle=+DATA/cvrman/backupset/2014_05_28/nnndf0_bkp_database_0.372.848723351 tag=BKP_DATABASE comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:28
channel ORA_DISK_2: finished piece 1 at 28-MAY-14
piece handle=+DATA/cvrman/backupset/2014_05_28/nnndf0_bkp_database_0.371.848723351 tag=BKP_DATABASE comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:01:48
Finished backup at 28-MAY-14

Starting Control File and SPFILE Autobackup at 28-MAY-14
piece handle=+DATA/cvrman/autobackup/2014_05_28/s_848723459.308.848723461 comment=NONE
Finished Control File and SPFILE Autobackup at 28-MAY-14

Recovery Catalog Setup

1.Connect to the recovery catalog database
 . oraenv
ORACLE_SID = [CVRCAT] ? CVRCAT
The Oracle base remains unchanged with value /u01/app/oracle
$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Wed May 28 03:05:36 2014

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

SQL>


2.Create the user , tablespace and their privileges to be used as recovery catalog owner
SQL> create tablespace rcat_tbs datafile '+DATA' SIZE 100M AUTOEXTEND ON;

Tablespace created.

SQL> create user rcat_owner identified by rcat_owner default tablespace rcat_tbs quota unlimited on rcat_tbs;

User created.

SQL> grant recovery_catalog_owner to rcat_owner;

Grant succeeded.

SQL> exit;
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
3.Connect as catalog owner and create catalog
 rman catalog="rcat_owner/rcat_owner@cvrcat"

Recovery Manager: Release 11.2.0.4.0 - Production on Wed May 28 03:34:47 2014

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to recovery catalog database

RMAN> create catalog;
recovery catalog created

4. Register the database to the recovery catalog database
 export ORACLE_SID=CVRMAN
$ rman target / catalog="rcat_owner/rcat_owner@cvrcat"

Recovery Manager: Release 11.2.0.4.0 - Production on Wed May 28 03:42:27 2014

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: CVRMAN (DBID=657566608)
connected to recovery catalog database

RMAN> register database;

database registered in recovery catalog
starting full resync of recovery catalog
full resync complete

Tuesday, May 27, 2014

Recovering to Previous Incarnation

1.shutdown the target database
RMAN> shutdown immediate;

database closed
database dismounted
Oracle instance shut down
2.Script to reset the database to previous incarnation
startup nomount;
restore controlfile from autobackup until time "to_date('26-05-2014 06:35:10','dd-mm-yyyy hh24:mi:ss')";
alter database mount;
list incarnation of database;
reset database to incarnation 7; 

3.Ouput of script to reset the database to previous incarnation
RMAN> @ ./rman/rman_reset_db_prev_incr.cmd

RMAN> startup nomount;
connected to target database (not started)
Oracle instance started

Total System Global Area     730714112 bytes

Fixed Size                     2256832 bytes
Variable Size                452984896 bytes
Database Buffers             272629760 bytes
Redo Buffers                   2842624 bytes

RMAN> restore controlfile from autobackup until time "to_date('26-05-2014 06:35:10','dd-mm-yyyy hh24:mi:ss')";
Starting restore at 27-05-2014 12:36:16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=23 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=26 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=24 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=27 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=28 device type=DISK

recovery area destination: +DATA
database name (or database unique name) used for search: CVRMAN
channel ORA_DISK_2: AUTOBACKUP +data/CVRMAN/AUTOBACKUP/2014_05_25/s_848470395.297.848470397 found in the recovery area
channel ORA_DISK_2: looking for AUTOBACKUP on day: 20140526
channel ORA_DISK_2: looking for AUTOBACKUP on day: 20140525
recovery area destination: +DATA
database name (or database unique name) used for search: CVRMAN
channel ORA_DISK_3: AUTOBACKUP +data/CVRMAN/AUTOBACKUP/2014_05_25/s_848470395.297.848470397 found in the recovery area
channel ORA_DISK_3: looking for AUTOBACKUP on day: 20140526
channel ORA_DISK_3: looking for AUTOBACKUP on day: 20140525
channel ORA_DISK_3: skipped, AUTOBACKUP already found
recovery area destination: +DATA
database name (or database unique name) used for search: CVRMAN
channel ORA_DISK_5: AUTOBACKUP +data/CVRMAN/AUTOBACKUP/2014_05_25/s_848470395.297.848470397 found in the recovery area
channel ORA_DISK_5: looking for AUTOBACKUP on day: 20140526
channel ORA_DISK_5: looking for AUTOBACKUP on day: 20140525
channel ORA_DISK_5: skipped, AUTOBACKUP already found
recovery area destination: +DATA
database name (or database unique name) used for search: CVRMAN
channel ORA_DISK_1: AUTOBACKUP +data/CVRMAN/AUTOBACKUP/2014_05_25/s_848470395.297.848470397 found in the recovery area
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20140526
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20140525
channel ORA_DISK_1: skipped, AUTOBACKUP already found
recovery area destination: +DATA
database name (or database unique name) used for search: CVRMAN
channel ORA_DISK_4: AUTOBACKUP +data/CVRMAN/AUTOBACKUP/2014_05_25/s_848470395.297.848470397 found in the recovery area
channel ORA_DISK_4: looking for AUTOBACKUP on day: 20140526
channel ORA_DISK_4: looking for AUTOBACKUP on day: 20140525
channel ORA_DISK_4: skipped, AUTOBACKUP already found
channel ORA_DISK_2: restoring control file from AUTOBACKUP +data/CVRMAN/AUTOBACKUP/2014_05_25/s_848470395.297.848470397
channel ORA_DISK_2: control file restore from AUTOBACKUP complete
output file name=+DATA/cvrman/controlfile/current.307.847862851
output file name=+DATA/cvrman/controlfile/current.275.847862853
Finished restore at 27-05-2014 12:36:39

RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
released channel: ORA_DISK_2
released channel: ORA_DISK_3
released channel: ORA_DISK_4
released channel: ORA_DISK_5

RMAN> list incarnation of database;

List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1       1       CVRMAN   657566608        PARENT  1          24-08-2013 11:37:30
2       2       CVRMAN   657566608        PARENT  925702     12-05-2014 08:28:06
3       3       CVRMAN   657566608        PARENT  1014824    13-05-2014 07:00:00
4       4       CVRMAN   657566608        PARENT  1089078    14-05-2014 10:10:49
5       5       CVRMAN   657566608        PARENT  1218607    17-05-2014 03:35:32
6       6       CVRMAN   657566608        PARENT  1285008    18-05-2014 05:29:56
7       7       CVRMAN   657566608        CURRENT 1517897    25-05-2014 04:52:38

reset database to incarnation 7;

database reset to incarnation 7

RMAN> **end-of-file**

4.Script to recover the database
run
{
set until time ="to_date('26-05-2014 06:35:10','dd-mm-yyyy hh24:mi:ss')";
restore database;
recover database;
sql "alter database open resetlogs";
}

5.Output of script execution to recover the database at particular time
RMAN> @ ./rman/rman_reset_db_prev_incr_2.cmd

RMAN> run
2> {
3> set until time ="to_date('26-05-2014 06:35:10','dd-mm-yyyy hh24:mi:ss')";
4> restore database;
5> recover database;
6> sql "alter database open resetlogs";
7> }
executing command: SET until clause

Starting restore at 27-05-2014 12:41:32
Starting implicit crosscheck backup at 27-05-2014 12:41:32
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=28 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=27 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=24 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=26 device type=DISK
Crosschecked 14 objects
Crosschecked 17 objects
Finished implicit crosscheck backup at 27-05-2014 12:41:50

Starting implicit crosscheck copy at 27-05-2014 12:41:50
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5
Crosschecked 8 objects
Finished implicit crosscheck copy at 27-05-2014 12:41:54

searching for all files in the recovery area
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: +data/CVRMAN/AUTOBACKUP/2014_05_22/s_848234751.333.848234751
File Name: +data/CVRMAN/AUTOBACKUP/2014_05_26/s_848558156.273.848558159
File Name: +data/CVRMAN/AUTOBACKUP/2014_05_26/s_848563392.327.848563395
File Name: +data/CVRMAN/AUTOBACKUP/2014_05_26/s_848563796.306.848563797
File Name: +data/CVRMAN/AUTOBACKUP/2014_05_26/s_848572162.352.848572165
File Name: +data/CVRMAN/AUTOBACKUP/2014_05_26/s_848578992.322.848578995
File Name: +data/CVRMAN/AUTOBACKUP/2014_05_18/s_847859913.339.847859915
File Name: +data/CVRMAN/AUTOBACKUP/2014_05_16/s_847715018.261.847715019
File Name: +data/CVRMAN/AUTOBACKUP/2014_05_25/s_848470395.297.848470397
File Name: +data/CVRMAN/ARCHIVELOG/2014_05_27/thread_1_seq_2.291.848642459
File Name: +data/CVRMAN/ARCHIVELOG/2014_05_26/thread_1_seq_7.337.848558117
File Name: +data/CVRMAN/ARCHIVELOG/2014_05_26/thread_1_seq_8.347.848558119
File Name: +data/CVRMAN/ARCHIVELOG/2014_05_26/thread_1_seq_6.329.848558119
File Name: +data/CVRMAN/ARCHIVELOG/2014_05_26/thread_1_seq_1.340.848560257
File Name: +data/CVRMAN/ARCHIVELOG/2014_05_26/thread_1_seq_2.338.848560891
File Name: +data/CVRMAN/ARCHIVELOG/2014_05_26/thread_1_seq_3.324.848560897
File Name: +data/CVRMAN/ARCHIVELOG/2014_05_26/thread_1_seq_4.341.848560897
File Name: +data/CVRMAN/ARCHIVELOG/2014_05_26/thread_1_seq_5.285.848561997
File Name: +data/CVRMAN/ARCHIVELOG/2014_05_26/thread_1_seq_4.298.848563339
File Name: +data/CVRMAN/ARCHIVELOG/2014_05_26/thread_1_seq_5.260.848563339
File Name: +data/CVRMAN/ARCHIVELOG/2014_05_26/thread_1_seq_6.276.848563339
File Name: +data/CVRMAN/ARCHIVELOG/2014_05_26/thread_1_seq_1.326.848571335
File Name: +data/CVRMAN/ARCHIVELOG/2014_05_26/thread_1_seq_2.343.848571337
File Name: +data/CVRMAN/ARCHIVELOG/2014_05_26/thread_1_seq_3.345.848571341
File Name: +data/CVRMAN/ARCHIVELOG/2014_05_26/thread_1_seq_4.282.848571519
File Name: +data/CVRMAN/ARCHIVELOG/2014_05_26/thread_1_seq_5.346.848571521
File Name: +data/CVRMAN/ARCHIVELOG/2014_05_26/thread_1_seq_6.348.848571521
File Name: +data/CVRMAN/ARCHIVELOG/2014_05_26/thread_1_seq_7.349.848572129
File Name: +data/CVRMAN/ARCHIVELOG/2014_05_26/thread_1_seq_5.350.848572129
File Name: +data/CVRMAN/ARCHIVELOG/2014_05_26/thread_1_seq_6.351.848572129
File Name: +data/CVRMAN/ARCHIVELOG/2014_05_26/thread_1_seq_1.353.848573413
File Name: +data/CVRMAN/ARCHIVELOG/2014_05_26/thread_1_seq_2.354.848573415
File Name: +data/CVRMAN/ARCHIVELOG/2014_05_26/thread_1_seq_1.314.848613647
File Name: +data/CVRMAN/ARCHIVELOG/2014_05_25/thread_1_seq_3.309.848480471
File Name: +data/CVRMAN/ARCHIVELOG/2014_05_25/thread_1_seq_4.280.848480485
File Name: +data/CVRMAN/ARCHIVELOG/2014_05_25/thread_1_seq_5.286.848480517
File Name: +data/CVRMAN/ARCHIVELOG/2014_05_25/thread_1_seq_6.281.848513485
File Name: +data/CVRMAN/ARCHIVELOG/2014_05_25/thread_1_seq_7.334.848527963
File Name: +data/CVRMAN/DATAFILE/tbs2.bkp

using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5

skipping datafile 4; already restored to file +DATA/cvrman/datafile/users.259.847354795
skipping datafile 5; already restored to file +DATA/cvrman/datafile/example_new.dbf
channel ORA_DISK_1: restoring datafile 00006
input datafile copy RECID=83 STAMP=848217961 file name=+DATA/cvrman/datafile/tbs1.294.847433665
destination for restore of datafile 00006: +DATA/cvrman/datafile/tbs1_new.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 00003 to +DATA/cvrman/datafile/undotbs1.318.848201233
channel ORA_DISK_2: reading from backup piece +DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.290.848207929
channel ORA_DISK_3: starting datafile backup set restore
channel ORA_DISK_3: specifying datafile(s) to restore from backup set
channel ORA_DISK_3: restoring datafile 00002 to +DATA/cvrman/datafile/sysaux.257.847354793
channel ORA_DISK_3: reading from backup piece +DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.287.848207921
channel ORA_DISK_4: starting datafile backup set restore
channel ORA_DISK_4: specifying datafile(s) to restore from backup set
channel ORA_DISK_4: restoring datafile 00001 to +DATA/cvrman/datafile/system.256.847354793
channel ORA_DISK_4: reading from backup piece +DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.313.848207917
channel ORA_DISK_5: restoring datafile 00007
input datafile copy RECID=88 STAMP=848666518 file name=+DATA/cvrman/datafile/tbs2.bkp
destination for restore of datafile 00007: +DATA/cvrman/datafile/tbs2.328.848469625
channel ORA_DISK_1: copied datafile copy of datafile 00006
output file name=+DATA/cvrman/datafile/tbs1_new.dbf RECID=0 STAMP=0
channel ORA_DISK_2: piece handle=+DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.290.848207929 tag=TAG20140522T051830
channel ORA_DISK_2: restored backup piece 1
channel ORA_DISK_2: restore complete, elapsed time: 00:00:17
channel ORA_DISK_5: copied datafile copy of datafile 00007
output file name=+DATA/cvrman/datafile/tbs2.328.848469625 RECID=0 STAMP=0
channel ORA_DISK_3: piece handle=+DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.287.848207921 tag=TAG20140522T051830
channel ORA_DISK_3: restored backup piece 1
channel ORA_DISK_3: restore complete, elapsed time: 00:01:07
channel ORA_DISK_4: piece handle=+DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.313.848207917 tag=TAG20140522T051830
channel ORA_DISK_4: restored backup piece 1
channel ORA_DISK_4: restore complete, elapsed time: 00:01:16
Finished restore at 27-05-2014 12:43:21

Starting recover at 27-05-2014 12:43:22
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5
datafile 4 not processed because file is read-only
datafile 5 not processed because file is read-only

starting media recovery

archived log for thread 1 with sequence 8 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_8.319.848465559
archived log for thread 1 with sequence 9 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_9.320.848465561
archived log for thread 1 with sequence 10 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_10.317.848465559
archived log for thread 1 with sequence 1 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_1.325.848467105
archived log for thread 1 with sequence 2 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_2.301.848469759
archived log for thread 1 with sequence 3 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_3.309.848480471
archived log for thread 1 with sequence 4 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_4.280.848480485
archived log for thread 1 with sequence 5 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_5.286.848480517
archived log for thread 1 with sequence 6 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_6.281.848513485
archived log for thread 1 with sequence 7 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_7.334.848527963
archived log for thread 1 with sequence 8 is already on disk as file +DATA/cvrman/archivelog/2014_05_26/thread_1_seq_8.347.848558119
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_8.319.848465559 thread=1 sequence=8
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_9.320.848465561 thread=1 sequence=9
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_10.317.848465559 thread=1 sequence=10
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_1.325.848467105 thread=1 sequence=1
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_2.301.848469759 thread=1 sequence=2
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_3.309.848480471 thread=1 sequence=3
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_4.280.848480485 thread=1 sequence=4
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_5.286.848480517 thread=1 sequence=5
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_6.281.848513485 thread=1 sequence=6
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_7.334.848527963 thread=1 sequence=7
archived log file name=+DATA/cvrman/archivelog/2014_05_26/thread_1_seq_8.347.848558119 thread=1 sequence=8
media recovery complete, elapsed time: 00:01:15
Finished recover at 27-05-2014 12:44:44

sql statement: alter database open resetlogs

RMAN> **end-of-file**

Monday, May 26, 2014

Perform RMAN Incomplete recovery using restore point

(1) Script to perform RMAN incomplete recovery using restore point
run
{
startup mount;
set until restore point P2_1543007;
restore database;
recover database parallel;
sql "alter database open resetlogs";
}

(2)Ouput of execution of the script
RMAN> shutdown immediate;

database closed
database dismounted
Oracle instance shut down

RMAN> @ ./rman/rman_incomplete_recovery_time.cmd

RMAN> run
2> {
3> startup mount ;
4> set until restore point  P2_1543007;
5> restore database;
6> recover database parallel;
7> sql "alter database open resetlogs";
8> }
connected to target database (not started)
Oracle instance started
database mounted

Total System Global Area     730714112 bytes

Fixed Size                     2256832 bytes
Variable Size                452984896 bytes
Database Buffers             272629760 bytes
Redo Buffers                   2842624 bytes

executing command: SET until clause

Starting restore at 26-MAY-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=21 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=27 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=28 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=29 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=30 device type=DISK
flashing back control file to SCN 1543047

skipping datafile 4; already restored to file +DATA/cvrman/datafile/users.259.847354795
skipping datafile 5; already restored to file +DATA/cvrman/datafile/example_new.dbf
creating datafile file number=7 name=+DATA/cvrman/datafile/tbs2.328.848469625
channel ORA_DISK_1: restoring datafile 00006
input datafile copy RECID=83 STAMP=848217961 file name=+DATA/cvrman/datafile/tbs1.294.847433665
destination for restore of datafile 00006: +DATA/cvrman/datafile/tbs1_new.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 00003 to +DATA/cvrman/datafile/undotbs1.318.848201233
channel ORA_DISK_2: reading from backup piece +DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.290.848207929
channel ORA_DISK_3: starting datafile backup set restore
channel ORA_DISK_3: specifying datafile(s) to restore from backup set
channel ORA_DISK_3: restoring datafile 00002 to +DATA/cvrman/datafile/sysaux.257.847354793
channel ORA_DISK_3: reading from backup piece +DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.287.848207921
channel ORA_DISK_4: starting datafile backup set restore
channel ORA_DISK_4: specifying datafile(s) to restore from backup set
channel ORA_DISK_4: restoring datafile 00001 to +DATA/cvrman/datafile/system.256.847354793
channel ORA_DISK_4: reading from backup piece +DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.313.848207917
channel ORA_DISK_1: copied datafile copy of datafile 00006
output file name=+DATA/cvrman/datafile/tbs1_new.dbf RECID=0 STAMP=0
channel ORA_DISK_2: piece handle=+DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.290.848207929 tag=TAG20140522T051830
channel ORA_DISK_2: restored backup piece 1
channel ORA_DISK_2: restore complete, elapsed time: 00:00:09
channel ORA_DISK_3: piece handle=+DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.287.848207921 tag=TAG20140522T051830
channel ORA_DISK_3: restored backup piece 1
channel ORA_DISK_3: restore complete, elapsed time: 00:01:06
channel ORA_DISK_4: piece handle=+DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.313.848207917 tag=TAG20140522T051830
channel ORA_DISK_4: restored backup piece 1
channel ORA_DISK_4: restore complete, elapsed time: 00:01:16
Finished restore at 26-MAY-14

Starting recover at 26-MAY-14
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5
datafile 4 not processed because file is read-only
datafile 5 not processed because file is read-only

starting media recovery

archived log for thread 1 with sequence 8 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_8.319.848465559
archived log for thread 1 with sequence 9 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_9.320.848465561
archived log for thread 1 with sequence 10 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_10.317.848465559
archived log for thread 1 with sequence 1 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_1.325.848467105
archived log for thread 1 with sequence 2 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_2.301.848469759
archived log for thread 1 with sequence 3 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_3.309.848480471
archived log for thread 1 with sequence 4 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_4.280.848480485
archived log for thread 1 with sequence 1 is already on disk as file +DATA/cvrman/archivelog/2014_05_26/thread_1_seq_1.340.848560257
archived log for thread 1 with sequence 2 is already on disk as file +DATA/cvrman/archivelog/2014_05_26/thread_1_seq_2.338.848560891
archived log for thread 1 with sequence 3 is already on disk as file +DATA/cvrman/archivelog/2014_05_26/thread_1_seq_3.324.848560897
archived log for thread 1 with sequence 1 is already on disk as file +DATA/cvrman/archivelog/2014_05_26/thread_1_seq_1.326.848571335
archived log for thread 1 with sequence 2 is already on disk as file +DATA/cvrman/archivelog/2014_05_26/thread_1_seq_2.343.848571337
archived log for thread 1 with sequence 3 is already on disk as file +DATA/cvrman/archivelog/2014_05_26/thread_1_seq_3.345.848571341
archived log for thread 1 with sequence 4 is already on disk as file +DATA/cvrman/archivelog/2014_05_26/thread_1_seq_4.282.848571519
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_8.319.848465559 thread=1 sequence=8
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_9.320.848465561 thread=1 sequence=9
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_10.317.848465559 thread=1 sequence=10
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_1.325.848467105 thread=1 sequence=1
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_2.301.848469759 thread=1 sequence=2
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_3.309.848480471 thread=1 sequence=3
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_4.280.848480485 thread=1 sequence=4
archived log file name=+DATA/cvrman/archivelog/2014_05_26/thread_1_seq_1.340.848560257 thread=1 sequence=1
archived log file name=+DATA/cvrman/archivelog/2014_05_26/thread_1_seq_2.338.848560891 thread=1 sequence=2
archived log file name=+DATA/cvrman/archivelog/2014_05_26/thread_1_seq_3.324.848560897 thread=1 sequence=3
archived log file name=+DATA/cvrman/archivelog/2014_05_26/thread_1_seq_1.326.848571335 thread=1 sequence=1
archived log file name=+DATA/cvrman/archivelog/2014_05_26/thread_1_seq_2.343.848571337 thread=1 sequence=2
archived log file name=+DATA/cvrman/archivelog/2014_05_26/thread_1_seq_3.345.848571341 thread=1 sequence=3
archived log file name=+DATA/cvrman/archivelog/2014_05_26/thread_1_seq_4.282.848571519 thread=1 sequence=4
media recovery complete, elapsed time: 00:00:41
Finished recover at 26-MAY-14

sql statement: alter database open resetlogs

RMAN> **end-of-file**


RMAN Incomplete recovery using time


(1) script to perform incomplete recovery using time
run
{
startup mount;
set until time ="to_date('26-05-2014 07:21:35','dd-mm-yyyy hh24:mi:ss')";
restore database;
recover database parallel;
sql "alter database open resetlogs";
}

(2) Ouptut of the script execution
[oracle@mfa-solcomp-poc05 rman]$ rman target="/"

Recovery Manager: Release 11.2.0.4.0 - Production on Mon May 26 07:59:32 2014

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database (not started)

RMAN> @ rman_incomplete_recovery_time.cmd

RMAN> run
2> {
3> startup mount;
4> set until time ="to_date('26-05-2014 07:21:35','dd-mm-yyyy hh24:mi:ss')";
5> restore database;
6> recover database parallel;
7> sql "alter database open resetlogs";
8> }
Oracle instance started
database mounted

Total System Global Area     730714112 bytes

Fixed Size                     2256832 bytes
Variable Size                452984896 bytes
Database Buffers             272629760 bytes
Redo Buffers                   2842624 bytes

executing command: SET until clause

Starting restore at 26-MAY-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=22 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=27 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=28 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=29 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=30 device type=DISK
flashing back control file to SCN 1537663

skipping datafile 4; already restored to file +DATA/cvrman/datafile/users.259.847354795
skipping datafile 5; already restored to file +DATA/cvrman/datafile/example_new.dbf
creating datafile file number=7 name=+DATA/cvrman/datafile/tbs2.328.848469625
channel ORA_DISK_1: restoring datafile 00006
input datafile copy RECID=83 STAMP=848217961 file name=+DATA/cvrman/datafile/tbs1.294.847433665
destination for restore of datafile 00006: +DATA/cvrman/datafile/tbs1_new.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 00003 to +DATA/cvrman/datafile/undotbs1.318.848201233
channel ORA_DISK_2: reading from backup piece +DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.290.848207929
channel ORA_DISK_3: starting datafile backup set restore
channel ORA_DISK_3: specifying datafile(s) to restore from backup set
channel ORA_DISK_3: restoring datafile 00002 to +DATA/cvrman/datafile/sysaux.257.847354793
channel ORA_DISK_3: reading from backup piece +DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.287.848207921
channel ORA_DISK_4: starting datafile backup set restore
channel ORA_DISK_4: specifying datafile(s) to restore from backup set
channel ORA_DISK_4: restoring datafile 00001 to +DATA/cvrman/datafile/system.256.847354793
channel ORA_DISK_4: reading from backup piece +DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.313.848207917
channel ORA_DISK_1: copied datafile copy of datafile 00006
output file name=+DATA/cvrman/datafile/tbs1_new.dbf RECID=0 STAMP=0
channel ORA_DISK_2: piece handle=+DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.290.848207929 tag=TAG20140522T051830
channel ORA_DISK_2: restored backup piece 1
channel ORA_DISK_2: restore complete, elapsed time: 00:00:17
channel ORA_DISK_3: piece handle=+DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.287.848207921 tag=TAG20140522T051830
channel ORA_DISK_3: restored backup piece 1
channel ORA_DISK_3: restore complete, elapsed time: 00:01:06
channel ORA_DISK_4: piece handle=+DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.313.848207917 tag=TAG20140522T051830
channel ORA_DISK_4: restored backup piece 1
channel ORA_DISK_4: restore complete, elapsed time: 00:01:05
Finished restore at 26-MAY-14

Starting recover at 26-MAY-14
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5
datafile 4 not processed because file is read-only
datafile 5 not processed because file is read-only

starting media recovery

archived log for thread 1 with sequence 8 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_8.319.848465559
archived log for thread 1 with sequence 9 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_9.320.848465561
archived log for thread 1 with sequence 10 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_10.317.848465559
archived log for thread 1 with sequence 1 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_1.325.848467105
archived log for thread 1 with sequence 2 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_2.301.848469759
archived log for thread 1 with sequence 3 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_3.309.848480471
archived log for thread 1 with sequence 4 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_4.280.848480485
archived log for thread 1 with sequence 1 is already on disk as file +DATA/cvrman/archivelog/2014_05_26/thread_1_seq_1.340.848560257
archived log for thread 1 with sequence 2 is already on disk as file +DATA/cvrman/archivelog/2014_05_26/thread_1_seq_2.338.848560891
archived log for thread 1 with sequence 3 is already on disk as file +DATA/cvrman/archivelog/2014_05_26/thread_1_seq_3.324.848560897
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_8.319.848465559 thread=1 sequence=8
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_9.320.848465561 thread=1 sequence=9
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_10.317.848465559 thread=1 sequence=10
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_1.325.848467105 thread=1 sequence=1
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_2.301.848469759 thread=1 sequence=2
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_3.309.848480471 thread=1 sequence=3
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_4.280.848480485 thread=1 sequence=4
archived log file name=+DATA/cvrman/archivelog/2014_05_26/thread_1_seq_1.340.848560257 thread=1 sequence=1
archived log file name=+DATA/cvrman/archivelog/2014_05_26/thread_1_seq_2.338.848560891 thread=1 sequence=2
archived log file name=+DATA/cvrman/archivelog/2014_05_26/thread_1_seq_3.324.848560897 thread=1 sequence=3
media recovery complete, elapsed time: 00:00:40
Finished recover at 26-MAY-14

sql statement: alter database open resetlogs

RMAN> **end-of-file**


RMAN Incomplete recovery using log sequence

(1) Script to perform incomplete recovery using log sequence
run
 {
 startup mount;
 set until sequence 5 thread 1;
 restore database;
 recover database parallel;
 sql "alter database open resetlogs";
 }

(2) Output of the incomplete recovery using log sequence
$ rman target="/"

Recovery Manager: Release 11.2.0.4.0 - Production on Mon May 26 06:31:13 2014

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: CVRMAN (DBID=657566608)

RMAN> shutdown immediate;

using target database control file instead of recovery catalog
database closed
database dismounted
Oracle instance shut down

RMAN> @rman_incomplete_recovery_log_Sequence.cmd

RMAN> run
2> {
3> startup mount;
4> set until sequence 5 thread 1;
5> restore database;
6> recover database parallel;
7> sql "alter database open resetlogs";
8> }
connected to target database (not started)
Oracle instance started
database mounted

Total System Global Area     730714112 bytes

Fixed Size                     2256832 bytes
Variable Size                452984896 bytes
Database Buffers             272629760 bytes
Redo Buffers                   2842624 bytes

executing command: SET until clause

Starting restore at 26-MAY-2014 06:32:48
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=27 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=28 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=29 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=30 device type=DISK
flashing back control file to SCN 1534402

skipping datafile 4; already restored to file +DATA/cvrman/datafile/users.259.847354795
skipping datafile 5; already restored to file +DATA/cvrman/datafile/example_new.dbf
creating datafile file number=7 name=+DATA/cvrman/datafile/tbs2.328.848469625
channel ORA_DISK_1: restoring datafile 00006
input datafile copy RECID=83 STAMP=848217961 file name=+DATA/cvrman/datafile/tbs1.294.847433665
destination for restore of datafile 00006: +DATA/cvrman/datafile/tbs1_new.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 00003 to +DATA/cvrman/datafile/undotbs1.318.848201233
channel ORA_DISK_2: reading from backup piece +DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.290.848207929
channel ORA_DISK_3: starting datafile backup set restore
channel ORA_DISK_3: specifying datafile(s) to restore from backup set
channel ORA_DISK_3: restoring datafile 00002 to +DATA/cvrman/datafile/sysaux.257.847354793
channel ORA_DISK_3: reading from backup piece +DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.287.848207921
channel ORA_DISK_4: starting datafile backup set restore
channel ORA_DISK_4: specifying datafile(s) to restore from backup set
channel ORA_DISK_4: restoring datafile 00001 to +DATA/cvrman/datafile/system.256.847354793
channel ORA_DISK_4: reading from backup piece +DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.313.848207917
channel ORA_DISK_1: copied datafile copy of datafile 00006
output file name=+DATA/cvrman/datafile/tbs1_new.dbf RECID=0 STAMP=0
channel ORA_DISK_2: piece handle=+DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.290.848207929 tag=TAG20140522T051830
channel ORA_DISK_2: restored backup piece 1
channel ORA_DISK_2: restore complete, elapsed time: 00:00:25
channel ORA_DISK_3: piece handle=+DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.287.848207921 tag=TAG20140522T051830
channel ORA_DISK_3: restored backup piece 1
channel ORA_DISK_3: restore complete, elapsed time: 00:00:48
channel ORA_DISK_4: piece handle=+DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.313.848207917 tag=TAG20140522T051830
channel ORA_DISK_4: restored backup piece 1
channel ORA_DISK_4: restore complete, elapsed time: 00:01:08
Finished restore at 26-MAY-2014 06:34:12

Starting recover at 26-MAY-2014 06:34:13
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5
datafile 4 not processed because file is read-only
datafile 5 not processed because file is read-only

starting media recovery

archived log for thread 1 with sequence 8 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_8.319.848465559
archived log for thread 1 with sequence 9 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_9.320.848465561
archived log for thread 1 with sequence 10 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_10.317.848465559
archived log for thread 1 with sequence 1 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_1.325.848467105
archived log for thread 1 with sequence 2 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_2.301.848469759
archived log for thread 1 with sequence 3 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_3.309.848480471
archived log for thread 1 with sequence 4 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_4.280.848480485
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_8.319.848465559 thread=1 sequence=8
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_9.320.848465561 thread=1 sequence=9
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_10.317.848465559 thread=1 sequence=10
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_1.325.848467105 thread=1 sequence=1
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_2.301.848469759 thread=1 sequence=2
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_3.309.848480471 thread=1 sequence=3
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_4.280.848480485 thread=1 sequence=4
media recovery complete, elapsed time: 00:00:35
Finished recover at 26-MAY-2014 06:34:53

sql "alter database open resetlogs";

sql statement: alter database open resetlogs

RMAN> **end-of-file**



Sunday, May 25, 2014

Recovering datafile not backed up using RMAN


(1)  For test case, We are creating a new tablespace namely tbs2 and is not backed up

RMAN> sql "create tablespace tbs2 datafile ''+DATA'' size 50m";

sql statement: create tablespace tbs2 datafile ''+DATA'' size 50m

RMAN> report schema;

Report of database schema for database with db_unique_name CVRMAN

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    750      SYSTEM               ***     +DATA/cvrman/datafile/system.256.847354793
2    640      SYSAUX               ***     +DATA/cvrman/datafile/sysaux.257.847354793
3    50       UNDOTBS1             ***     +DATA/cvrman/datafile/undotbs1.318.848201233
4    5        USERS                ***     +DATA/cvrman/datafile/users.259.847354795
5    345      EXAMPLE              ***     +DATA/cvrman/datafile/example_new.dbf
6    10       TBS1                 ***     +DATA/cvrman/datafile/tbs1_new.dbf
7    50       TBS2                 ***     +DATA/cvrman/datafile/tbs2.328.848467411

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    21       TEMP                 32767       +DATA/cvrman/tempfile/temp.268.847355331

RMAN> list backup of tablespace tbs2;

specification does not match any backup in the repository

2. Manually removed the datafile of tablespace tbs2 and validating the same tablespace for errors and listing the failure details
RMAN> validate tablespace tbs2;

Starting validate at 25-MAY-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=32 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=59 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=60 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=30 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=54 device type=DISK
RMAN-06169: could not read file header for datafile 7 error reason 4
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of validate command at 05/25/2014 05:43:16
RMAN-06056: could not access datafile 7
RMAN> list failure;

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
11374      HIGH     OPEN      25-MAY-14     Tablespace 8: 'TBS2' is offline
2348       HIGH     OPEN      25-MAY-14     One or more non-system datafiles are missing
2342       HIGH     OPEN      21-MAY-14     One or more non-system datafiles are offline

RMAN> list failure 2348
2> ;

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
2348       HIGH     OPEN      25-MAY-14     One or more non-system datafiles are

RMAN> list failure 2342 detail
2> ;

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
2342       HIGH     OPEN      21-MAY-14     One or more non-system datafiles are
  Impact: See impact for individual child failures
  List of child failures for parent failure ID 2342
  Failure ID Priority Status    Time Detected Summary
  ---------- -------- --------- ------------- -------
  11365      HIGH     OPEN      25-MAY-14     Datafile 7: '+DATA/cvrman/datafile
    Impact: Some objects in tablespace TBS2 might be unavailable

RMAN>  list failure 2348 detail
2> ;

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
2348       HIGH     OPEN      25-MAY-14     One or more non-system datafiles are missing
  Impact: See impact for individual child failures
  List of child failures for parent failure ID 2348
  Failure ID Priority Status    Time Detected Summary
  ---------- -------- --------- ------------- -------
  11371      HIGH     OPEN      25-MAY-14     Datafile 7: '+DATA/cvrman/datafile/tbs2.328.848467411' is missing
    Impact: Some objects in tablespace TBS2 might be unavailable

(3) Checking the repository for backup of tablespace tbs2 to restore
RMAN> list backup of tablespace tbs2;
specification does not match any backup in the repository

(4)Intrestingly, after issuing the restore command for tablespace tbs2, the missing datafiles for tbs2 is created.
RMAN> restore tablespace tbs2;

Starting restore at 25-MAY-14
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5

creating datafile file number=7 name=+DATA/cvrman/datafile/tbs2.328.848467411
restore not done; all files read only, offline, or already restored
Finished restore at 25-MAY-14

(5) Recover the tablespace tbs2
RMAN> recover tablespace tbs2;

Starting recover at 25-MAY-14
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5

starting media recovery
media recovery complete, elapsed time: 00:00:00

Finished recover at 25-MAY-14

(6) Bringing back the tablespace tbs2 to online
RMAN> sql "alter tablespace tbs2 online";

sql statement: alter tablespace tbs2 online

Thursday, May 22, 2014

Restore archivelog to non-default location

Script to restore the archivelog to non-default location
run
 {
 set archivelog destination to '/SHARED/backup1';
  restore archivelog sequence 4 force;
 }
Output:-

RMAN> run
2> {
3> set archivelog destination to '/SHARED/backup1';
4>  restore archivelog sequence 4 force;
5> }

executing command: SET ARCHIVELOG DESTINATION

Starting restore at 23-MAY-14
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5

channel ORA_DISK_1: starting archived log restore to user-specified destination
archived log destination=/SHARED/backup1
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=4
channel ORA_DISK_1: reading from backup piece +DATA/cvrman/backupset/2014_05_22/annnf0_new_arch_bkp_0.330.848234723
channel ORA_DISK_1: piece handle=+DATA/cvrman/backupset/2014_05_22/annnf0_new_arch_bkp_0.330.848234723 tag=NEW_ARCH_BKP
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:07
Finished restore at 23-MAY-14

Restore until scn and recover to perform complete recovery

(1) Taking the backuppiece with checkpoint scn 1484619 to restore database from.
List of Backup Sets
===================


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ --------------------
217     Full    643.52M    DISK        00:01:31     22-may-2014 05:20:03
        BP Key: 248   Status: AVAILABLE  Compressed: NO  Tag: TAG20140522T051830
        Piece Name: +DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.313.848207917
  List of Datafiles in backup set 217
  File LV Type Ckp SCN    Ckp Time             Name
  ---- -- ---- ---------- -------------------- ----
  1       Full 1484619    22-may-2014 05:18:32 +DATA/cvrman/datafile/system.256.847354793
  4       Full 1484619    22-may-2014 05:18:32 +DATA/cvrman/datafile/users.259.847354795

(2) Restore database..until scn 1484619
restore database until scn 1484619;
 restore database until scn 1484619;

Starting restore at 22-may-2014 12:26:15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=28 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=27 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=24 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=23 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=22 device type=DISK
flashing back control file to SCN 1484619

skipping datafile 1; already restored to file +DATA/cvrman/datafile/system.256.847354793
skipping datafile 4; already restored to file +DATA/cvrman/datafile/users.259.847354795
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00003 to +DATA/cvrman/datafile/undotbs1.318.848201233
channel ORA_DISK_1: restoring datafile 00005 to +DATA/cvrman/datafile/example_new.dbf
channel ORA_DISK_1: reading from backup piece /SHARED/backup1/9hp8grvi_1_1
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 +DATA/cvrman/datafile/sysaux.257.847354793
channel ORA_DISK_2: restoring datafile 00006 to +DATA/cvrman/datafile/tbs1_new.dbf
channel ORA_DISK_2: reading from backup piece /SHARED/backup1/9gp8grvi_1_1
channel ORA_DISK_1: piece handle=/SHARED/backup1/9hp8grvi_1_1 tag=KEEP_SYS_180
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:26
channel ORA_DISK_2: piece handle=/SHARED/backup1/9gp8grvi_1_1 tag=KEEP_SYS_180
channel ORA_DISK_2: restored backup piece 1
channel ORA_DISK_2: restore complete, elapsed time: 00:00:26
Finished restore at 22-may-2014 12:26:51

(3) Recover database
RMAN> recover database;

Starting recover at 22-may-2014 12:38:29
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5

starting media recovery

archived log for thread 1 with sequence 5 is already on disk as file +DATA/cvrman/archivelog/2014_05_17/thread_1_seq_5.312.847802453
archived log for thread 1 with sequence 6 is already on disk as file +DATA/cvrman/archivelog/2014_05_17/thread_1_seq_6.332.847836579
archived log for thread 1 with sequence 7 is already on disk as file +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_7.288.847857575
archived log for thread 1 with sequence 8 is already on disk as file +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_8.306.847862997
archived log for thread 1 with sequence 9 is already on disk as file +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_9.326.847862997
archived log for thread 1 with sequence 10 is already on disk as file +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_10.300.847862997
archived log for thread 1 with sequence 1 is already on disk as file +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_1.302.847882835
archived log for thread 1 with sequence 2 is already on disk as file +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_2.277.847923139
archived log for thread 1 with sequence 3 is already on disk as file +DATA/cvrman/archivelog/2014_05_19/thread_1_seq_3.303.848008895
archived log for thread 1 with sequence 4 is already on disk as file +DATA/cvrman/archivelog/2014_05_20/thread_1_seq_4.305.848051929
archived log for thread 1 with sequence 5 is already on disk as file +DATA/cvrman/archivelog/2014_05_20/thread_1_seq_5.272.848095331
archived log for thread 1 with sequence 6 is already on disk as file +DATA/cvrman/archivelog/2014_05_21/thread_1_seq_6.274.848152857
archived log for thread 1 with sequence 7 is already on disk as file +DATA/cvrman/archivelog/2014_05_21/thread_1_seq_7.278.848181757
archived log for thread 1 with sequence 8 is already on disk as file +DATA/cvrman/archivelog/2014_05_22/thread_1_seq_8.344.848215595
archived log for thread 1 with sequence 9 is already on disk as file +DATA/cvrman/onlinelog/group_3.266.847355299
archived log file name=+DATA/cvrman/archivelog/2014_05_17/thread_1_seq_5.312.847802453 thread=1 sequence=5
archived log file name=+DATA/cvrman/archivelog/2014_05_17/thread_1_seq_6.332.847836579 thread=1 sequence=6
archived log file name=+DATA/cvrman/archivelog/2014_05_18/thread_1_seq_7.288.847857575 thread=1 sequence=7
archived log file name=+DATA/cvrman/archivelog/2014_05_18/thread_1_seq_8.306.847862997 thread=1 sequence=8
archived log file name=+DATA/cvrman/archivelog/2014_05_18/thread_1_seq_9.326.847862997 thread=1 sequence=9
archived log file name=+DATA/cvrman/archivelog/2014_05_18/thread_1_seq_10.300.847862997 thread=1 sequence=10
archived log file name=+DATA/cvrman/archivelog/2014_05_18/thread_1_seq_1.302.847882835 thread=1 sequence=1
archived log file name=+DATA/cvrman/archivelog/2014_05_18/thread_1_seq_2.277.847923139 thread=1 sequence=2
archived log file name=+DATA/cvrman/archivelog/2014_05_19/thread_1_seq_3.303.848008895 thread=1 sequence=3
archived log file name=+DATA/cvrman/archivelog/2014_05_20/thread_1_seq_4.305.848051929 thread=1 sequence=4
archived log file name=+DATA/cvrman/archivelog/2014_05_20/thread_1_seq_5.272.848095331 thread=1 sequence=5
archived log file name=+DATA/cvrman/archivelog/2014_05_21/thread_1_seq_6.274.848152857 thread=1 sequence=6
media recovery complete, elapsed time: 00:00:52
Finished recover at 22-may-2014 12:39:26

(4) Open the database
RMAN> sql "alter database open";

sql statement: alter database open

Read only tablespaces are skipped during RMAN restore operation


Read only tablespace are skipped during restore operation
 rman target="/"

Recovery Manager: Release 11.2.0.4.0 - Production on Thu May 22 11:18:18 2014

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database (not started)

RMAN> @ ./rman/rman_check_read_only.cmd

RMAN> run
2> {
3> startup mount;
4> restore database;
5> }
Oracle instance started
database mounted

Total System Global Area     730714112 bytes

Fixed Size                     2256832 bytes
Variable Size                452984896 bytes
Database Buffers             272629760 bytes
Redo Buffers                   2842624 bytes

Starting restore at 22-MAY-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=21 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=27 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=28 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=29 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=30 device type=DISK

skipping datafile 4; already restored to file +DATA/cvrman/datafile/users.259.847354795
skipping datafile 5; already restored to file +DATA/cvrman/datafile/example_new.dbf
channel ORA_DISK_1: restoring datafile 00006
input datafile copy RECID=83 STAMP=848217961 file name=+DATA/cvrman/datafile/tbs1.294.847433665
destination for restore of datafile 00006: +DATA/cvrman/datafile/tbs1_new.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 00003 to +DATA/cvrman/datafile/undotbs1.318.848201233

Solution:
(a) Restore the datafile/tablespace(s) are skipped as restored in a separate command
RMAN> restore datafile 4,5;

Starting restore at 22-MAY-14
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5

channel ORA_DISK_1: restoring datafile 00005
input datafile copy RECID=86 STAMP=848219445 file name=+DATA/cvrman/datafile/example.308.847525493
destination for restore of datafile 00005: +DATA/cvrman/datafile/example_new.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 00004 to +DATA/cvrman/datafile/users.259.847354795
channel ORA_DISK_2: reading from backup piece +DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.313.848207917
channel ORA_DISK_2: piece handle=+DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.313.848207917 tag=TAG20140522T051830
channel ORA_DISK_2: restored backup piece 1
channel ORA_DISK_2: restore complete, elapsed time: 00:00:03
channel ORA_DISK_1: copied datafile copy of datafile 00005
output file name=+DATA/cvrman/datafile/example_new.dbf RECID=0 STAMP=0
Finished restore at 22-MAY-14

(b)Tried the command restore database check readonly, but still the restoration of backup is skipped for datafile 4 and 5 as per the script.

Switch datafile to non-default location using RMAN

1.Script to switch the datafile to non-default location
cat rman_switch.cmd
run
{
sql "alter database datafile 6 offline";
set newname for datafile 6 to '+DATA/cvrman/datafile/tbs1_new.dbf';
restore datafile 6;
switch datafile 6;
recover datafile 6;
sql "alter database datafile 6 online";
}
2. Output
$ rman target="/"

Recovery Manager: Release 11.2.0.4.0 - Production on Thu May 22 08:05:30 2014

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: CVRMAN (DBID=657566608)

RMAN> @ rman_switch.cmd

RMAN> run
2> {
3> sql "alter database datafile 6 offline";
4> set newname for datafile 6 to '+DATA/cvrman/datafile/tbs1_new.dbf';
5> restore datafile 6;
6> switch datafile 6;
7> recover datafile 6;
8> sql "alter database datafile 6 online";
9> }
using target database control file instead of recovery catalog
sql statement: alter database datafile 6 offline

executing command: SET NEWNAME

Starting restore at 22-MAY-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=34 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=24 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=51 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=49 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=50 device type=DISK

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00006 to +DATA/cvrman/datafile/tbs1_new.dbf
channel ORA_DISK_1: reading from backup piece +DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.287.848207921
channel ORA_DISK_1: piece handle=+DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.287.848207921 tag=TAG20140522T051830
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 22-MAY-14

datafile 6 switched to datafile copy
input datafile copy RECID=82 STAMP=848217961 file name=+DATA/cvrman/datafile/tbs1_new.dbf

Starting recover at 22-MAY-14
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5

starting media recovery
media recovery complete, elapsed time: 00:00:01

Finished recover at 22-MAY-14

sql statement: alter database datafile 6 online

RMAN> **end-of-file**

RMAN> report schema;

Report of database schema for database with db_unique_name CVRMAN

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    750      SYSTEM               ***     +DATA/cvrman/datafile/system.256.847354793
2    640      SYSAUX               ***     +DATA/cvrman/datafile/sysaux.257.847354793
3    50       UNDOTBS1             ***     +DATA/cvrman/datafile/undotbs1.318.848201233
4    5        USERS                ***     +DATA/cvrman/datafile/users.259.847354795
5    345      EXAMPLE              ***     +DATA/cvrman/datafile/example.308.847525493
6    10       TBS1                 ***     +DATA/cvrman/datafile/tbs1_new.dbf

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    20       TEMP                 32767       +DATA/cvrman/tempfile/temp.268.847355331



restore not done; all files read only, offline, or already restored

RMAN> restore tablespace  example;

Starting restore at 22-MAY-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=23 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=27 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=28 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=29 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=30 device type=DISK

skipping datafile 5; already restored to file +DATA/cvrman/datafile/example.308.847525493
restore not done; all files read only, offline, or already restored
Finished restore at 22-MAY-14

SOLUTION:- restore tablespace example force;
RMAN> restore tablespace example force;

Starting restore at 22-MAY-14
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00005 to +DATA/cvrman/datafile/example.308.847525493
channel ORA_DISK_1: reading from backup piece +DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.290.848207929
channel ORA_DISK_1: piece handle=+DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.290.848207929 tag=TAG20140522T051830
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
Finished restore at 22-MAY-14

Script to test RMAN recover tablespace operation

(1) Script for RMAN test recover operation
 
#Rman script to test the recovery operation of a tablespace example
sql"alter tablespace example offline";
restore tablespace example;
recover tablespace example test;


RMAN> #Rman script to test the recovery operation of a tablespace example
2> sql"alter tablespace example offline";
sql statement: alter tablespace example offline

RMAN> restore tablespace example;
Starting restore at 22-MAY-14
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00005 to +DATA/cvrman/datafile/example.308.847525493
channel ORA_DISK_1: reading from backup piece +DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.290.848207929
channel ORA_DISK_1: piece handle=+DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.290.848207929 tag=TAG20140522T051830
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
Finished restore at 22-MAY-14

RMAN> recover tablespace example test;
Starting recover at 22-MAY-14
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5

starting media recovery
RMAN-11006: WARNING: test recovery results:
ORA-10574: Test recovery did not corrupt any data block
ORA-10573: Test recovery tested redo from change 1484624 to 1484846
ORA-10572: Test recovery canceled due to errors
ORA-10585: Test recovery can not apply redo that may modify control file

media recovery complete, elapsed time: 00:00:00

Finished recover at 22-MAY-14

RMAN>
RMAN> **end-of-file**


ORA-10572: Test recovery canceled due to errors

1. Test recovery cancelled due to errors
RMAN> recover tablespace tbs1 test;
Starting recover at 22-MAY-14
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5

starting media recovery
media recovery failed
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 05/22/2014 02:14:17
RMAN-11003: failure during parse/execution of SQL statement: alter database recover if needed
 tablespace TBS1 test
ORA-10572: Test recovery canceled due to errors
ORA-19904: test recovery not allowed for datafile 6
Cause The specified datafile has been restored from a backup that was taken before the last resetlogs. Recovering this datafile will require a file header update that is incompatible with test recovery.

Action Perform actual recovery.

Wednesday, May 21, 2014

Validate the recovery area

1. Script to validate the recovery area

Validate recovery area;

RMAN> validate recovery area;

Starting validate at 22-MAY-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=50 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=25 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=57 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=52 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=27 device type=DISK
skipping backup sets; RECOVERY FILES, RECOVERY AREA or DB_RECOVERY_FILE_DEST option cannot validate backup set
channel ORA_DISK_1: starting validation of archived log
channel ORA_DISK_1: specifying archived log(s) for validation
input archived log thread=1 sequence=4 RECID=70 STAMP=847791844
input archived log thread=1 sequence=5 RECID=68 STAMP=847791844
input archived log thread=1 sequence=6 RECID=72 STAMP=847791844
input archived log thread=1 sequence=7 RECID=74 STAMP=847791845
input archived log thread=1 sequence=8 RECID=69 STAMP=847791844
channel ORA_DISK_2: starting validation of archived log
channel ORA_DISK_2: specifying archived log(s) for validation
input archived log thread=1 sequence=9 RECID=71 STAMP=847791844
input archived log thread=1 sequence=12 RECID=67 STAMP=847791844
input archived log thread=1 sequence=13 RECID=75 STAMP=847791848
channel ORA_DISK_3: starting validation of archived log
channel ORA_DISK_3: specifying archived log(s) for validation
input archived log thread=1 sequence=1 RECID=78 STAMP=847792346
input archived log thread=1 sequence=2 RECID=79 STAMP=847792560
input archived log thread=1 sequence=3 RECID=80 STAMP=847792660
input archived log thread=1 sequence=4 RECID=81 STAMP=847802351
input archived log thread=1 sequence=5 RECID=82 STAMP=847802452
channel ORA_DISK_4: starting validation of archived log
channel ORA_DISK_4: specifying archived log(s) for validation
input archived log thread=1 sequence=6 RECID=83 STAMP=847836581
input archived log thread=1 sequence=7 RECID=85 STAMP=847857575
input archived log thread=1 sequence=8 RECID=95 STAMP=847862997
input archived log thread=1 sequence=9 RECID=96 STAMP=847862997
input archived log thread=1 sequence=10 RECID=94 STAMP=847862997
channel ORA_DISK_5: starting validation of archived log
channel ORA_DISK_5: specifying archived log(s) for validation
input archived log thread=1 sequence=1 RECID=97 STAMP=847882837
input archived log thread=1 sequence=2 RECID=98 STAMP=847923142
input archived log thread=1 sequence=3 RECID=99 STAMP=848008899
channel ORA_DISK_1: validation complete, elapsed time: 00:00:06
List of Archived Logs
=====================
Thrd Seq     Status Blocks Failing Blocks Examined Name
---- ------- ------ -------------- --------------- ---------------
1    4       OK     0              27              +DATA/cvrman/archivelog/2014_05_17/thread_1_seq_4.295.847791843
1    5       OK     0              123             +DATA/cvrman/archivelog/2014_05_17/thread_1_seq_5.296.847791841
1    6       OK     0              15              +DATA/cvrman/archivelog/2014_05_17/thread_1_seq_6.304.847791845
1    7       OK     0              15767           +DATA/cvrman/archivelog/2014_05_17/thread_1_seq_7.284.847791839
1    8       OK     0              117             +DATA/cvrman/archivelog/2014_05_17/thread_1_seq_8.315.847791843
channel ORA_DISK_1: starting validation of archived log
channel ORA_DISK_1: specifying archived log(s) for validation
input archived log thread=1 sequence=4 RECID=100 STAMP=848051930
input archived log thread=1 sequence=5 RECID=101 STAMP=848095334
input archived log thread=1 sequence=6 RECID=102 STAMP=848152861
channel ORA_DISK_2: validation complete, elapsed time: 00:00:09
List of Archived Logs
=====================
Thrd Seq     Status Blocks Failing Blocks Examined Name
---- ------- ------ -------------- --------------- ---------------
1    9       OK     0              2               +DATA/cvrman/archivelog/2014_05_17/thread_1_seq_9.269.847791843
1    12      OK     0              84538           +DATA/cvrman/archivelog/2014_
1    13      OK     0              28027           +DATA/cvrman/archivelog/2014_
channel ORA_DISK_2: starting validation of archived log
channel ORA_DISK_2: specifying archived log(s) for validation
input archived log thread=1 sequence=7 RECID=103 STAMP=848181761
channel ORA_DISK_3: validation complete, elapsed time: 00:00:09
List of Archived Logs
=====================
Thrd Seq     Status Blocks Failing Blocks Examined Name
---- ------- ------ -------------- --------------- ---------------
1    1       OK     0              46683           +DATA/cvrman/archivelog/2014_
1    2       OK     0              13              +DATA/cvrman/archivelog/2014_
1    3       OK     0              10              +DATA/cvrman/archivelog/2014_
1    4       OK     0              46752           +DATA/cvrman/archivelog/2014_
1    5       OK     0              4               +DATA/cvrman/archivelog/2014_
channel ORA_DISK_3: starting validation of datafile
channel ORA_DISK_3: including datafile copy of datafile 00005 in backup set
input file name=+DATA/cvrman/datafile/example.273.847802947
channel ORA_DISK_3: including datafile copy of datafile 00003 in backup set
input file name=+DATA/cvrman/datafile/undotbs1.342.847802951
channel ORA_DISK_2: validation complete, elapsed time: 00:00:07
List of Archived Logs
=====================
Thrd Seq     Status Blocks Failing Blocks Examined Name
---- ------- ------ -------------- --------------- ---------------
1    7       OK     0              85016           +DATA/cvrman/archivelog/2014_05_21/thread_1_seq_7.278.848181757
channel ORA_DISK_2: starting validation of datafile
channel ORA_DISK_2: including datafile copy of datafile 00002 in backup set
input file name=+DATA/cvrman/datafile/sysaux.344.847802947
channel ORA_DISK_2: including datafile copy of datafile 00006 in backup set
input file name=+DATA/cvrman/datafile/tbs1.341.847802953
channel ORA_DISK_4: validation complete, elapsed time: 00:00:15
List of Archived Logs
=====================
Thrd Seq     Status Blocks Failing Blocks Examined Name
---- ------- ------ -------------- --------------- ---------------
1    6       OK     0              83495           +DATA/cvrman/archivelog/2014_05_17/thread_1_seq_6.332.847836579
1    7       OK     0              33751           +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_7.288.847857575
1    8       OK     0              3266            +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_8.306.847862997
1    9       OK     0              2               +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_9.326.847862997
1    10      OK     0              2935            +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_10.300.847862997
channel ORA_DISK_4: starting validation of datafile
channel ORA_DISK_4: including datafile copy of datafile 00001 in backup set
input file name=+DATA/cvrman/datafile/system.314.847802947
channel ORA_DISK_4: including datafile copy of datafile 00004 in backup set
input file name=+DATA/cvrman/datafile/users.340.847803041
channel ORA_DISK_5: validation complete, elapsed time: 00:00:15
List of Archived Logs
=====================
Thrd Seq     Status Blocks Failing Blocks Examined Name
---- ------- ------ -------------- --------------- ---------------
1    1       OK     0              84298           +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_1.302.847882835
1    2       OK     0              84314           +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_2.277.847923139
1    3       OK     0              83370           +DATA/cvrman/archivelog/2014_05_19/thread_1_seq_3.303.848008895
channel ORA_DISK_1: validation complete, elapsed time: 00:00:15
List of Archived Logs
=====================
Thrd Seq     Status Blocks Failing Blocks Examined Name
---- ------- ------ -------------- --------------- ---------------
1    4       OK     0              83315           +DATA/cvrman/archivelog/2014_05_20/thread_1_seq_4.305.848051929
1    5       OK     0              83791           +DATA/cvrman/archivelog/2014_05_20/thread_1_seq_5.272.848095331
1    6       OK     0              85204           +DATA/cvrman/archivelog/2014_05_21/thread_1_seq_6.274.848152857
channel ORA_DISK_3: validation complete, elapsed time: 00:01:13
List of Datafile Copies
=======================
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
3    OK     0              385          6400            1246502
  File Name: +DATA/cvrman/datafile/undotbs1.342.847802951
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              0
  Index      0              0
  Other      0              6015

File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
5    OK     0              33702        44240           1237936
  File Name: +DATA/cvrman/datafile/example.273.847802947
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              6582
  Index      0              1149
  Other      0              2807

channel ORA_DISK_2: validation complete, elapsed time: 00:01:37
List of Datafile Copies
=======================
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
2    OK     0              20713        71728           1246299
  File Name: +DATA/cvrman/datafile/sysaux.344.847802947
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              14144
  Index      0              10480
  Other      0              26343

File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
6    OK     0              1153         1280            1013566
  File Name: +DATA/cvrman/datafile/tbs1.341.847802953
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              0
  Index      0              0
  Other      0              127

channel ORA_DISK_4: validation complete, elapsed time: 00:01:36
List of Datafile Copies
=======================
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
1    OK     0              15253        96072           1246502
  File Name: +DATA/cvrman/datafile/system.314.847802947
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              64005
  Index      0              13283
  Other      0              3459

File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
4    OK     0              18           667             993125
  File Name: +DATA/cvrman/datafile/users.340.847803041
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              91
  Index      0              39
  Other      0              492

Finished validate at 22-MAY-14


Preview and Validate the RMAN restore operation

1.Preview and Validate the restore operation of a datafile
restore datafile 3 validate preview;
Starting restore at 21-MAY-14
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5

List of Datafile Copies
=======================

Key     File S Completion Time Ckp SCN    Ckp Time
------- ---- - --------------- ---------- ---------------
71      3    A 17-MAY-14       1246567    17-MAY-14
        Name: +DATA/cvrman/datafile/undotbs1.342.847802951
        Tag: CPY_DB


List of Archived Log Copies for database with db_unique_name CVRMAN
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - ---------
83      1    6       A 17-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_17/thread_1_seq_6.332.847836579

85      1    7       A 17-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_7.288.847857575

95      1    8       A 18-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_8.306.847862997

96      1    9       A 18-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_9.326.847862997

94      1    10      A 18-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_10.300.847862997

97      1    1       A 18-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_1.302.847882835

98      1    2       A 18-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_2.277.847923139

99      1    3       A 18-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_19/thread_1_seq_3.303.848008895

100     1    4       A 19-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_20/thread_1_seq_4.305.848051929

101     1    5       A 20-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_20/thread_1_seq_5.272.848095331

Media recovery start SCN is 1246567
Recovery must be done beyond SCN 1246567 to clear datafile fuzziness

channel ORA_DISK_1: scanning datafile copy +DATA/cvrman/datafile/undotbs1.342.847802951
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5

channel ORA_DISK_1: scanning archived log +DATA/cvrman/archivelog/2014_05_17/thread_1_seq_6.332.847836579
channel ORA_DISK_2: scanning archived log +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_7.288.847857575
channel ORA_DISK_3: scanning archived log +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_8.306.847862997
channel ORA_DISK_4: scanning archived log +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_9.326.847862997
channel ORA_DISK_5: scanning archived log +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_10.300.847862997
channel ORA_DISK_3: scanning archived log +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_1.302.847882835
channel ORA_DISK_4: scanning archived log +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_2.277.847923139
channel ORA_DISK_5: scanning archived log +DATA/cvrman/archivelog/2014_05_19/thread_1_seq_3.303.848008895
channel ORA_DISK_2: scanning archived log +DATA/cvrman/archivelog/2014_05_20/thread_1_seq_4.305.848051929
channel ORA_DISK_1: scanning archived log +DATA/cvrman/archivelog/2014_05_20/thread_1_seq_5.272.848095331
Finished restore at 21-MAY-14


Examples of preview RMAN restore operation


RMAN> restore archivelog from sequence 1 preview;
Starting restore at 21-MAY-14
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5

List of Archived Log Copies for database with db_unique_name CVRMAN
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - ---------
97      1    1       A 18-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_1.302.847882835

98      1    2       A 18-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_2.277.847923139

99      1    3       A 18-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_19/thread_1_seq_3.303.848008895

100     1    4       A 19-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_20/thread_1_seq_4.305.848051929

101     1    5       A 20-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_20/thread_1_seq_5.272.848095331

Finished restore at 21-MAY-14

RMAN> restore archivelog from time "sysdate-1" preview;

Starting restore at 21-MAY-14
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5

List of Archived Log Copies for database with db_unique_name CVRMAN
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - ---------
101     1    5       A 20-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_20/thread_1_seq_5.272.848095331

Finished restore at 21-MAY-14

2) RMAN> restore archivelog from time "sysdate-1" preview;
Starting restore at 21-MAY-14
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5

List of Archived Log Copies for database with db_unique_name CVRMAN
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - ---------
101     1    5       A 20-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_20/thread_1_seq_5.272.848095331

Finished restore at 21-MAY-14

3) restore controlfile from autobackup preview;
Starting restore at 21-MAY-14
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5

recovery area destination: +DATA
database name (or database unique name) used for search: CVRMAN
channel ORA_DISK_1: AUTOBACKUP +data/CVRMAN/AUTOBACKUP/2014_05_21/s_848146051.276.848146053 found in the recovery area
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20140521
recovery area destination: +DATA
database name (or database unique name) used for search: CVRMAN
channel ORA_DISK_2: AUTOBACKUP +data/CVRMAN/AUTOBACKUP/2014_05_21/s_848146051.276.848146053 found in the recovery area
channel ORA_DISK_2: looking for AUTOBACKUP on day: 20140521
channel ORA_DISK_2: skipped, AUTOBACKUP already found
recovery area destination: +DATA
database name (or database unique name) used for search: CVRMAN
channel ORA_DISK_3: AUTOBACKUP +data/CVRMAN/AUTOBACKUP/2014_05_21/s_848146051.276.848146053 found in the recovery area
channel ORA_DISK_3: looking for AUTOBACKUP on day: 20140521
channel ORA_DISK_3: skipped, AUTOBACKUP already found
recovery area destination: +DATA
database name (or database unique name) used for search: CVRMAN
channel ORA_DISK_4: AUTOBACKUP +data/CVRMAN/AUTOBACKUP/2014_05_21/s_848146051.276.848146053 found in the recovery area
channel ORA_DISK_4: looking for AUTOBACKUP on day: 20140521
channel ORA_DISK_4: skipped, AUTOBACKUP already found
recovery area destination: +DATA
database name (or database unique name) used for search: CVRMAN
channel ORA_DISK_5: AUTOBACKUP +data/CVRMAN/AUTOBACKUP/2014_05_21/s_848146051.276.848146053 found in the recovery area
channel ORA_DISK_5: looking for AUTOBACKUP on day: 20140521
channel ORA_DISK_5: skipped, AUTOBACKUP already found
Finished restore at 21-MAY-14
4.Preview restore database from image copy
Starting restore at 21-MAY-14
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5

datafile 5 not processed because file is offline
List of Datafile Copies
=======================

Key     File S Completion Time Ckp SCN    Ckp Time
------- ---- - --------------- ---------- ---------------
74      1    A 17-MAY-14       1246558    17-MAY-14
        Name: +DATA/cvrman/datafile/system.314.847802947
        Tag: CPY_DB

73      2    A 17-MAY-14       1246561    17-MAY-14
        Name: +DATA/cvrman/datafile/sysaux.344.847802947
        Tag: CPY_DB

71      3    A 17-MAY-14       1246567    17-MAY-14
        Name: +DATA/cvrman/datafile/undotbs1.342.847802951
        Tag: CPY_DB

78      4    A 18-MAY-14       1246607    17-MAY-14
        Name: +DATA/cvrman/datafile/users.dbf
        Tag: CPY_DB

70      6    A 17-MAY-14       1246570    17-MAY-14
        Name: +DATA/cvrman/datafile/tbs1.341.847802953
        Tag: CPY_DB


List of Archived Log Copies for database with db_unique_name CVRMAN
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - ---------
83      1    6       A 17-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_17/thread_1_seq_6.332.847836579

85      1    7       A 17-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_7.288.847857575

95      1    8       A 18-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_8.306.847862997

96      1    9       A 18-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_9.326.847862997

94      1    10      A 18-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_10.300.847862997

97      1    1       A 18-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_1.302.847882835

98      1    2       A 18-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_2.277.847923139

99      1    3       A 18-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_19/thread_1_seq_3.303.848008895

100     1    4       A 19-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_20/thread_1_seq_4.305.848051929

101     1    5       A 20-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_20/thread_1_seq_5.272.848095331

Media recovery start SCN is 1246558
Recovery must be done beyond SCN 1246607 to clear datafile fuzziness
Finished restore at 21-MAY-14

Preview the restore operation


1.Preview supports 3 modes namely

     (a) normal
    (b) summary
    (c) recall


(a) Normal mode:-
restore tablespace example
from tag="KEEP_SYS_180"
preview ;
output:-
RMAN> restore tablespace example
2> from tag="KEEP_SYS_180"
3> preview ;

Starting restore at 21-MAY-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=59 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=54 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=49 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=30 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=50 device type=DISK


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


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
190     Full    70.30M     DISK        00:01:11     17-MAY-14
        BP Key: 221   Status: AVAILABLE  Compressed: NO  Tag: KEEP_SYS_180
        Piece Name: /SHARED/backup1/9hp8grvi_1_1
        Keep: BACKUP_LOGS        Until: 13-NOV-14
  List of Datafiles in backup set 190
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  5       Full 1246246    17-MAY-14 +DATA/cvrman/datafile/example.308.847525493
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5

List of Archived Log Copies for database with db_unique_name CVRMAN
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - ---------
82      1    5       A 17-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_17/thread_1_seq_5.312.847802453

83      1    6       A 17-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_17/thread_1_seq_6.332.847836579

85      1    7       A 17-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_7.288.847857575

95      1    8       A 18-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_8.306.847862997

96      1    9       A 18-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_9.326.847862997

94      1    10      A 18-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_10.300.847862997

97      1    1       A 18-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_1.302.847882835

98      1    2       A 18-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_2.277.847923139

99      1    3       A 18-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_19/thread_1_seq_3.303.848008895

100     1    4       A 19-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_20/thread_1_seq_4.305.848051929

101     1    5       A 20-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_20/thread_1_seq_5.272.848095331

Media recovery start SCN is 1246246
Recovery must be done beyond SCN 1246246 to clear datafile fuzziness
Finished restore at 21-MAY-14
(b) summary mode:
restore tablespace example
from tag="KEEP_SYS_180"
preview summary;
output:-
RMAN> restore tablespace example
from tag="KEEP_SYS_180"
preview summary;2> 3>

Starting restore at 21-MAY-14
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5


List of Backups
===============
Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
190     B  F  A DISK        17-MAY-14       1       1       NO         KEEP_SYS_180

List of Archived Log Copies for database with db_unique_name CVRMAN
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - ---------
82      1    5       A 17-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_17/thread_1_seq_5.312.847802453

83      1    6       A 17-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_17/thread_1_seq_6.332.847836579

85      1    7       A 17-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_7.288.847857575

95      1    8       A 18-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_8.306.847862997

96      1    9       A 18-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_9.326.847862997

94      1    10      A 18-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_10.300.847862997

97      1    1       A 18-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_1.302.847882835

98      1    2       A 18-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_18/thread_1_seq_2.277.847923139

99      1    3       A 18-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_19/thread_1_seq_3.303.848008895

100     1    4       A 19-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_20/thread_1_seq_4.305.848051929

101     1    5       A 20-MAY-14
        Name: +DATA/cvrman/archivelog/2014_05_20/thread_1_seq_5.272.848095331

Media recovery start SCN is 1246246
Recovery must be done beyond SCN 1246246 to clear datafile fuzziness
Finished restore at 21-MAY-14
(3) Recall mode:- It is used only for restoring from remote storage.

Script to Identity database requires crash recovery or not

1. Script to identify crash recovery
select t.thread#,d.open_mode,t.status,i.instance_name,
case 
when((t.status='CLOSED') and (d.open_mode='MOUNTED')) THEN 'DB DON''T REQUIRE CRASH RECOVERY'
WHEN ((t.status='OPEN') and (d.open_mode='READ WRITE')) THEN 'DB IS OPEN'
WHEN ((t.status='OPEN') and (d.open_mode='MOUNTED')) THEN 'DB NEED CRASH RECOVERY'
ELSE 'NO IDEA'
END  "DB_STATUS"
from v$thread t,
v$database d,
v$instance i
where t.thread#=i.thread#;
2.output of the script output
SQL> select t.thread#,d.open_mode,t.status,i.instance_name,
  2  case
when((t.status='CLOSED') and (d.open_mode='MOUNTED')) THEN 'DB DON''T REQUIRE CRASH RECOVERY'
WHEN ((t.status='OPEN') and (d.open_mode='READ WRITE')) THEN 'DB IS OPEN'
  3    4    5  WHEN ((t.status='OPEN') and (d.open_mode='MOUNTED')) THEN 'DB NEED CRASH RECOVERY'
  6  ELSE 'NO IDEA'
  7  END  "DB_STATUS"
  8  from v$thread t,
  9  v$database d,
 10  v$instance i
 11  where t.thread#=i.thread#;

   THREAD# OPEN_MODE            STATUS INSTANCE_NAME    DB_STATUS
---------- -------------------- ------ ---------------- -------------------------------
         1 READ WRITE           OPEN   CVRMAN           DB IS OPEN

Upgrade Oracle Grid Infrastructure and RAC Database Patchset Upgrade from 11.2.0.1.0 to 11.2.0.3.10



The software required for upgrading the oracle Grid Infrastructure and RAC database patchset upgrade from 11.2.0.1.0 to 11.2.0.3.10 are as follows,


Sr. No.
HOME
Description
Software  Zip File
1.
11.2.0.1 RDBMS_HOME
RACcheck Readiness Assessment Tool(Support Note 1457357.1)

orachk.zip

2.
GRID  & RDBMS HOME
Latest Opatch utility

p6880880_112000_Linux-x86-64.zip
3.
11.2.0.1 GRID_HOME
Grid Infrastructure One-off Patches for Source Cluster Home
(Recommended by orachk utility)
p9413827_112010_Linux-x86-64.zip
p12652740_112010_Linux-x86-64.zip




4.



11.2.0.3 GRID_HOME
11.2.0.3.0 Grid Infrastructure software

p10404530_112030_Linux-x86-64_3of7.zip
Grid Infrastructure  11.2.0.3.10  patchset update(includes DB PSU 11.2.0.3.10)

p18139678_112030_Linux-x86-64.zip
5.
11.2.0.3  RDBMS_HOME
11.2.0.3.0 database software

p10404530_112030_Linux-x86-64_1of7.zip
 p10404530_112030_Linux-x86-64_2of7.zip



1. Run the  Oracle RACcheck upgrade readiness assessment tool.
  
 (a)  Download the latest  RACcheck configuration audit tool from the oracle support note 1457357.1.This tool should be run as RDBMS owner.

  (b) unzip the orchk.zip file


unzip orchk.zip

 (c)  Change the permission of the unzipped directory to 755

unzip 755 orachk
  (d)  Execute orachk in pre-upgrade mode  as RDBMS user and follow the on-screen prompts
./orachk -u -o pr
(e)  Review the html file generated by the orachk readiness assessment tool.


  2. Run the  CVU  Pre-Upgrade  check tool

   (a) Execute runcluvfy.sh in unzipped grid installation software location as grid user to confirm whether the environment is suitable for upgrading
./runcluvfy.sh stage -pre crsinst -upgrade -n ol6-112-rac1.localdomain,ol6-112-rac2.localdomain -rolling -src_crshome /u01/app/11.2.0/grid -dest_crshome /u02/app/11.2.0.3/grid -dest_version 11.2.0.3.0 -fixup -fixupdir /tmp –verbose
(b)   Check the generated logs for any component with failed status.If any resolve the issue for the failed status and make it passed in the next run of the runcluvfy.sh

  3.Unzip the latest opatch utility
 (a) unzip the p6880880_112000_Linux-x86-64.zip
unzip p6880880_112000_Linux-x86-64.zip
 (b) move the old OPatch directory in the GRID_HOME as grid user
mv $GRID_HOME/OPatch $GRID_HOME/OPatch_old
(c) move the old OPatch directory in the RDBMS_HOME  as rdbms user
 mv $RDBMS_HOME/OPatch $RDBMS_HOME/OPatch_old
(d)  Copy the unzipped OPatch to the GRID_HOME as grid user
 cp -r $STAGE_HOME/OPatch $GRID_HOME
(e)  Copy the unzipped OPatch the RDBMS_HOME as rdbms user
 cp –r $STAGE_HOME/OPatch $RDBMS_HOME 
4. Applying  one-off patch 9413827 in  11.2.0.1 grid home and in 11.2.0.1 rdbms home
(a)   Use srvctl stop home as rdbms user, to stop all the running instances in node 1

  srvctl stop home -o $RDBMS_HOME -s ol6_rac1_status_srvctl.log -n ol6-112-rac1 
(b)  Run as root user  in node 1
  
 # $GRID_HOME/crs/install/rootcrs.pl –unlock 
(c)   Run as rdbms user

cd ../9413827/custom/server/9413827/custom/scripts/
./prepatch.sh -dbhome $RDBMS_HOME
(d)  Run as grid user

opatch napply -local -oh $GRID_HOME -id 9413827
(e)   Run as rdbms user

cd  ../9413827/custom/server
opatch napply -local -oh $RDBMS_HOME -id 9413827
(f)    run as root user

#chmod +w $GRID_HOME/log/nodename/agent
#chmod +w $GRID_HOME/log/nodename/agent/crsd
(g)   run as rdbms user

cd ../9413827/custom/server/9413827/custom/scripts/
./postpatch.sh -dbhome $RDBMS_HOME
(h)  run as root user

# $GRID_HOME/crs/install/rootcrs.pl –patch
(i)    check the status of the interim patch status as grid user

export PATH=$PATH:$GRID_HOME/OPatch
opatch lsinventory -detail -oh $GRID_HOME
opatch lsinventory -detail -oh $RDBMS_HOME

(j)    perform the steps  (a)-(i) in node 2


5. Applying one-off patch 12652740 in  11.2.0.1 grid home and in 11.2.0.1 oracle home
(a) Run as rdbms user in node1

$RDBMS_HOME/bin/srvctl stop home -o $RDBMS_HOME ol6_rac1_status_srvctl.log -n ol6-112-rac1
(b)  Run as root user  in node 1
#$GRID_HOME/crs/install/rootcrs.pl –unlock
 (c)  Run as grid user
cd $UNZIPPED_PATH_LOCATION/12652740
$GRID_HOME/OPatch/opatch  napply -oh $GRID_HOME -local 
 (d) Run as rdbms user

cd $UNZIPPED_PATH_LOCATION/12652740
$RDBMS_HOME/OPatch/opatch napply -oh $RDBMS_HOME -local
(e)   Run as root user
# $GRID_HOME/rdbms/install/rootadd_rdbms.sh
# $GRID_HOME/crs/install/rootcrs.pl –patch
(f)    check the status of the interim patch status as grid user
export PATH=$PATH:$GRID_HOME/OPatch
opatch lsinventory -detail -oh $GRID_HOME
opatch lsinventory -detail -oh $RDBMS_HOME
(g) perform the steps  (a)-(f) in node 2

6. Upgrade the grid infrastructure from 11.2.0.1 to 11.2.0.3 using the unzipped software for 11.2.0.3

   Start the installation by using ./runInstaller




         















(b)  Run the rootupgrade.sh script as root user in node1 and node2 respectively



 [root@ol6-112-rac1 grid_1]# ./rootupgrade.sh
Performing root user operation for Oracle 11g

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /u01/app/11.2.0/grid/app/11.2.0.3/grid_1

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /u01/app/11.2.0/grid/app/11.2.0.3/grid_1/crs/install/crsconfig_params
Creating trace directory
User ignored Prerequisites during installation

There is no ASM configured.

CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'ol6-112-rac1'
CRS-2673: Attempting to stop 'ora.crsd' on 'ol6-112-rac1'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'ol6-112-rac1'
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN3.lsnr' on 'ol6-112-rac1'
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN2.lsnr' on 'ol6-112-rac1'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'ol6-112-rac1'
CRS-2677: Stop of 'ora.LISTENER_SCAN2.lsnr' on 'ol6-112-rac1' succeeded
CRS-2673: Attempting to stop 'ora.scan2.vip' on 'ol6-112-rac1'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'ol6-112-rac1' succeeded
CRS-2673: Attempting to stop 'ora.ol6-112-rac1.vip' on 'ol6-112-rac1'
CRS-2677: Stop of 'ora.LISTENER_SCAN3.lsnr' on 'ol6-112-rac1' succeeded
CRS-2673: Attempting to stop 'ora.scan3.vip' on 'ol6-112-rac1'
CRS-2677: Stop of 'ora.scan2.vip' on 'ol6-112-rac1' succeeded
CRS-2672: Attempting to start 'ora.scan2.vip' on 'ol6-112-rac2'
CRS-2677: Stop of 'ora.ol6-112-rac1.vip' on 'ol6-112-rac1' succeeded
CRS-2672: Attempting to start 'ora.ol6-112-rac1.vip' on 'ol6-112-rac2'
CRS-2677: Stop of 'ora.scan3.vip' on 'ol6-112-rac1' succeeded
CRS-2672: Attempting to start 'ora.scan3.vip' on 'ol6-112-rac2'
CRS-2676: Start of 'ora.scan2.vip' on 'ol6-112-rac2' succeeded
CRS-2672: Attempting to start 'ora.LISTENER_SCAN2.lsnr' on 'ol6-112-rac2'
CRS-2676: Start of 'ora.ol6-112-rac1.vip' on 'ol6-112-rac2' succeeded
CRS-2676: Start of 'ora.scan3.vip' on 'ol6-112-rac2' succeeded
CRS-2672: Attempting to start 'ora.LISTENER_SCAN3.lsnr' on 'ol6-112-rac2'
CRS-2676: Start of 'ora.LISTENER_SCAN2.lsnr' on 'ol6-112-rac2' succeeded
CRS-2676: Start of 'ora.LISTENER_SCAN3.lsnr' on 'ol6-112-rac2' succeeded
CRS-2673: Attempting to stop 'ora.eons' on 'ol6-112-rac1'
CRS-2673: Attempting to stop 'ora.ons' on 'ol6-112-rac1'
CRS-2677: Stop of 'ora.ons' on 'ol6-112-rac1' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'ol6-112-rac1'
CRS-2677: Stop of 'ora.net1.network' on 'ol6-112-rac1' succeeded
CRS-2677: Stop of 'ora.eons' on 'ol6-112-rac1' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'ol6-112-rac1' has completed
CRS-2677: Stop of 'ora.crsd' on 'ol6-112-rac1' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'ol6-112-rac1'
CRS-2673: Attempting to stop 'ora.cssdmonitor' on 'ol6-112-rac1'
CRS-2673: Attempting to stop 'ora.ctssd' on 'ol6-112-rac1'
CRS-2673: Attempting to stop 'ora.evmd' on 'ol6-112-rac1'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'ol6-112-rac1'
CRS-2677: Stop of 'ora.cssdmonitor' on 'ol6-112-rac1' succeeded
CRS-2677: Stop of 'ora.gpnpd' on 'ol6-112-rac1' succeeded
CRS-2677: Stop of 'ora.evmd' on 'ol6-112-rac1' succeeded
CRS-2677: Stop of 'ora.mdnsd' on 'ol6-112-rac1' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'ol6-112-rac1' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'ol6-112-rac1'
CRS-2677: Stop of 'ora.cssd' on 'ol6-112-rac1' succeeded
CRS-2673: Attempting to stop 'ora.diskmon' on 'ol6-112-rac1'
CRS-2673: Attempting to stop 'ora.gipcd' on 'ol6-112-rac1'
CRS-2677: Stop of 'ora.gipcd' on 'ol6-112-rac1' succeeded
CRS-2677: Stop of 'ora.diskmon' on 'ol6-112-rac1' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'ol6-112-rac1' has completed
CRS-4133: Oracle High Availability Services has been stopped.
OLR initialization - successful
Replacing Clusterware entries in upstart
clscfg: EXISTING configuration version 5 detected.
clscfg: version 5 is 11g Release 2.
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Preparing packages for installation...
cvuqdisk-1.0.9-1

figure Oracle Grid Infrastructure for a Cluster ... succeeded








  (c) Check crs version  
crsctl query crs releaseversion
crsctl query crs activeversion
crsctl query crs softwareversion


7.Apply the patchset update 11.2.0.3.10  to the grid infrastructure 11.2.0.3.0

       (a) Complete the  above step 3, to copy the latest opatch version in the new grid infrastructure home.
      (b)Unzip the 11.2.3.10 in an empty directory     
unzip p18139678_112030_Linux-x86-64.zip  -d  /u03/stage_grid/Upgrade/new
 (c) Create OCM response file,by default it creates where we execute emocmrsp file, So it creates ocm.rsp in $GRID_HOME/OPatch/ocm/bin
cd $GRID_HOME/OPatch/ocm/bin
./emocmrsp
(d) Run as root user
export PATH=$PATH:$GRID_HOME/OPatch
which opatch
cd /u03/stage_grid/Upgrade/new
opatch auto -oh $GRID_HOME -ocmrf $GRID_HOME/OPatch/ocm/bin/ocm.rsp
(e)The logs of opatch auto command
Executing /u01/app/11.2.0/grid/app/11.2.0.3/grid_1/perl/bin/perl /u01/app/11.2.0/grid/app/11.2.0.3/grid_1/OPatch/crs/patch11203.pl -patchdir /u03/stage_grid/Upgrade -patchn new -oh /u01/app/11.2.0/grid/app/11.2.0.3/grid_1 -ocmrf /u01/app/11.2.0/grid/app/11.2.0.3/grid_1/OPatch/ocm/bin/ocm.rsp -paramfile /u01/app/11.2.0/grid/app/11.2.0.3/grid_1/crs/install/crsconfig_params
This is the main log file: /u01/app/11.2.0/grid/app/11.2.0.3/grid_1/cfgtoollogs/opatchauto2014-05-10_13-37-05.log
This file will show your detected configuration and all the steps that opatchauto attempted to do on your system:
/u01/app/11.2.0/grid/app/11.2.0.3/grid_1/cfgtoollogs/opatchauto2014-05-10_13-37-05.report.log
2014-05-10 13:37:05: Starting Clusterware Patch Setup
Using configuration parameter file: /u01/app/11.2.0/grid/app/11.2.0.3/grid_1/crs/install/crsconfig_params
Enter 'yes' if you have unzipped this patch to an empty directory to proceed  (yes/no):yes
Enter 'yes' if you have unzipped this patch to an empty directory to proceed  (yes/no):yes
Stopping CRS...
Stopped CRS successfully
patch /u03/stage_grid/Upgrade/new/18031683  apply successful for home  /u01/app/11.2.0/grid/app/11.2.0.3/grid_1
Starting CRS...
CRS-4123: Oracle High Availability Services has been started.
opatch auto succeeded.
(f)  Run as grid user
opatch lsinventory
(g)  Perform the step (a-f) in the node2



8.Install 11.2.0.3 RDBMS Software

(a)Install the software using runInstaller



























(b) Run the root.sh  script file as root user in node1 and node2 respectively


[root@ol6-112-rac1 db_2]# ./root.sh
Performing root user operation for Oracle 11g

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/orcl/oracle/product/11.2.0.3/db_2

Enter the full pathname of the local bin directory: [/usr/local/bin]:

The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Finished product-specific root actions.


9.Apply the patchset update 11.2.0.3.10 to the RDBMS binaries
(a). Make an entry in the oratab file with the new rdbms home location like 
     dummy:/u01/app/orcl/oracle/product/11.2.0.3/db_2:N  and the source the "dummy" database using oraenv
[oracle@ol6-112-rac1 ~]$  . oraenv
ORACLE_SID = [dummy] ? dummy
The Oracle base has been set to /u01/app/orcl/oracle
[oracle@ol6-112-rac1 ~]$
(b) Complete the  above step 3, to copy the latest opatch version to the new rdbms home
(c)Export the PATH environment variable to include the opatch binary file path
export PATH=$PATH:$ORACLE_HOME/OPatch/bin
(d) Change the directory to 18031683 present in the unzipped directory of the patch p18139678_112030_Linux-x86-64.zip. and apply the patchset update 11.2.0.3.10 for new rdbms binaries. It applies for the remode node as well.
[oracle@ol6-112-rac1 18031683]$ pwd
/u03/stage_oracle/18031683/

[oracle@ol6-112-rac1 18031683]$ opatch apply
Oracle Interim Patch Installer version 11.2.0.3.6
Copyright (c) 2013, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/orcl/oracle/product/11.2.0.3/db_2
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/orcl/oracle/product/11.2.0.3/db_2/oraInst.loc
OPatch version    : 11.2.0.3.6
OUI version       : 11.2.0.3.0
Log file location : /u01/app/orcl/oracle/product/11.2.0.3/db_2/cfgtoollogs/opatch/opatch2014-05-10_15-26-51PM_1.log

Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   13343438  13696216  13923374  14275605  14727310  16056266  16619892  16902043  17540582  18031683
(e) Verify the patchset update has been applied or not
opatch lsinventory
10.Start dbua to upgrade the  11.2.0.1 database to 11.2.0.3.10









11.Detach the 11.2.0.1.0 grid home and rdbms home
(a) Detach the 11.2.0.1.0 grid home in the node1 and node2

/u01/app/11.2.0/grid/oui/bin/runInstaller -silent -detachHome -invPtrLoc /etc/oraInst.loc ORACLE_HOME="/u01/app/11.2.0/grid" ORACLE_HOME_NAME="grid_home1" CLUSTER_NODES="{ol6-112-rac1,ol6-112-rac2}" -local
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 4067 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
'DetachHome' was successful.
(b) Deatch 11.2.0.1.0 RDBMS home in node1 and node2
/u01/app/orcl/oracle/product/11.2.0/db_1/oui/bin/runInstaller -silent -detachHome -invPtrLoc /etc/oraInst.loc ORACLE_HOME="/u01/app/orcl/oracle/product/11.2.0/db_1" ORACLE_HOME_NAME="OraDb11g_home1" CLUSTER_NODES="{ol6-112-rac1,ol6-112-rac2}" –local



Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 3885 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
'DetachHome' was successful.

(c)Check the 11.2.0.1 grid and oracle home is not in the inventory
opatch lsinventory –oh old_grid_home 
opatch lsinventory –oh old_rdbms_home