Oracle Database 12c has new enhancements and additions in Recovery Manager (RMAN).
The RMAN tool continues to enhance and extend the reliability, efficiency, and availability of Oracle Database Backup and Recovery.
Below, I will mention couple of new features for the RMAN duplicate command, but also how to avoid issues that can happen on the creation of the temporary files.
FEATURES:
<INFO>Using BACKUPSET clause :
In previous releases, active duplicates were performed using implicit image copy backups, transferred directly to the destination server. From 12.1 it is also possible to perform active duplicates using backup sets by including the USING BACKUPSET clause.
Compared to the other method (image copy backups), the unused block compression associated with a backup set reduces the amount of the data pulled across the network.
<INFO>Using SECTION SIZE clause:
The section size clause takes into account the parallel degree and the size of the datafile that will be used.
In my case I have configured the parallel degree to 6:
RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 6 BACKUP TYPE TO BACKUPSET; new RMAN configuration parameters: CONFIGURE DEVICE TYPE DISK PARALLELISM 6 BACKUP TYPE TO BACKUPSET; new RMAN configuration parameters are successfully stored Starting restore at 19-JUL-2018 14:11:06 using channel ORA_AUX_DISK_1 using channel ORA_AUX_DISK_2 using channel ORA_AUX_DISK_3 using channel ORA_AUX_DISK_4 using channel ORA_AUX_DISK_5 using channel ORA_AUX_DISK_6
channel ORA_AUX_DISK_3: using network backup set from service PROD2_SITE1 channel ORA_AUX_DISK_3: specifying datafile(s) to restore from backup set channel ORA_AUX_DISK_3: restoring datafile 00005 to /u02/oradata/PROD/data.dbf channel ORA_AUX_DISK_3: restoring section 2 of 7 ------ channel ORA_AUX_DISK_2: starting datafile backup set restore channel ORA_AUX_DISK_2: using network backup set from service PROD2_SITE1 channel ORA_AUX_DISK_2: specifying datafile(s) to restore from backup set channel ORA_AUX_DISK_2: restoring datafile 00005 to /u02/oradata/PROD/data.dbf channel ORA_AUX_DISK_2: restoring section 7 of 7
<INFO>The 2 clauses “USING BACKUPSET” and “SECTION SIZE” cannot be used without “ACTIVE DATABASE” and can be integrated successfully into the standby creation :
[email protected]:/home/oracle/ [PROD2] rman target sys/[email protected]_SITE1 auxiliary sys/[email protected]_SITE2 Recovery Manager: Release 12.1.0.2.0 - Production on Sun Jul 22 13:17:14 2018 Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved. connected to target database: PROD2 (DBID=1633730013) connected to auxiliary database: PROD2 (not mounted) RMAN> duplicate target database for standby from active database using backupset section size 500m nofilenamecheck;
Starting Duplicate Db at 22-JUL-2018 13:17:21 using target database control file instead of recovery catalog allocated channel: ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: SID=249 device type=DISK allocated channel: ORA_AUX_DISK_2 channel ORA_AUX_DISK_2: SID=13 device type=DISK allocated channel: ORA_AUX_DISK_3 channel ORA_AUX_DISK_3: SID=250 device type=DISK allocated channel: ORA_AUX_DISK_4 channel ORA_AUX_DISK_4: SID=14 device type=DISK allocated channel: ORA_AUX_DISK_5 channel ORA_AUX_DISK_5: SID=251 device type=DISK allocated channel: ORA_AUX_DISK_6 channel ORA_AUX_DISK_6: SID=15 device type=DISK contents of Memory Script: { backup as copy reuse targetfile '/u01/app/oracle/product/12.1.0/dbhome_1/dbs/orapwPROD2' auxiliary format '/u01/app/oracle/product/12.1.0/dbhome_1/dbs/orapwPROD2' ; } executing Memory Script ---------------------------- executing Memory Script datafile 1 switched to datafile copy input datafile copy RECID=1 STAMP=982156757 file name=/u02/oradata/PROD2/system01.dbf datafile 3 switched to datafile copy input datafile copy RECID=2 STAMP=982156757 file name=/u02/oradata/PROD2/sysaux01.dbf datafile 4 switched to datafile copy input datafile copy RECID=3 STAMP=982156757 file name=/u02/oradata/PROD2/undotbs01.dbf datafile 5 switched to datafile copy input datafile copy RECID=4 STAMP=982156757 file name=/u02/oradata/PROD2/data.dbf datafile 6 switched to datafile copy input datafile copy RECID=5 STAMP=982156757 file name=/u02/oradata/PROD2/users01.dbf Finished Duplicate Db at 22-JUL-2018 13:19:21 RMAN> exit
<INFO>Check the status of the PRIMARY & STANDBY database
SQL> select name,db_unique_name,database_role from v$database; NAME DB_UNIQUE_NAME DATABASE_ROLE --------- ------------------------------ ---------------- PROD2 PROD2_SITE1 PRIMARY SQL> select name,db_unique_name,database_role from v$database; NAME DB_UNIQUE_NAME DATABASE_ROLE --------- ------------------------------ ---------------- PROD2 PROD2_SITE2 PHYSICAL STANDBY
ISSUES :
<WARN>Duplicating on 12cR1, creation of the temp files is not handled correctly.
Duplicating from active or from backup, using Oracle 12cR1, you can run into some issues with the temporary files.
[email protected]:/u01/app/oracle/product/12.1.0/dbhome_1/dbs/ [PROD] rman target sys/[email protected]<TNS_NAME_TARGET> auxiliary sys/[email protected]<TNS_NAME_AUXILIARY> Recovery Manager: Release 12.1.0.2.0 - Production on Thu Jul 19 13:31:20 2018 Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved. connected to target database: <TNS_NAME_TARGET> (DBID=xxxxxxxxxx) connected to auxiliary database: <TNS_NAME_AUXILIARY> (not mounted) duplicate target database to <TNS_NAME_AUXILIARY> from active database using backupset section size 500m; ---------------------------------------- contents of Memory Script: { Alter clone database open resetlogs; } executing Memory Script database opened Finished Duplicate Db at 19-JUL-2018 14:26:09
<INFO>Querying the v$tempfile will not reveal any error
SQL> select file#,name,status from v$tempfile; FILE# NAME STATUS ---------- ------------------------------ ------- 1 /u02/oradata/<AUXILIARY>/temp01.dbf ONLINE
<INFO>But querying the dba_temp_files, or run some transactions against your database that need usage of the temporary tablespace, you will got :
SQL> select * from dba_temp_files; select * from dba_temp_files * ERROR at line 1: ORA-01187: cannot read from file because it failed verification tests ORA-01110: data file 201: '/u02/oradata/<AUXILIARY>/temp01.dbf'
Solution1 : Drop and recreate your temporary tablespace(s) manually. Could be difficult if you have several of them, OR
Solution2 : Drop temp files from your <to_be_cloned_DB>, on the OS side, before launching the duplicate. For more details you can consult this note from MOS : 2250889.1
SQL> col TABLESPACE_NAME format a50; SQL> col file_name format a50; SQL> select file_name,TABLESPACE_NAME from dba_temp_files; FILE_NAME TABLESPACE_NAME -------------------------------------------------- -------------------------------------------------- /u02/oradata/<AUXILIARY>/temp01.dbf TEMP SQL>startup nomount; rm -rf /u02/oradata/<AUXILIARY>/temp01.dbf
[email protected]:/u01/app/oracle/product/12.1.0/dbhome_1/dbs/ [PROD] rman target sys/[email protected]<TNS_NAME_TARGET> auxiliary sys/[email protected]<TNS_NAME_AUXILIARY> Recovery Manager: Release 12.1.0.2.0 - Production on Thu Jul 19 13:31:20 2018 Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved. connected to target database: <TNS_NAME_TARGET> (DBID=xxxxxxxxxx) connected to auxiliary database: <TNS_NAME_AUXILIARY> (not mounted) duplicate target database to <TNS_NAME_AUXILIARY> from active database using backupset section size 500m;
At then end of the duplicate action, you should be able to use the database without any action performed against temp files :
SQL> select file#,name,status from v$tempfile; FILE# NAME STATUS ---------- ------------------------------ ------- 1 /u02/oradata/<AUXILIARY>/temp01.dbf ONLINE
Additionally, if you are running your auxiliary DB using the Oracle Grid Infra, you need to remove it from Grid during your actions and add again once you finished.
SQL> alter system set db_unique_name='PROD_SITE2' scope=spfile; alter system set db_unique_name='PROD_SITE2' scope=spfile * ERROR at line 1: ORA-32017: failure in updating SPFILE ORA-65500: could not modify DB_UNIQUE_NAME, resource exists --remove from GRID [[email protected] ~]$ srvctl stop database -d PROD [[email protected] ~]$ srvctl remove database -d PROD Remove the database PROD? (y/[n]) Y SQL> startup ORACLE instance started. Total System Global Area 788529152 bytes Fixed Size 2929352 bytes Variable Size 314576184 bytes Database Buffers 465567744 bytes Redo Buffers 5455872 bytes Database mounted. Database opened. SQL> alter system set db_unique_name='PROD_SITE2' scope=spfile; System altered.
How do you use section size in a dataguard environment
Ravin,
Thank you for your message. I just updated my blog, by explaining how to use the 2 clauses into the creation of a standby database from active.
Please let me know if this update is answering to your question.
Ravin,
The backup on the dataguard environment against a bigfile tablespace using section size, completed successfully on my scenario.
Please find below the output generated on my case and let em know if is matching your context.
RMAN> backup as compressed backupset tablespace data section size 1G;
Starting backup at 23-JUL-2018 08:34:10
Starting implicit crosscheck backup at 23-JUL-2018 08:34:10
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=16 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=259 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=22 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=257 device type=DISK
allocated channel: ORA_DISK_6
channel ORA_DISK_6: SID=20 device type=DISK
Finished implicit crosscheck backup at 23-JUL-2018 08:34:11
Starting implicit crosscheck copy at 23-JUL-2018 08:34:11
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
using channel ORA_DISK_6
Finished implicit crosscheck copy at 23-JUL-2018 08:34:11
searching for all files in the recovery area
cataloging files…
no files cataloged
using channel ORA_DISK_1
————————
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00005 name=/u02/oradata/PROD/data.dbf
backing up blocks 1 through 131072
——————————-
backing up blocks 131073 through 262144
channel ORA_DISK_2: starting piece 2 at 23-JUL-2018 08:34:12
channel ORA_DISK_3: starting compressed full datafile backup set
channel ORA_DISK_3: specifying datafile(s) in backup set
—————————————————————-
channel ORA_DISK_3: finished piece 9 at 23-JUL-2018 08:34:13
piece handle=/u90/fast_recovery_area/PROD2_SITE2/backupset/2018_07_23/o1_mf_nnndf_TAG20180723T083411_fobxq4yz_.bkp tag=TAG20180723T083411 comment=NONE
channel ORA_DISK_3: backup set complete, elapsed time: 00:00:01
Finished backup at 23-JUL-2018 08:34:13