Thursday, 14 November 2019

RAC - Restore RAC RMAN Backup linux to Single Instance Window database 12c

#######################################################################

RMAN Backup - 2 node RAC 12.1.0.2.0 version on OEL 6.7 linux operating system.

RMAN  Restore - Single instance on window server.



HowTo Restore RMAN Disk backups of RAC Database to Single Instance On Another Node (Doc ID 415579.1)
#######################################################################
C:\Users\varunyadav>sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Wed Nov 13 17:24:56 2019

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

Connected to an idle instance.

SQL> startup nomount;
ORACLE instance started.

Total System Global Area 2298478592 bytes
Fixed Size                  3834584 bytes
Variable Size             905973032 bytes
Database Buffers         1375731712 bytes
Redo Buffers               12939264 bytes
SQL>
SQL>
SQL> alter database mount;

Database altered.

SQL>
####################################################################

C:\Users\varunyadav>rman target /

Recovery Manager: Release 12.1.0.2.0 - Production on Wed Nov 13 17:25:50 2019

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

connected to target database: RAC (not mounted)

RMAN> restore controlfile from 'C:\varun_docs\rman_bkp_rac\control01_cf_d-rac_id-2608333762_35ugp2l6.bak';

Starting restore at 13-NOV-19
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=577 device type=DISK

channel ORA_DISK_1: copied control file copy
output file name=C:\APP\VARUNYADAV\ORADATA\RAC\CONTROL01.CTL
output file name=C:\APP\VARUNYADAV\FAST_RECOVERY_AREA\RAC\CONTROL02.CTL
Finished restore at 13-NOV-19

RMAN> catalog start with 'C:\varun_docs\rman_bkp_rac';

released channel: ORA_DISK_1
Starting implicit crosscheck backup at 13-NOV-19
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=577 device type=DISK
Crosschecked 21 objects
Finished implicit crosscheck backup at 13-NOV-19

Starting implicit crosscheck copy at 13-NOV-19
using channel ORA_DISK_1
Finished implicit crosscheck copy at 13-NOV-19

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

List of Cataloged Files
=======================
File Name: C:\APP\VARUNYADAV\FAST_RECOVERY_AREA\RAC\ARCHIVELOG\2019_11_13\O1_MF_1_6_GWQH7CGR_.ARC

searching for all files that match the pattern C:\varun_docs\rman_bkp_rac

List of Files Unknown to the Database
=====================================
File Name: C:\VARUN_DOCS\RMAN_BKP_RAC\BACKUP_RAC_DB_2OUGP2DN_88_1_20191113
File Name: C:\VARUN_DOCS\RMAN_BKP_RAC\BACKUP_RAC_DB_2PUGP2DO_89_1_20191113
File Name: C:\VARUN_DOCS\RMAN_BKP_RAC\BACKUP_RAC_DB_2QUGP2E7_90_1_20191113
File Name: C:\VARUN_DOCS\RMAN_BKP_RAC\BACKUP_RAC_DB_2RUGP2EM_91_1_20191113
File Name: C:\VARUN_DOCS\RMAN_BKP_RAC\BACKUP_RAC_DB_2SUGP2F9_92_1_20191113
File Name: C:\VARUN_DOCS\RMAN_BKP_RAC\BACKUP_RAC_DB_33UGP2L4_99_1_20191113
File Name: C:\VARUN_DOCS\RMAN_BKP_RAC\BACKUP_RAC_DB_34UGP2L4_100_1_20191113
File Name: C:\VARUN_DOCS\RMAN_BKP_RAC\CONTROL01_CF_D-RAC_ID-2608333762_35UGP2L6.BAK
File Name: C:\VARUN_DOCS\RMAN_BKP_RAC\RAC_2TUGP2FU_1_1.BCKP
File Name: C:\VARUN_DOCS\RMAN_BKP_RAC\RAC_2UUGP2FU_1_1.BCKP
File Name: C:\VARUN_DOCS\RMAN_BKP_RAC\RAC_2VUGP2FU_1_1.BCKP
File Name: C:\VARUN_DOCS\RMAN_BKP_RAC\RAC_30UGP2G0_1_1.BCKP
File Name: C:\VARUN_DOCS\RMAN_BKP_RAC\RAC_31UGP2H7_1_1.BCKP
File Name: C:\VARUN_DOCS\RMAN_BKP_RAC\RAC_32UGP2HE_1_1.BCKP
File Name: C:\VARUN_DOCS\RMAN_BKP_RAC\STANDBYCONTROL_36UGP2LD_1_1.CTL

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

