Restore Oracle database from Cold backup.

Step 1: verify Backup Logs:

Backup Logs
===============================================================

including current SPFILE in backup set
channel C1: starting piece 1 at 12-07-2018 08:01:00
channel C1: finished piece 1 at 12-07-2018 08:01:01
piece handle=VIRTUALD_16tk5j9s_1_1 tag=TAG20181207T080044 comment=API 
Version 2.0,MMS Version 4.6.0.0
channel C1: backup set complete, elapsed time: 00:00:01

backup will be obsolete on date 01-06-2019 08:01:01
archived logs will not be kept or backed up
channel C1: starting compressed full datafile backup set
channel C1: specifying datafile(s) in backup set
including current control file in backup set
channel C1: starting piece 1 at 12-07-2018 08:01:02
channel C1: finished piece 1 at 12-07-2018 08:01:03
piece handle=VIRTUALD_17tk5j9t_1_1 tag=TAG20181207T080044 comment=API 
Version 2.0,MMS Version 4.6.0.0
channel C1: backup set complete, elapsed time: 00:00:01
Finished backup at 12-07-2018 08:01:03

released channel: C1

RMAN>
====================================================================

step 2: Start Database in nomount:

mkdir /u01/app/oracle/oradata/virtuald_COLD_restore


$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.4.0 Production on Fri Dec 7 08:09:32 2018

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

Connected to an idle instance.

SQL> startup force nomount 
pfile='/u01/app/oracle/oradata/virtuald_COLD_restore/initvirtuald.ora';
ORACLE instance started.

Total System Global Area  217157632 bytes
Fixed Size                  2251816 bytes
Variable Size             159384536 bytes
Database Buffers           50331648 bytes
Redo Buffers                5189632 bytes
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition 
Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and 
Real Application Testing options
oracle@oratst0001 ():/u01/app/oracle/oradata/virtuald_COLD_restore 0
=====================================================================


Step 3: Restore SPFILE:
restore SPFILE
===============================

$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Fri Dec 7 19:03:56 2018

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

connected to target database: VIRTUALD (not mounted)

RMAN> run
2> {
3> set dbid 1142008032;
4>  ALLOCATE CHANNEL C1 DEVICE TYPE SBT_TAPE PARMS 'BLKSIZE=1048576, 
    SBT_LIBRARY=/opt/dpsapps/dbappagent/lib/lib64/libddboostora.so,
    SBT_PARMS=(CONFIG_FILE=/opt/dpsapps/dbappagent/config/oracle_ddbda.cfg)' 
    FORMAT '%d_%U';
5>  restore spfile to
   '/u01/app/oracle/oradata/virtuald_COLD_restore/spfilevirtuald.ora' 
   from 'VIRTUALD_16tk5j9s_1_1';
6> release channel C1;
7> }

executing command: SET DBID

using target database control file instead of recovery catalog
allocated channel: C1
channel C1: SID=19 device type=SBT_TAPE
channel C1: Database Application Agent Oracle v4.6.0.0

Starting restore at 07-DEC-18

channel C1: restoring spfile from AUTOBACKUP VIRTUALD_16tk5j9s_1_1
channel C1: SPFILE restore from AUTOBACKUP complete
Finished restore at 07-DEC-18

released channel: C1

RMAN>


Step 4: Shutdown Immediate:

shutdown 
===================================
shut immediate


Step 5: Start the instance with SPFILE:

start the instance with this SPFILE in nomount state
=======================================================

SQL> !cat /u01/app/oracle/oradata/virtuald_COLD_restore/init.ora
spfile='/u01/app/oracle/oradata/virtuald_COLD_restore/spfilevirtuald.ora'


$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.4.0 Production on Fri Dec 7 19:15:54 2018

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

Connected to an idle instance.

SQL>  startup nomount 
      pfile='/u01/app/oracle/oradata/virtuald_COLD_restore/init.ora';
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.

Total System Global Area 1068937216 bytes
Fixed Size                  2260088 bytes
Variable Size             331350920 bytes
Database Buffers          729808896 bytes
Redo Buffers                5517312 bytes
SQL>


Step 6: Restore the controlfile:
restore the controlfile
=======================

