Cloning a Standalone database using RMAN Backup pieces
I am making this article to create copy of current PROD database in another server using RMAN backup pieces for testing and development purposes.
i have used a simple method to perform clone database.
Server details :
Source :
1 2 3 |
IP Address :192.168.0.101 Database name : NONRAC Instance name : nonrac |
Target :
1 |
IP Address :192.168.0.102 |
Implementation :
Step 1:
In Source database, we need check all the details of database like, Archive log mode, DB name, Instance and datafile location.
1 2 3 4 |
SQL> select name from v$database; NAME --------- NONRAC |
1 2 3 4 |
SQL> select instance_name from v$instance; INSTANCE_NAME --------------- nonrac |
1 2 3 4 5 6 7 8 9 10 11 12 |
SQL> select name from v$datafile; NAME -------------------------------------------------------------------------------- /u01/oradata/nonrac/nonrac/system01.dbf /u01/oradata/nonrac/nonrac/mgmt_ecm_depot1.dbf /u01/oradata/nonrac/nonrac/sysaux01.dbf /u01/oradata/nonrac/nonrac/undotbs01.dbf /u01/oradata/nonrac/nonrac/example01.dbf /u01/oradata/nonrac/nonrac/users01.dbf /u01/oradata/nonrac/nonrac/mgmt.dbf /u01/oradata/nonrac/nonrac/mgmt_deepdive.dbf 8 rows selected. |
1 2 3 4 5 6 7 |
SQL> archive log list Database log mode Archive Mode Automatic archival Enabled Archive destination /u01/oradata/nonrac/arch Oldest online log sequence 214 Next log sequence to archive 216 Current log sequence 216 |
1 2 3 4 |
SQL> show parameter spfile NAME TYPE VALUE ----------------------- ----------- ------------------------------ spfile string /oraeng/app/oracle/product/12.1.0/dbs/spfilenonrac.ora |
Step 2:
We required to setup the parameters for RMAN like below.
Connect to RMAN
1 |
rman target / |
1 2 3 4 5 6 |
RMAN> CONFIGURE BACKUP OPTIMIZATION ON; old RMAN configuration parameters: CONFIGURE BACKUP OPTIMIZATION OFF; new RMAN configuration parameters: CONFIGURE BACKUP OPTIMIZATION ON; new RMAN configuration parameters are successfully stored |
1 2 3 4 5 6 |
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON; old RMAN configuration parameters: CONFIGURE CONTROLFILE AUTOBACKUP OFF; new RMAN configuration parameters: CONFIGURE CONTROLFILE AUTOBACKUP ON; new RMAN configuration parameters are successfully stored |
1 2 3 4 5 6 |
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u01/oradata/nonrac/rman/%F.ctl'; old RMAN configuration parameters: CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u01/oradata/nonrac/rman/%F.ctl'; new RMAN configuration parameters: CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u01/oradata/nonrac/rman/%F.ctl'; new RMAN configuration parameters are successfully stored |
1 2 3 4 5 6 |
RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET; old RMAN configuration parameters: CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET; new RMAN configuration parameters: CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET; new RMAN configuration parameters are successfully stored |
1 2 3 4 5 6 |
RMAN> CONFIGURE CHANNEL 1 DEVICE TYPE DISK FORMAT '/u01/oradata/nonrac/rman/%U.bkp'; old RMAN configuration parameters: CONFIGURE CHANNEL 1 DEVICE TYPE DISK FORMAT '/u01/oradata/nonrac/rman/%U.bkp'; new RMAN configuration parameters: CONFIGURE CHANNEL 1 DEVICE TYPE DISK FORMAT '/u01/oradata/nonrac/rman/%U.bkp'; new RMAN configuration parameters are successfully stored |
1 2 3 4 5 6 |
RMAN> CONFIGURE CHANNEL 2 DEVICE TYPE DISK FORMAT '/u01/oradata/nonrac/rman/%U.bkp'; old RMAN configuration parameters: CONFIGURE CHANNEL 2 DEVICE TYPE DISK FORMAT '/u01/oradata/nonrac/rman/%U.bkp'; new RMAN configuration parameters: CONFIGURE CHANNEL 2 DEVICE TYPE DISK FORMAT '/u01/oradata/nonrac/rman/%U.bkp'; new RMAN configuration parameters are successfully stored |
Check with show all command.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
RMAN> show all; RMAN configuration parameters for database with db_unique_name NONRAC are: CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default CONFIGURE BACKUP OPTIMIZATION ON; CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default CONFIGURE CONTROLFILE AUTOBACKUP ON; CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u01/oradata/nonrac/rman/%F.ctl'; CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET; CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE CHANNEL 1 DEVICE TYPE DISK FORMAT '/u01/oradata/nonrac/rman/%U.bkp'; CONFIGURE CHANNEL 2 DEVICE TYPE DISK FORMAT '/u01/oradata/nonrac/rman/%U.bkp'; CONFIGURE MAXSETSIZE TO UNLIMITED; # default CONFIGURE ENCRYPTION FOR DATABASE OFF; # default CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default CONFIGURE RMAN OUTPUT TO KEEP FOR 7 DAYS; # default CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/oradata/nonrac/rman/snapshot.f'; |
Note : Before taking the backup ,execute below commands in RMAN prompt for validate previous backups and archive logs.
1 2 |
crosscheck archivelog all; crosscheck backup; |
Step 3 :
Take the backup of database using compress backupset.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
RMAN> backup as compressed backupset tag incr0_backup_dbfiles incremental level 0 database; Starting backup at 16-SEP-20 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=61 device type=DISK allocated channel: ORA_DISK_2 channel ORA_DISK_2: SID=77 device type=DISK channel ORA_DISK_1: starting compressed incremental level 0 datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00007 name=/u01/oradata/nonrac/nonrac/mgmt.dbf input datafile file number=00003 name=/u01/oradata/nonrac/nonrac/sysaux01.dbf input datafile file number=00006 name=/u01/oradata/nonrac/nonrac/users01.dbf input datafile file number=00002 name=/u01/oradata/nonrac/nonrac/mgmt_ecm_depot1.dbf channel ORA_DISK_1: starting piece 1 at 16-SEP-20 channel ORA_DISK_2: starting compressed incremental level 0 datafile backup set channel ORA_DISK_2: specifying datafile(s) in backup set input datafile file number=00005 name=/u01/oradata/nonrac/nonrac/example01.dbf input datafile file number=00004 name=/u01/oradata/nonrac/nonrac/undotbs01.dbf input datafile file number=00001 name=/u01/oradata/nonrac/nonrac/system01.dbf input datafile file number=00008 name=/u01/oradata/nonrac/nonrac/mgmt_deepdive.dbf channel ORA_DISK_2: starting piece 1 at 16-SEP-20 channel ORA_DISK_2: finished piece 1 at 16-SEP-20 piece handle=/u01/oradata/nonrac/rman/0fvaj5el_1_1.bkp tag=INCR0_BACKUP_DBFILES comment=NONE channel ORA_DISK_2: backup set complete, elapsed time: 00:03:45 channel ORA_DISK_1: finished piece 1 at 16-SEP-20 piece handle=/u01/oradata/nonrac/rman/0evaj5el_1_1.bkp tag=INCR0_BACKUP_DBFILES comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:04:35 Finished backup at 16-SEP-20 Starting Control File and SPFILE Autobackup at 16-SEP-20 piece handle=/u01/oradata/nonrac/rman/c-3871636852-20200916-02.ctl comment=NONE Finished Control File and SPFILE Autobackup at 16-SEP-20 |
Take the backup of archive logs as below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
RMAN> backup as backupset tag incr0_backup_archlogs archivelog all; Starting backup at 16-SEP-20 current log archived using channel ORA_DISK_1 using channel ORA_DISK_2 channel ORA_DISK_1: starting archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=218 RECID=214 STAMP=1051300839 channel ORA_DISK_1: starting piece 1 at 16-SEP-20 channel ORA_DISK_2: starting archived log backup set channel ORA_DISK_2: specifying archived log(s) in backup set input archived log thread=1 sequence=228 RECID=224 STAMP=1051300857 input archived log thread=1 sequence=229 RECID=225 STAMP=1051300857 input archived log thread=1 sequence=230 RECID=226 STAMP=1051300857 input archived log thread=1 sequence=231 RECID=227 STAMP=1051300860 input archived log thread=1 sequence=232 RECID=228 STAMP=1051300860 input archived log thread=1 sequence=233 RECID=229 STAMP=1051300860 input archived log thread=1 sequence=234 RECID=230 STAMP=1051300863 input archived log thread=1 sequence=235 RECID=231 STAMP=1051301702 channel ORA_DISK_2: starting piece 1 at 16-SEP-20 channel ORA_DISK_1: finished piece 1 at 16-SEP-20 piece handle=/u01/oradata/nonrac/rman/0hvaj5q6_1_1.bkp tag=INCR0_BACKUP_ARCHLOGS comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 channel ORA_DISK_1: starting archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=219 RECID=215 STAMP=1051300840 input archived log thread=1 sequence=220 RECID=216 STAMP=1051300842 input archived log thread=1 sequence=221 RECID=217 STAMP=1051300842 input archived log thread=1 sequence=222 RECID=218 STAMP=1051300842 input archived log thread=1 sequence=223 RECID=219 STAMP=1051300845 input archived log thread=1 sequence=224 RECID=220 STAMP=1051300845 input archived log thread=1 sequence=225 RECID=221 STAMP=1051300848 input archived log thread=1 sequence=226 RECID=222 STAMP=1051300851 input archived log thread=1 sequence=227 RECID=223 STAMP=1051300854 channel ORA_DISK_1: starting piece 1 at 16-SEP-20 channel ORA_DISK_2: finished piece 1 at 16-SEP-20 piece handle=/u01/oradata/nonrac/rman/0ivaj5q6_1_1.bkp tag=INCR0_BACKUP_ARCHLOGS comment=NONE channel ORA_DISK_2: backup set complete, elapsed time: 00:00:01 channel ORA_DISK_1: finished piece 1 at 16-SEP-20 piece handle=/u01/oradata/nonrac/rman/0jvaj5q7_1_1.bkp tag=INCR0_BACKUP_ARCHLOGS comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 16-SEP-20 Starting Control File and SPFILE Autobackup at 16-SEP-20 piece handle=/u01/oradata/nonrac/rman/c-3871636852-20200916-03.ctl comment=NONE Finished Control File and SPFILE Autobackup at 16-SEP-20 |
Target database :
Step 4:
We need to create directory structure same as source database.
Note: If user required in new location we can use db_file_name_convert and log_file_name_convert parameters to change directory structures .
create directory structure in target
1 2 3 |
[oracle@primary ~]$ mkdir -p /u01/oradata/nonrac/nonrac/ [oracle@primary ~]$ mkdir -p /u01/oradata/nonrac/rman [oracle@primary ~]$ mkdir -p /u01/oradata/nonrac/arch |
SOURCE DATABASE :
Step 5 :
Copy all the backup files to target database using SCP
1 2 3 4 5 6 7 8 9 10 |
[oracle@nonrac rman]$ scp * oracle@192.168.0.102:/u01/oradata/nonrac/rman oracle@192.168.0.102's password: 0evaj5el_1_1.bkp 100% 340MB 17.0MB/s 00:20 0fvaj5el_1_1.bkp 100% 308MB 10.3MB/s 00:30 0hvaj5q6_1_1.bkp 100% 16MB 16.1MB/s 00:01 0ivaj5q6_1_1.bkp 100% 4577KB 4.5MB/s 00:00 0jvaj5q7_1_1.bkp 100% 187KB 187.0KB/s 00:00 c-3871636852-20200916-02.ctl 100% 10MB 10.5MB/s 00:00 c-3871636852-20200916-03.ctl 100% 10MB 10.5MB/s 00:01 snapshot.f 100% 10MB 10.4MB/s 00:01 |
crosscheck backup files copied in target or not
1 2 3 4 5 6 7 8 9 10 |
[oracle@primary rman]$ ls -l total 716960 -rw-r-----. 1 oracle dba 356761600 Sep 16 15:00 0evaj5el_1_1.bkp -rw-r-----. 1 oracle dba 322772992 Sep 16 15:01 0fvaj5el_1_1.bkp -rw-r-----. 1 oracle dba 16888320 Sep 16 15:01 0hvaj5q6_1_1.bkp -rw-r-----. 1 oracle dba 4686336 Sep 16 15:01 0ivaj5q6_1_1.bkp -rw-r-----. 1 oracle dba 191488 Sep 16 15:01 0jvaj5q7_1_1.bkp -rw-r-----. 1 oracle dba 10977280 Sep 16 15:01 c-3871636852-20200916-02.ctl -rw-r-----. 1 oracle dba 10977280 Sep 16 15:01 c-3871636852-20200916-03.ctl -rw-r-----. 1 oracle dba 10895360 Sep 16 15:01 snapshot.f |
Target database :
Step 6:
Export SID and start instance forcefully to retrieve spfile from backup files.
1 |
[oracle@primary ~]$ export ORACLE_SID=nonrac |
Connect to RMAN and s tart the database in nomount state forcefully.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
[oracle@primary ~]$ rman target / Recovery Manager: Release 12.1.0.2.0 - Production on Wed Sep 16 15:10:38 2020 Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved. connected to target database (not started) RMAN> startup nomount force startup failed: ORA-01078: failure in processing system parameters LRM-00109: could not open parameter file '/oraeng/app/oracle/product/12.1.0/dbs/initnonrac.ora' starting Oracle instance without parameter file for retrieval of spfile Oracle instance started Total System Global Area 1073741824 bytes Fixed Size 2932632 bytes Variable Size 281018472 bytes Database Buffers 784334848 bytes Redo Buffers 5455872 bytes |
Step 7 :
Restore spfile from RMAN backup pieces.
Command to restore spfile from backup controlfile.
1 2 3 4 5 6 7 8 |
RMAN> restore spfile from '/u01/oradata/nonrac/rman/c-3871636852-20200916-03.ctl'; Starting restore at 16-SEP-20 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=23 device type=DISK channel ORA_DISK_1: restoring spfile from AUTOBACKUP /u01/oradata/nonrac/rman/c-3871636852-20200916-03.ctl channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete Finished restore at 16-SEP-20 |
SPFILE is restored successfully and we need to shutdown and nomount the database with spfile to effect changes.
Step 8 :
Shutdown the database and nomount .
1 2 3 4 5 6 7 8 9 10 11 |
SYS>>shut immediate ORA-01507: database not mounted ORACLE instance shut down. SYS>>startup nomount ORACLE instance started. Total System Global Area 1342177280 bytes Fixed Size 2924160 bytes Variable Size 1241514368 bytes Database Buffers 83886080 bytes Redo Buffers 13852672 bytes |
Check database has started with spfile or not
1 2 3 4 |
SYS>>show parameter spfile NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ spfile string /oraeng/app/oracle/product/12.1.0/dbs/spfilenonrac.ora |
Step 9 :
Connect to RMAN and restore controlfile
1 2 3 4 |
[oracle@primary ~]$ rman target / Recovery Manager: Release 12.1.0.2.0 - Production on Wed Sep 16 15:15:59 2020 Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved. connected to target database: NONRAC (not mounted) |
Restore the controlfile using below command
1 2 3 4 5 6 7 8 9 10 |
RMAN> restore controlfile from '/u01/oradata/nonrac/rman/c-3871636852-20200916-03.ctl'; Starting restore at 16-SEP-20 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=22 device type=DISK channel ORA_DISK_1: restoring control file channel ORA_DISK_1: restore complete, elapsed time: 00:00:03 output file name=/u01/oradata/nonrac/nonrac/control01.ctl output file name=/u01/oradata/nonrac/nonrac/control02.ctl Finished restore at 16-SEP-20 |
Once controlfile restored ,alter the database to the mount state.
1 2 3 |
RMAN> alter database mount; Statement processed released channel: ORA_DISK_1 |
Step 10 :
Use catalog start with option to know the location backup files and names
1 2 3 4 5 6 7 8 9 10 11 12 13 |
RMAN> catalog start with '/u01/oradata/nonrac/rman'; searching for all files that match the pattern /u01/oradata/nonrac/rman List of Files Unknown to the Database ===================================== File Name: /u01/oradata/nonrac/rman/c-3871636852-20200916-03.ctl File Name: /u01/oradata/nonrac/rman/snapshot.f Do you really want to catalog the above files (enter YES or NO)? yes cataloging files... cataloging done List of Cataloged Files ======================= File Name: /u01/oradata/nonrac/rman/c-3871636852-20200916-03.ctl File Name: /u01/oradata/nonrac/rman/snapshot.f |
####Restore database preview;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
RMAN> restore database preview; Starting restore at 16-SEP-20 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=22 device type=DISK allocated channel: ORA_DISK_2 channel ORA_DISK_2: SID=23 device type=DISK List of Backup Sets =================== BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 14 Incr 0 307.81M DISK 00:03:37 16-SEP-20 BP Key: 14 Status: AVAILABLE Compressed: YES Tag: INCR0_BACKUP_DBFILES Piece Name: /u01/oradata/nonrac/rman/0fvaj5el_1_1.bkp List of Datafiles in backup set 14 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 1 0 Incr 4355213 16-SEP-20 /u01/oradata/nonrac/nonrac/system01.dbf 4 0 Incr 4355213 16-SEP-20 /u01/oradata/nonrac/nonrac/undotbs01.dbf 5 0 Incr 4355213 16-SEP-20 /u01/oradata/nonrac/nonrac/example01.dbf 8 0 Incr 4355213 16-SEP-20 /u01/oradata/nonrac/nonrac/mgmt_deepdive.dbf BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 15 Incr 0 340.23M DISK 00:04:32 16-SEP-20 BP Key: 15 Status: AVAILABLE Compressed: YES Tag: INCR0_BACKUP_DBFILES Piece Name: /u01/oradata/nonrac/rman/0evaj5el_1_1.bkp List of Datafiles in backup set 15 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 2 0 Incr 4355212 16-SEP-20 /u01/oradata/nonrac/nonrac/mgmt_ecm_depot1.dbf 3 0 Incr 4355212 16-SEP-20 /u01/oradata/nonrac/nonrac/sysaux01.dbf 6 0 Incr 4355212 16-SEP-20 /u01/oradata/nonrac/nonrac/users01.dbf 7 0 Incr 4355212 16-SEP-20 /u01/oradata/nonrac/nonrac/mgmt.dbf using channel ORA_DISK_1 using channel ORA_DISK_2 List of Backup Sets =================== BS Key Size Device Type Elapsed Time Completion Time ------- ---------- ----------- ------------ --------------- 17 4.47M DISK 00:00:00 16-SEP-20 BP Key: 17 Status: AVAILABLE Compressed: NO Tag: INCR0_BACKUP_ARCHLOGS Piece Name: /u01/oradata/nonrac/rman/0ivaj5q6_1_1.bkp List of Archived Logs in backup set 17 Thrd Seq Low SCN Low Time Next SCN Next Time ---- ------- ---------- --------- ---------- --------- 1 235 4352217 16-SEP-20 4356924 16-SEP-20 RMAN-05119: recovery can not be done to a consistent state. Media recovery start SCN is 4355212 Recovery must be done beyond SCN 4355451 to clear datafile fuzziness Finished restore at 16-SEP-20 |
Step 10 :
Restore database using below command
1 2 3 4 |
[oracle@primary ~]$ rman target / Recovery Manager: Release 12.1.0.2.0 - Production on Wed Sep 16 15:35:43 2020 Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved. connected to target database: NONRAC (DBID=3871636852, not open) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
RMAN> restore database; Starting restore at 16-SEP-20 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=23 device type=DISK allocated channel: ORA_DISK_2 channel ORA_DISK_2: SID=24 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 00001 to /u01/oradata/nonrac/nonrac/system01.dbf channel ORA_DISK_1: restoring datafile 00004 to /u01/oradata/nonrac/nonrac/undotbs01.dbf channel ORA_DISK_1: restoring datafile 00005 to /u01/oradata/nonrac/nonrac/example01.dbf channel ORA_DISK_1: restoring datafile 00008 to /u01/oradata/nonrac/nonrac/mgmt_deepdive.dbf channel ORA_DISK_1: reading from backup piece /u01/oradata/nonrac/rman/0fvaj5el_1_1.bkp 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 /u01/oradata/nonrac/nonrac/mgmt_ecm_depot1.dbf channel ORA_DISK_2: restoring datafile 00003 to /u01/oradata/nonrac/nonrac/sysaux01.dbf channel ORA_DISK_2: restoring datafile 00006 to /u01/oradata/nonrac/nonrac/users01.dbf channel ORA_DISK_2: restoring datafile 00007 to /u01/oradata/nonrac/nonrac/mgmt.dbf channel ORA_DISK_2: reading from backup piece /u01/oradata/nonrac/rman/0evaj5el_1_1.bkp channel ORA_DISK_1: piece handle=/u01/oradata/nonrac/rman/0fvaj5el_1_1.bkp tag=INCR0_BACKUP_DBFILES channel ORA_DISK_1: restored backup piece 1 channel ORA_DISK_1: restore complete, elapsed time: 00:06:46 channel ORA_DISK_2: piece handle=/u01/oradata/nonrac/rman/0evaj5el_1_1.bkp tag=INCR0_BACKUP_DBFILES channel ORA_DISK_2: restored backup piece 1 channel ORA_DISK_2: restore complete, elapsed time: 00:06:47 Finished restore at 16-SEP-20 |
Step 11 :
Recover the database using below command
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
RMAN> recover database; Starting recover at 16-SEP-20 using channel ORA_DISK_1 using channel ORA_DISK_2 starting media recovery channel ORA_DISK_1: starting archived log restore to default destination channel ORA_DISK_1: restoring archived log archived log thread=1 sequence=235 channel ORA_DISK_1: reading from backup piece /u01/oradata/nonrac/rman/0ivaj5q6_1_1.bkp channel ORA_DISK_1: piece handle=/u01/oradata/nonrac/rman/0ivaj5q6_1_1.bkp tag=INCR0_BACKUP_ARCHLOGS channel ORA_DISK_1: restored backup piece 1 channel ORA_DISK_1: restore complete, elapsed time: 00:00:01 archived log file name=/u01/oradata/nonrac/arch/1_235_1010425527.dbf thread=1 sequence=235 unable to find archived log archived log thread=1 sequence=236 RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of recover command at 09/16/2020 15:42:59 RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 236 and starting SCN of 4356924 |
Step 12 :
Open the database with resetlogs option
1 2 3 |
RMAN> alter database open resetlogs; Statement processed RMAN> |
Check the database name and open state.
1 2 3 4 5 6 7 8 9 10 |
[oracle@primary nonrac]$ sqlplus / as sysdba SQL*Plus: Release 12.1.0.2.0 Production on Wed Sep 16 18:45:47 2020 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 SYS>>select name,open_mode from v$database; NAME OPEN_MODE ---------------------------------------- -------------------- NONRAC READ WRITE |
check datafiles.
1 2 3 4 5 6 7 8 9 10 11 |
SYS>>select name from v$datafile; NAME ---------------------------------------- /u01/oradata/nonrac/nonrac/system01.dbf /u01/oradata/nonrac/nonrac/mgmt_ecm_depot1.dbf /u01/oradata/nonrac/nonrac/sysaux01.dbf /u01/oradata/nonrac/nonrac/undotbs01.dbf /u01/oradata/nonrac/nonrac/example01.dbf /u01/oradata/nonrac/nonrac/users01.dbf /u01/oradata/nonrac/nonrac/mgmt.dbf /u01/oradata/nonrac/nonrac/mgmt_deepdive.dbf |
Finally cloning of NONRAC database using backup pieces is done. Please implement in lower environments
Thank you for giving your valuable time to read the above information.
Follow us on
Website : www.ktexperts.com
Facebook Page : KTExperts Facebook
Linkedin Page : KT EXPERTS Linkedin