Do you really want to catalog the above files (enter YES or NO)? YEs
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: C:\VARUN_DOCS\RMAN_BKP_RAC\BACKUP_RAC_DB_2OUGP2DN_88_1_20191113
File Name: C:\VARUN_DOCS\RMAN_BKP_RAC\BACKUP_RAC_DB_2PUGP2DO_89_1_20191113
File Name: C:\VARUN_DOCS\RMAN_BKP_RAC\BACKUP_RAC_DB_2QUGP2E7_90_1_20191113
File Name: C:\VARUN_DOCS\RMAN_BKP_RAC\BACKUP_RAC_DB_2RUGP2EM_91_1_20191113
File Name: C:\VARUN_DOCS\RMAN_BKP_RAC\BACKUP_RAC_DB_2SUGP2F9_92_1_20191113
File Name: C:\VARUN_DOCS\RMAN_BKP_RAC\BACKUP_RAC_DB_33UGP2L4_99_1_20191113
File Name: C:\VARUN_DOCS\RMAN_BKP_RAC\BACKUP_RAC_DB_34UGP2L4_100_1_20191113
File Name: C:\VARUN_DOCS\RMAN_BKP_RAC\CONTROL01_CF_D-RAC_ID-2608333762_35UGP2L6.BAK
File Name: C:\VARUN_DOCS\RMAN_BKP_RAC\RAC_2TUGP2FU_1_1.BCKP
File Name: C:\VARUN_DOCS\RMAN_BKP_RAC\RAC_2UUGP2FU_1_1.BCKP
File Name: C:\VARUN_DOCS\RMAN_BKP_RAC\RAC_2VUGP2FU_1_1.BCKP
File Name: C:\VARUN_DOCS\RMAN_BKP_RAC\RAC_30UGP2G0_1_1.BCKP
File Name: C:\VARUN_DOCS\RMAN_BKP_RAC\RAC_31UGP2H7_1_1.BCKP
File Name: C:\VARUN_DOCS\RMAN_BKP_RAC\RAC_32UGP2HE_1_1.BCKP
File Name: C:\VARUN_DOCS\RMAN_BKP_RAC\STANDBYCONTROL_36UGP2LD_1_1.CTL

RMAN> RUN
2> {
3> set newname for datafile 1 to "C:\app\varunyadav\oradata\rac\system01.dbf";
4> set newname for datafile 3 to "C:\app\varunyadav\oradata\rac\sysaux01.dbf";
5> set newname for datafile 4 to "C:\app\varunyadav\oradata\rac\undotbs01.dbf";
6> set newname for datafile 5 to "C:\app\varunyadav\oradata\rac\undotbs02.dbf";
7> set newname for datafile 2 to "C:\app\varunyadav\oradata\rac\idata01.dbf";
8> set newname for datafile 6 to "C:\app\varunyadav\oradata\rac\users01.dbf";
9> set newname for datafile 7 to "C:\app\varunyadav\oradata\rac\ilog01.dbf";
10> set newname for datafile 8 to "C:\app\varunyadav\oradata\rac\indx01.dbf";
11> set newname for tempfile 1 to "C:\app\varunyadav\oradata\rac\temp01.dbf";
12> RESTORE DATABASE;
13> SWITCH DATAFILE ALL;
14> SWITCH TEMPFILE ALL;
15> recover database;
16> }

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 13-NOV-19
using channel ORA_DISK_1

skipping datafile 1; already restored to file C:\app\varunyadav\oradata\rac\system01.dbf
skipping datafile 3; already restored to file C:\app\varunyadav\oradata\rac\sysaux01.dbf
skipping datafile 2; already restored to file C:\app\varunyadav\oradata\rac\idata01.dbf
skipping datafile 4; already restored to file C:\app\varunyadav\oradata\rac\undotbs01.dbf
skipping datafile 5; already restored to file C:\app\varunyadav\oradata\rac\undotbs02.dbf
skipping datafile 7; already restored to file C:\app\varunyadav\oradata\rac\ilog01.dbf
skipping datafile 6; already restored to file C:\app\varunyadav\oradata\rac\users01.dbf
skipping datafile 8; already restored to file C:\app\varunyadav\oradata\rac\indx01.dbf
restore not done; all files read only, offline, or already restored
Finished restore at 13-NOV-19

datafile 1 switched to datafile copy
input datafile copy RECID=12 STAMP=1024248929 file name=C:\app\varunyadav\oradata\rac\system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=13 STAMP=1024248931 file name=C:\app\varunyadav\oradata\rac\idata01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=14 STAMP=1024248932 file name=C:\app\varunyadav\oradata\rac\sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=15 STAMP=1024248933 file name=C:\app\varunyadav\oradata\rac\undotbs01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=16 STAMP=1024248934 file name=C:\app\varunyadav\oradata\rac\undotbs02.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=17 STAMP=1024248935 file name=C:\app\varunyadav\oradata\rac\users01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=18 STAMP=1024248937 file name=C:\app\varunyadav\oradata\rac\ilog01.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=19 STAMP=1024248939 file name=C:\app\varunyadav\oradata\rac\indx01.dbf

