It is provided for educational purposes only. release channel a2; duplicate target database to TESTARC backup location '/u02/oracle/backup'; [1]+ 28021 Running nohup ./clone_TESTARC_db.sh &, sql statement: alter system set db_unique_name = ''TESTARC'' comment= ''Modified by RMAN duplicate'' scope=spfile. 4. export ORACLE_SID=TESTARC Create any required directories on the destination host as required if the directory path on the source and target are going to be different for example we may need to create a directory for audit_dump_dest on the target. Then copy the password file from source to target and rename the file on the target if the ORACLE_SID on target is different to the source. We have to explicitly provide the user, password as well as the TNS alias for both the target database as well as the auxiliary database. release channel a3; BACKUP_LOG_PATH=/home/oracle ) RMAN can employ unused block compression while creating backups, thus reducing the size of backups that are transported over the network (USING BACKUPSET, USING COMPRESSED BACKUPS clause). Ensure that you run it in your test environment before using. export BACKUP_LOG_PATH Verify DB ID for Clone DB (TESTARC) Ensure that you run it in your test environment before using. Your email address will not be published. Email: br8dba@gmail.com. Now let us say we had a tablespace which had a 10GB data file, but the tablespace only contained say about 1 GB of data. ) Also dont forget the DB_FILE_NAME_CONVERT and LOG_FILE_NAME_CONVERT parameters in the target database parameter file if the directory structure is different on the target as compared to the source. startup nomount pfile='/home/oracle/initTESTARC.ora'; create spfile from pfile='/home/oracle/initTESTARC.ora'; ORACLE_BASE=/u01/app/oracle Add a static entry in the listener.ora on the target and in the tnsnames.ora file on both database source and target servers add a TNS alias. exit; { Add TNS entry create pfile='/home/oracle/initTESTARC.ora' from spfile; *.db_file_name_convert='/u02/oracle/oradata/TEST','/u02/oracle/oradata/TESTARC', *.log_file_name_convert='/u02/oracle/oradata/TEST','/u02/oracle/oradata/TESTARC', mkdir -p /u01/app/oracle/admin/TESTARC/adump, mkdir -p /u02/oracle/TESTARC/fast_recovery_area, echo "TESTARC:/u01/app/oracle/product/11.2.0.4:N" >> /etc/oratab. Copy Password for Clone Database set until scn 980479; same as 11g this part has not changed. 6. (DESCRIPTION = Thank you, With backupsets there are a number of advantages. So we can see that RMAN has split this 2.2 GB based on the section size we allocated which was 500 MB. sql 'alter system archive log current'; export ORACLE_BASE allocate channel a2 type disk; Thanks for notes but when i duplicating i need target folder specially datafile .. i dont where i am mistake .. spfile or any other parameter can i guide .. release channel a1; EOF. rman target sys/sys_passwd@bsprd auxiliary sys/sys_passwd@bsprd_dup. "/u02/oracle/oradata/TESTARC/undotbs01.dbf"; 7. In earlier versions the RMAN DUPLICATE database command was a push-based method. 12. export ORACLE_BASE Let us look at an example using the pull-based method to create a duplicate database using RMAN backupsets from an active database. "/u02/oracle/oradata/TESTARC/users01.dbf"; 3. Save my name, email, and website in this browser for the next time I comment. alter system set local_listener='LISTENER_11G' scope=both; TESTARC = So what all preparation work we have to do for this RMAN Duplicate to work? (ADDRESS_LIST = "/u02/oracle/oradata/TESTARC/system01.dbf"; clone database ______________________________________________________________________________________________________, 1. set newname for datafile 1 to backup archivelog all format '/u02/oracle/backup/arch_%d_%u_%s'; 10. So now in Oracle 12c this is what is new in the DUPLICATE . $ORACLE_HOME/bin/rman msglog=${LOG_FILE} < run ORACLE_HOME=/u01/app/oracle/product/11.2.0.4 5. set newname for datafile 1 to /u02/data01.dbf; "/u02/oracle/oradata/TESTARC/sysaux01.dbf"; Click here for instructions on how to enable JavaScript in your browser. run { Add oratab entry Note the 4 auxiliary channels being created because we have configured RMAN with a parallelism of 4. duplicate database; Install Oracle Software in silent mode 11gR2, How to change SQL prompt to show connected user and database name, How to Recover Loss of DATA (Without a Backup! BACKUP_LOG_PATH=/home/oracle ; ++ We are using non default port number 1621, hence added local_listener. Overview set newname for datafile 2 to restore It is provided for educational purposes only. (CONNECT_DATA = connect target / In the earlier push-based method, the source database transfers the required database files to the auxiliary database as image copies. allocate channel c1 type disk; We have 4 auxiliary channels working on sections of the single data file in parallel. export ORACLE_HOME And these new features certainly are providing advantages over the earlier pre-12c method. ). LOG_FILE=${BACKUP_LOG_PATH}/clone_testarc_db.log. LOG_FILE=${BACKUP_LOG_PATH}/clone_db.log Backup Source Database Currently you have JavaScript disabled. The SYSTEM tablespace data file was about 2.2 GB in my case. Rajasekhar Amudala One of the new features in Oracle 12c is that it has been changed to a pull-based method which has many advantages. 9. FROM ACTIVE DATABASE command. export BACKUP_LOG_PATH Eg: backup current controlfile format '/u02/oracle/backup/Control_%d_%u_%s'; allocate channel t1 type disk; : Your use of any information or materials on this website is entirely at your own risk. If the ASM disk group names are different then we may have to connect via asmcmd on the target and create any directories we require. Caution: Your use of any information or materials on this website is entirely at your own risk. ______________________________________________________________________________________________________. release channel t3; 19c Container Database Data Guard Configuration, 12c RMAN New Feature Cross Platform Data Transport Using Incremental Backups, Creating an Oracle 12c Data Guard Active Standby Database, Restore RMAN backup to another server for testing disaster recovery procedures as well as for cloning. In addition we can also encrypt backup sets created on the source database via the SET ENCRYPTION command. Create required Directories } Note the RMAN DUPLICATE DATABASE command it includes the USING BACKUPSET and SECTION SIZE clauses. Using multi-section backups, backup sets can be created in parallel on the source database (SECTION SIZE clause). run { allocate channel t3 type disk; } First and most important thing to do is to do the network part of the work. 11. allocate channel a3 type disk; Note also now when you create the duplicate database via RMAN, we cannot just issue the TARGET / command in RMAN. It has been tested internally, however, we do not guarantee that it will work for you. backup database format '/u02/oracle/backup/database_%d_%u_%s'; ), RMAN Database Restore from ASM to File System, Convert Physical Standby Database to Snapshot Standby Database, Convert Snapshot Standby database to Physical Standby database, Refresh Standby Database using RMAN Incremental SCN Backup, Resetlogs on Primary where Standby in place, Create Physical Standby using RMAN Backup Without Duplicate Command, Create Physical Standby using RMAN Backup with Duplicate Command, Upgrade Database to 12.2 with Physical Standby, Add Node Back which was DELETED without remove software, Oracle GoldenGate Heterogeneous Replication, ADD NEW TABLE TO AN EXISTING GOLDENGATE CONFIGURATION, Install Oracle GoldenGate 19C for Database 12C, Install Oracle GoldenGate 19C for Database 19C, Install 12.2 Database Binaries in silent mode, Upgrade DB using DBUA from 11.2.0.4 to 12.2.0.1, CREATE NEW PDB BY CLONING AN EXISTING PDB, CREATE NON-CDB ON ORACLE 12C IN SILENT MODE, Create Non-CDB on Oracle 12c using DBCA (GUI), How to Change MAX_STRING_SIZE on Physical Standby Environment, Upgrade Oracle Database from 12.2.0.1 to 19c using DBUA, Upgrade Oracle Database Manually from 12.2.0.1 to 19c, Rolling Upgrade With an Existing Physical Standby Database, Add Targets Manually on EM Cloud Control 13c, Install PostgreSQL 13 using yum Repository on Linux. set newname for datafile 3 to Click here for instructions on how to enable JavaScript in your browser. In order to post comments, please make sure JavaScript and Cookies are enabled, and reload the page. 2. Startup Nomount TESTARC Environment Required fields are marked *. Let us assume source database name is BSPRD and we are creating a clone of this database. document.getElementById( "ak_js_1" ).setAttribute( "value", ( new Date() ).getTime() ); Oracle ACE Director (only 3 in Australia), Oracle Cloud Infrastructure Architect, Oracle Certified Master Database and Cloud (10g,11g and 12c), Oracle Certified Specialist (GoldenGate, Exadata 11g, Exadata Database Machine and Cloud Service 2017) and Oracle OCP (8i to 12c). set newname for datafile 4 to In the example I have shown the RMAN parallelism has been set to 4 and two of the bigger data files are 2.2 GB and 1.5 GB so I have used a section size of 500 MB. select name,open_mode,dbid from v$database; ORACLE_BASE=/u01/app/oracle Regardless, since it is an image copy, the entire 10 GB data file had to be copied over the network. }, lol, you meant elegant I hope great article btw, Your email address will not be published. run { Run RMAN Duplicate It has been tested internally, however, we do not guarantee that it will work for you. When using the SECTION SIZE parameter take into account the sizes of the data files and the parallelism we are going to use. Taking the earlier example of a tablespace having a 10GB data file but say having only 1 GB of occupied data, only the 1 GB is now copied over the network as a backup set and not the entire 10 GB data file. (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.101)(PORT = 1621)) contents of Memory Script: Now in Oracle 12c RMAN performs active database duplication using backup sets and not image copies. Verify connectivity allocate channel a1 type disk; release channel t1; release channel t2; ORACLE_HOME=/u01/app/oracle/product/11.2.0.4 8. export ORACLE_SID=TEST (SERVICE_NAME = TESTARC) } export ORACLE_HOME Contents