rman target /
RMAN> run
2> {
3> ALLOCATE CHANNEL C1 DEVICE TYPE SBT_TAPE PARMS 'BLKSIZE=1048576, 
   SBT_LIBRARY=/opt/dpsapps/dbappagent/lib/lib64/libddboostora.so,
   SBT_PARMS=(CONFIG_FILE=/opt/dpsapps/dbappagent/config/oracle_ddbda.cfg)' 
   FORMAT '%d_%U';
4> restore controlfile to
   '/u01/app/oracle/oradata/virtuald_COLD_restore/virtuald_cntrl.ctl' 
   from 'VIRTUALD_17tk5j9t_1_1';
5> release channel C1;
6> }

allocated channel: C1
channel C1: SID=19 device type=SBT_TAPE
channel C1: Database Application Agent Oracle v4.6.0.0

Starting restore at 07-DEC-18

channel C1: restoring control file
channel C1: restore complete, elapsed time: 00:00:01
Finished restore at 07-DEC-18

released channel: C1

RMAN>

Step 7: Shutdown the Database:

shutdown the instance
==============================
shut immediate


Step 8: Change parameters in initvirtual.ora:
change parameters to point to new location
==========================================
$strings spfile initvirtual.ora

mkdir /u01/app/oracle/oradata/virtuald_COLD_restore/fast_recovery_area

new values
=========================
*.control_files='/u01/app/oracle/oradata/virtuald_COLD_restore/control01.ctl'
*.db_recovery_file_dest=
  '/u01/app/oracle/oradata/virtuald_COLD_restore/fast_recovery_area'


step 9: start the instance in mount mode:
start the instance in mount state
========================================
SQL>  startup mount 
pfile='/u01/app/oracle/oradata/virtuald_COLD_restore/initvirtual.ora';
ORA-32006: LOG_ARCHIVE_START initialization parameter has been deprecated
ORA-32006: REMOTE_OS_AUTHENT initialization parameter has been deprecated
ORACLE instance started.

Total System Global Area 1068937216 bytes
Fixed Size                  2260088 bytes
Variable Size             331350920 bytes
Database Buffers          729808896 bytes
Redo Buffers                5517312 bytes
Database mounted.
SQL>


Step 10: Restore the Datafiles to new location:
restore the datafiles to new location
==========================================
$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Sat Dec 8 11:17:17 2018

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

connected to target database: VIRTUALD (DBID=1142008032, not open)

RMAN> run
2> {
3> ALLOCATE CHANNEL C1 DEVICE TYPE SBT_TAPE PARMS 'BLKSIZE=1048576, 
   SBT_LIBRARY=/opt/dpsapps/dbappagent/lib/lib64/libddboostora.so,
   SBT_PARMS=(CONFIG_FILE=/opt/dpsapps/dbappagent/config/oracle_ddbda.cfg)' FORMAT '%d_%U';
4> set newname for datafile 1 to '/u01/app/oracle/oradata/virtuald_COLD_restore/system01.dbf' ;
5> set newname for datafile 2 to '/u01/app/oracle/oradata/virtuald_COLD_restore/sysaux01.dbf' ;
6> set newname for datafile 3 to '/u01/app/oracle/oradata/virtuald_COLD_restore/undotbs01.dbf';
7> set newname for datafile 4 to '/u01/app/oracle/oradata/virtuald_COLD_restore/users01.dbf';
8> set newname for tempfile '/u01/app/oracle/oradata/virtuald/virtuald_new/temp01.dbf' to
  '/u01/app/oracle/oradata/virtuald_COLD_restore/temp01.dbf' ;
9> restore database;
10> switch datafile all;
11> switch tempfile all;
12> release channel C1;
13> }

using target database control file instead of recovery catalog
allocated channel: C1
channel C1: SID=20 device type=SBT_TAPE
channel C1: Database Application Agent Oracle v4.6.0.0

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 08-DEC-18
Starting implicit crosscheck backup at 08-DEC-18
Crosschecked 3 objects
Finished implicit crosscheck backup at 08-DEC-18

Starting implicit crosscheck copy at 08-DEC-18
Finished implicit crosscheck copy at 08-DEC-18

searching for all files in the recovery area
cataloging files...
no files cataloged


channel C1: starting datafile backup set restore
channel C1: specifying datafile(s) to restore from backup set
channel C1: restoring datafile 00001 to
            /u01/app/oracle/oradata/virtuald_COLD_restore/system01.dbf
channel C1: restoring datafile 00002 to
            /u01/app/oracle/oradata/virtuald_COLD_restore/sysaux01.dbf