renamed tempfile 1 to C:\app\varunyadav\oradata\rac\temp01.dbf in control file

Starting recover at 13-NOV-19
using channel ORA_DISK_1

starting media recovery

channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=2 sequence=536
channel ORA_DISK_1: reading from backup piece C:\VARUN_DOCS\RMAN_BKP_RAC\BACKUP_RAC_DB_34UGP2L4_100_1_20191113
channel ORA_DISK_1: piece handle=C:\VARUN_DOCS\RMAN_BKP_RAC\BACKUP_RAC_DB_34UGP2L4_100_1_20191113 tag=TAG20191113T125500
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=492
channel ORA_DISK_1: reading from backup piece C:\VARUN_DOCS\RMAN_BKP_RAC\BACKUP_RAC_DB_33UGP2L4_99_1_20191113
channel ORA_DISK_1: piece handle=C:\VARUN_DOCS\RMAN_BKP_RAC\BACKUP_RAC_DB_33UGP2L4_99_1_20191113 tag=TAG20191113T125500
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=C:\APP\VARUNYADAV\FAST_RECOVERY_AREA\RAC\ARCHIVELOG\2019_11_13\O1_MF_1_492_GWQWMHM5_.ARC thread=1 sequence=492
archived log file name=C:\APP\VARUNYADAV\FAST_RECOVERY_AREA\RAC\ARCHIVELOG\2019_11_13\O1_MF_2_536_GWQWMGF5_.ARC thread=2 sequence=536
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 11/13/2019 17:50:22
RMAN-11003: failure during parse/execution of SQL statement: alter database recover logfile 'C:\APP\VARUNYADAV\FAST_RECOVERY_AREA\RAC\ARCHIVELOG\2019_11_13\O1_MF_2_536_GWQWMGF5_.ARC'
ORA-10878: parallel recovery slave died unexpectedly

RMAN>

RMAN> SQL "ALTER DATABASE RENAME FILE ''+DATA/RAC/ONLINELOG/group_1.275.1020351751''  to  ''C:\app\varunyadav\oradata\rac\redo01.log'' ";

sql statement: ALTER DATABASE RENAME FILE ''+DATA/RAC/ONLINELOG/group_1.275.1020351751''  to  ''C:\app\varunyadav\oradata\rac\redo01.log''

RMAN> SQL "ALTER DATABASE RENAME FILE ''+FRA/RAC/ONLINELOG/group_1.262.1020351753''  to  ''C:\app\varunyadav\oradata\rac\redo02.log'' ";

sql statement: ALTER DATABASE RENAME FILE ''+FRA/RAC/ONLINELOG/group_1.262.1020351753''  to  ''C:\app\varunyadav\oradata\rac\redo02.log''

RMAN> SQL "ALTER DATABASE RENAME FILE ''+FRA/RAC/ONLINELOG/group_2.263.1020351755''  to  ''C:\app\varunyadav\oradata\rac\redo03.log'' ";

sql statement: ALTER DATABASE RENAME FILE ''+FRA/RAC/ONLINELOG/group_2.263.1020351755''  to  ''C:\app\varunyadav\oradata\rac\redo03.log''

RMAN> SQL "ALTER DATABASE RENAME FILE ''+DATA/RAC/ONLINELOG/group_2.276.1020351753''  to  ''C:\app\varunyadav\oradata\rac\redo04.log'' ";

sql statement: ALTER DATABASE RENAME FILE ''+DATA/RAC/ONLINELOG/group_2.276.1020351753''  to  ''C:\app\varunyadav\oradata\rac\redo04.log''

RMAN> SQL "ALTER DATABASE RENAME FILE ''+FRA/RAC/ONLINELOG/group_3.264.1020352333''  to  ''C:\app\varunyadav\oradata\rac\redo05.log'' ";

sql statement: ALTER DATABASE RENAME FILE ''+FRA/RAC/ONLINELOG/group_3.264.1020352333''  to  ''C:\app\varunyadav\oradata\rac\redo05.log''

RMAN> SQL "ALTER DATABASE RENAME FILE ''+DATA/RAC/ONLINELOG/group_3.280.1020352333''  to  ''C:\app\varunyadav\oradata\rac\redo06.log'' ";

sql statement: ALTER DATABASE RENAME FILE ''+DATA/RAC/ONLINELOG/group_3.280.1020352333''  to  ''C:\app\varunyadav\oradata\rac\redo06.log''

RMAN> SQL "ALTER DATABASE RENAME FILE ''+FRA/RAC/ONLINELOG/group_4.265.1020352335''  to  ''C:\app\varunyadav\oradata\rac\redo07.log'' ";

sql statement: ALTER DATABASE RENAME FILE ''+FRA/RAC/ONLINELOG/group_4.265.1020352335''  to  ''C:\app\varunyadav\oradata\rac\redo07.log''

RMAN> SQL "ALTER DATABASE RENAME FILE ''+DATA/RAC/ONLINELOG/group_4.281.1020352333''  to  ''C:\app\varunyadav\oradata\rac\redo08.log'' ";

sql statement: ALTER DATABASE RENAME FILE ''+DATA/RAC/ONLINELOG/group_4.281.1020352333''  to  ''C:\app\varunyadav\oradata\rac\redo08.log''

RMAN>
RMAN>

RMAN>

RMAN> alter database open resetlogs;

Statement processed

RMAN>
RMAN> alter database open resetlogs;

Statement processed

RMAN> select name,open_mode,database_role from v$database;

NAME      OPEN_MODE            DATABASE_ROLE
--------- -------------------- ----------------
RAC       READ WRITE           PRIMARY

RMAN> select member from v$logfile;



MEMBER
--------------------------------------------------------------------------------

C:\APP\VARUNYADAV\ORADATA\RAC\REDO04.LOG


C:\APP\VARUNYADAV\ORADATA\RAC\REDO03.LOG


C:\APP\VARUNYADAV\ORADATA\RAC\REDO01.LOG


C:\APP\VARUNYADAV\ORADATA\RAC\REDO02.LOG


C:\APP\VARUNYADAV\ORADATA\RAC\REDO06.LOG


C:\APP\VARUNYADAV\ORADATA\RAC\REDO05.LOG


C:\APP\VARUNYADAV\ORADATA\RAC\REDO08.LOG


C:\APP\VARUNYADAV\ORADATA\RAC\REDO07.LOG


8 rows selected

RMAN> select name from v$datafile;



NAME
--------------------------------------------------------------------------------

C:\APP\VARUNYADAV\ORADATA\RAC\SYSTEM01.DBF


C:\APP\VARUNYADAV\ORADATA\RAC\IDATA01.DBF


C:\APP\VARUNYADAV\ORADATA\RAC\SYSAUX01.DBF


C:\APP\VARUNYADAV\ORADATA\RAC\UNDOTBS01.DBF


C:\APP\VARUNYADAV\ORADATA\RAC\UNDOTBS02.DBF


C:\APP\VARUNYADAV\ORADATA\RAC\USERS01.DBF


C:\APP\VARUNYADAV\ORADATA\RAC\ILOG01.DBF


C:\APP\VARUNYADAV\ORADATA\RAC\INDX01.DBF


8 rows selected

RMAN>

C:\Users\varunyadav>sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Thu Nov 14 19:23:07 2019

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> select name,open_mode,database_Role from v$database;

NAME      OPEN_MODE            DATABASE_ROLE
--------- -------------------- ----------------
RAC       READ WRITE           PRIMARY

SQL> select THREAD#, STATUS, ENABLED from v$thread;

   THREAD# STATUS ENABLED
---------- ------ --------
         1 OPEN   PUBLIC
         2 CLOSED PUBLIC

SQL> select group# from v$log where THREAD#=2;

    GROUP#
----------
         3
         4

SQL> alter database disable thread 2;

Database altered.

SQL> alter database clear unarchived logfile group 3;

Database altered.

SQL> alter database clear unarchived logfile group 4;

Database altered.

SQL> select THREAD#, STATUS, ENABLED from v$thread;

   THREAD# STATUS ENABLED
---------- ------ --------
         1 OPEN   PUBLIC
         2 CLOSED DISABLED

SQL> sho parameter undo;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
temp_undo_enabled                    boolean     FALSE
undo_management                      string      AUTO
undo_retention                       integer     900
undo_tablespace                      string      UNDOTBS1
SQL> select tablespace_name from dba_tablespaces where contents='UNDO';

TABLESPACE_NAME
------------------------------
UNDOTBS1
UNDOTBS2

SQL> drop tablespace UNDOTBS2 including contents and datafiles;

Tablespace dropped.

SQL> select name from v$tempfile;

NAME
--------------------------------------------------------------------------------
C:\APP\VARUNYADAV\ORADATA\RAC\TEMP01.DBF

SQL> select tablespace_name from dba_tablespaces where contents='TEMPORARY';

TABLESPACE_NAME
------------------------------
TEMP

SQL> create temporary tablespace TEMP1 tempfile 'C:\APP\VARUNYADAV\ORADATA\RAC\TEMP001.DBF' size 50M;

Tablespace created.

SQL> alter database default temporary tablespace TEMP1;

Database altered.

SQL> drop tablespace TEMP including contents and datafiles;

Tablespace dropped.

SQL>

SQL> select tablespace_name from dba_tablespaces where contents='TEMPORARY';

TABLESPACE_NAME
------------------------------
TEMP1

SQL>

No comments:

Post a Comment