channel C1: restoring datafile 00003 to
            /u01/app/oracle/oradata/virtuald_COLD_restore/undotbs01.dbf
channel C1: restoring datafile 00004 to
            /u01/app/oracle/oradata/virtuald_COLD_restore/users01.dbf
channel C1: reading from backup piece VIRTUALD_15tk5j9c_1_1

channel C1: piece handle=VIRTUALD_15tk5j9c_1_1 tag=TAG20181207T080044
channel C1: restored backup piece 1
channel C1: restore complete, elapsed time: 00:00:25
Finished restore at 08-DEC-18

datafile 1 switched to datafile copy
input datafile copy RECID=13 STAMP=994332903 file 
name=/u01/app/oracle/oradata/virtuald_COLD_restore/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=14 STAMP=994332903 file 
name=/u01/app/oracle/oradata/virtuald_COLD_restore/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=15 STAMP=994332903 file 
name=/u01/app/oracle/oradata/virtuald_COLD_restore/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=16 STAMP=994332903 file 
name=/u01/app/oracle/oradata/virtuald_COLD_restore/users01.dbf

renamed tempfile 1 to
 /u01/app/oracle/oradata/virtuald_COLD_restore/temp01.dbf in control file

released channel: C1

RMAN>

============================================================================

step 11: Rename Redo log Files:
RMAN> sql "alter database rename file
     ''/u01/app/oracle/oradata/virtuald/virtuald_new/redo01.log'' to
     ''/u01/app/oracle/oradata/virtuald_COLD_restore/redo01.rdo'' ";

sql statement: alter database rename file
    ''/u01/app/oracle/oradata/virtuald/virtuald_new/redo01.log'' to
    ''/u01/app/oracle/oradata/virtuald_COLD_restore/redo01.rdo''

RMAN> sql "alter database rename file
      ''/u01/app/oracle/oradata/virtuald/virtuald_new/redo02.log'' to
      ''/u01/app/oracle/oradata/virtuald_COLD_restore/redo02.rdo'' ";

sql statement: alter database rename file
    ''/u01/app/oracle/oradata/virtuald/virtuald_new/redo02.log'' to
    ''/u01/app/oracle/oradata/virtuald_COLD_restore/redo02.rdo''

RMAN> sql "alter database rename file
      ''/u01/app/oracle/oradata/virtuald/virtuald_new/redo03.log'' to
      ''/u01/app/oracle/oradata/virtuald_COLD_restore/redo03.rdo'' ";

sql statement: alter database rename file
    ''/u01/app/oracle/oradata/virtuald/virtuald_new/redo03.log'' to
    ''/u01/app/oracle/oradata/virtuald_COLD_restore/redo03.rdo''

RMAN>

============================================================

Step 12: Open Database with Reset Logs:
$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.4.0 Production on Sat Dec 8 11:40:22 2018

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, OLAP, Data Mining and Real Application Testing options

SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open


SQL> alter database open resetlogs;

Database altered.

SQL>
====================================================================

Step 13: verify the Database Files:

files in new location
===============================


SQL> select name from v$controlfile;

NAME
---------------------------------------------------------------------
/u01/app/oracle/oradata/virtuald_COLD_restore/control01.ctl

SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------
/u01/app/oracle/oradata/virtuald_COLD_restore/system01.dbf
/u01/app/oracle/oradata/virtuald_COLD_restore/sysaux01.dbf
/u01/app/oracle/oradata/virtuald_COLD_restore/undotbs01.dbf
/u01/app/oracle/oradata/virtuald_COLD_restore/users01.dbf

SQL> select name from v$tempfile;

NAME
-----------------------------------------------------------------------
/u01/app/oracle/oradata/virtuald_COLD_restore/temp01.dbf

SQL> select member from v$logfile;

MEMBER
-----------------------------------------------------------------------
/u01/app/oracle/oradata/virtuald_COLD_restore/redo01.rdo
/u01/app/oracle/oradata/virtuald_COLD_restore/redo02.rdo
/u01/app/oracle/oradata/virtuald_COLD_restore/redo03.rdo

SQL>
=========================================================


See Also:

Oracle Database backup configurations.
Oracle DB COLD backup using DD Boost data domain
Oracle DB HOT backup using DD boost data domain
Oracle DB Archive backup using DD boost data domain
Restore Oracle database from Cold backup
Restore and recovering the Oracle database
oracle.com