
{"id":7838,"date":"2020-12-31T14:55:25","date_gmt":"2020-12-31T14:55:25","guid":{"rendered":"https:\/\/rax-stg-wp-aws.com\/blogs\/duplication-of-databases-from-a-physical-standby\/"},"modified":"2026-11-03T19:29:05","modified_gmt":"2026-11-03T19:29:05","slug":"duplication-of-databases-from-a-physical-standby","status":"publish","type":"blogs","link":"https:\/\/www.rackspace.com\/de\/blogs\/duplication-of-databases-from-a-physical-standby\/","title":{"rendered":"Duplication of databases from a physical standby"},"content":{"rendered":"<p><strong>Introduction<\/strong><br \/>\nThis blog describes how to duplicate a database from a physical standby&nbsp;database.&nbsp;Database duplication copies the target database over the network to the&nbsp;auxiliary destination and then creates the duplicate database. You do not need pre-existing RMAN backups and copies.&nbsp;<\/p>\n<p>Duplicate database from a physical standby is supported from Oracle\u00ae 11g&nbsp;release 2 and onwards.<\/p>\n<p>To perform RMAN active duplication from physical standby you need the<br \/>\nfollowing:<\/p>\n<ul>\n<li>&nbsp; Databases: Oracle 11g to the latest version<\/li>\n<li>&nbsp; Platform: Linux\u00ae 7<\/li>\n<li>&nbsp; Standby DB name: <em>`PROD_DR`<\/em><\/li>\n<li>&nbsp; Target DB name: <em>`TEST`<\/em><\/li>\n<\/ul>\n<p><strong>Open the standby database in read-only mode<\/strong><\/p>\n<p>Stop the recovery at the physical standby database and then open the<br \/>\ndatabase in read-only mode to allow duplication.<\/p>\n<p>Use the following command to check the status of the standby database:<\/p>\n<p>&nbsp; &nbsp; PROD_DR&gt; select name, open_mode, log_mode from v$database;<\/p>\n<p>You should see output similar to the following:<\/p>\n<p>&nbsp; &nbsp; NAME &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;OPEN_MODE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LOG_MODE<br \/>\n&nbsp; &nbsp; &#8212;&#8212;&#8212; &nbsp;&nbsp; &nbsp;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8212;&#8212;&#8212;&#8212;<br \/>\n&nbsp; &nbsp; PROD_DR &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; MOUNTED &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ARCHIVELOG<\/p>\n<p>Use the following command to stop the recovery of the standby database:<\/p>\n<p><em>&nbsp; &nbsp; SQL&gt; alter database recover managed standby database cancel;<br \/>\n&nbsp; &nbsp; Database altered.<\/em><\/p>\n<p>Then, open the database in read-only mode:<\/p>\n<p><em>&nbsp; &nbsp; SQL&gt; alter database open read only;<br \/>\n&nbsp; &nbsp; Database altered.<\/em><\/p>\n<p><em>Check the status of the database again to see that it is in read-only instead<br \/>\nof mounted:<\/em><\/p>\n<p><em>&nbsp; &nbsp; PROD_DR&gt; select name, open_mode,log_mode from v$database;<\/em><\/p>\n<p><em>&nbsp; &nbsp; NAME &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;OPEN_MODE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; LOG_MODE<br \/>\n&nbsp; &nbsp; &#8212;&#8212;&#8212; &nbsp;&nbsp; &nbsp; &nbsp;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; &nbsp;&nbsp; &nbsp; &#8212;&#8212;&#8212;&#8212;<br \/>\n&nbsp; &nbsp; PROD_DR &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;READ ONLY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; ARCHIVELOG<\/em><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Prepare the target server<\/strong><\/p>\n<p>In this section, we&#8217;ll copy the entire standby Oracle home binaries to the&nbsp;target instance server, prepare the <strong>pfile&nbsp;<\/strong>from the source database, and&nbsp;make changes according to the new database name.<br \/>\n&nbsp;<\/p>\n<p>First, prepare the <strong>pfile<\/strong> by using the following commands:<\/p>\n<p>cd $ORACLE_HOME\/dbs<br \/>\n&nbsp; &nbsp; initTEST.ora<\/p>\n<p><strong><em>&nbsp; &nbsp; *.control_files=&#8217;+DATA\/cntrl01.dbf&#8217;, &#8216;+DATA\/cntrl02.dbf&#8217;<br \/>\n&nbsp; &nbsp; *.db_create_file_dest=&#8217;+DATA&#8217;<br \/>\n&nbsp; &nbsp; *.db_file_name_convert=&#8217;+PROD_DR_DATA&#8217;,&#8217;+DATA&#8217;<br \/>\n&nbsp; &nbsp; *.db_name=&#8217;TEST&#8217;<br \/>\n&nbsp; &nbsp; *.db_unique_name=&#8217;TEST&#8217;<br \/>\n&nbsp; &nbsp; *.diagnostic_dest=&#8217;\/u01\/app\/diag&#8217;<br \/>\n&nbsp; &nbsp; *.log_file_name_convert=&#8217;+PROD_DR_DATA&#8217;,&#8217;+DATA&#8217;<\/em><\/strong><\/p>\n<p>Copy the existing standby password file and rename it to match the SID used&nbsp;for the TEST database, or you can create a new password file on the target&nbsp;server with the same source password.<\/p>\n<p><em>&nbsp; &nbsp; cd $ORACLE_HOME\/dbs<br \/>\n&nbsp; &nbsp; cp orapwPROD_DR orapwTEST<\/em><\/p>\n<p><strong>&nbsp;Configure static listener<\/strong><\/p>\n<p>Use the following steps to configure the static listener for the test<br \/>\ndatabase:<\/p>\n<p><em>&nbsp;cd $ORACLE_HOME\/network\/admin<br \/>\n&nbsp; &nbsp; cat listener.ora<\/em><\/p>\n<p><em>&nbsp; &nbsp; ADR_BASE_LISTENER_LOCAL = \/u01\/app\/oracle<\/em><\/p>\n<p><em>&nbsp; &nbsp; LISTENER_LOCAL =<br \/>\n&nbsp; &nbsp; &nbsp; (DESCRIPTION_LIST =<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; (DESCRIPTION =<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (ADDRESS = (PROTOCOL = TCP)(HOST = TEST.ras.com)(PORT = 1521))<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; )<br \/>\n&nbsp; &nbsp; &nbsp; )<br \/>\n&nbsp; &nbsp; SID_LIST_LISTENER_LOCAL = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = DGNEER) (ORACLE_HOME = \/u01\/app\/oracle\/product\/12.1.0.2\/dbhome_1) (SID_NAME = TEST)))<\/em><\/p>\n<p>Start the listener by using the following command:<\/p>\n<p><em>&nbsp; &nbsp; lsnrctl status listener_local<\/em><\/p>\n<p>You should see output similar to the following example:<\/p>\n<p><em>&nbsp; &nbsp;LSNRCTL for Linux: Version 12.1.0.2.0 &#8211; Production on 09-JUN-2020 02:57:35<\/em><\/p>\n<p><em>&nbsp; &nbsp; Copyright (c) 1991, 2014, Oracle. &nbsp;All rights reserved.<\/em><\/p>\n<p><em>&nbsp; &nbsp; Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST= TEST.ras.com)(PORT=1521)))<br \/>\n&nbsp; &nbsp; STATUS of the LISTENER<br \/>\n&nbsp; &nbsp; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n&nbsp; &nbsp; Alias &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; listener_local<br \/>\n&nbsp; &nbsp; Version &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TNSLSNR for Linux: Version 12.1.0.2.0 &#8211; Production<br \/>\n&nbsp; &nbsp; Start Date &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;04-JAN-2020 04:53:15<br \/>\n&nbsp; &nbsp; Uptime &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;156 days 21 hr. 4 min. 19 sec<br \/>\n&nbsp; &nbsp; Trace Level &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; off<br \/>\n&nbsp; &nbsp; Security &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ON: Local OS Authentication<br \/>\n&nbsp; &nbsp; SNMP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;OFF<br \/>\n&nbsp; &nbsp; Listener Parameter File &nbsp; \/u01\/app\/oracle\/product\/12.1.0.2\/dbhome_1\/network\/admin\/listener.ora<br \/>\n&nbsp; &nbsp; Listener Log File &nbsp; &nbsp; &nbsp; &nbsp; \/u01\/app\/oracle\/product\/12.1.0.2\/dbhome_1\/admin\/diag\/tnslsnr\/alert\/log.xml<br \/>\n&nbsp; &nbsp; Listening Endpoints Summary&#8230;<br \/>\n&nbsp; &nbsp; &nbsp; (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST= TEST.ras.com)(PORT=1521)))<br \/>\n&nbsp; &nbsp; Services Summary&#8230;<br \/>\n&nbsp; &nbsp; Service &#8220;+ASM&#8221; has 1 instance(s).<br \/>\n&nbsp; &nbsp; &nbsp; Instance &#8220;+ASM&#8221;, status READY, has 1 handler(s) for this service&#8230;<br \/>\n&nbsp; &nbsp; Service &#8220;TEST&#8221; has 2 instance(s).<br \/>\n&nbsp; &nbsp; &nbsp; Instance &#8220;TEST&#8221;, status UNKNOWN, has 1 handler(s) for this service&#8230;<br \/>\n&nbsp; &nbsp; &nbsp; Instance &#8220;TEST&#8221;, status READY, has 1 handler(s) for this service&#8230;<br \/>\n&nbsp; &nbsp; The command completed successfully<\/em><br \/>\n&nbsp;<\/p>\n<p><strong>&nbsp;Create an Oracle Net alias<\/strong><\/p>\n<p>Next, you need to create an Oracle Net alias to reach the standby database:<\/p>\n<p><em>&nbsp; &nbsp; PROD_DR=<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (DESCRIPTION=<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (ADDRESS=(PROTOCOL=tcp)(HOST= standbydb.ras.com)(PORT=1523))<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (CONNECT_DATA=<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (SID=PROD_DR)<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; )<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; )<\/em><\/p>\n<p>\n<strong>Start the target database<\/strong><\/p>\n<p>Then you need to start the target database in a `nomount` state by using the<br \/>\nfollowing commands:<\/p>\n<p>&nbsp; &nbsp; sqlplus &#8220;\/ as sysdba&#8221;<\/p>\n<p>&nbsp; &nbsp; startup nomount<\/p>\n<p>&nbsp; &nbsp; SQL&gt; show parameter db_name<br \/>\n&nbsp; &nbsp; NAME &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TYPE &nbsp; &nbsp; &nbsp; &nbsp;VALUE<br \/>\n&nbsp; &nbsp; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;-<br \/>\n&nbsp; &nbsp; db_name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;string &nbsp; &nbsp; &nbsp;TEST<\/p>\n<p>&nbsp; &nbsp; SQL&gt; show parameter uniq<br \/>\n&nbsp; &nbsp; NAME &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TYPE &nbsp; &nbsp; &nbsp; &nbsp;VALUE<br \/>\n&nbsp; &nbsp; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;-<br \/>\n&nbsp; &nbsp; db_unique_name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; string &nbsp; &nbsp; &nbsp;TEST<br \/>\n&nbsp;<\/p>\n<p><strong>&nbsp;Use RMAN to test the connection<\/strong><\/p>\n<p>After the target database is running in `nomount` state, use RMAN to test<br \/>\nthe connection:<\/p>\n<p><em>&nbsp; &nbsp; [oracle@TEST.ras.com dbs]$ rman target sys@PROD_DR &nbsp;auxiliary sys@TEST<\/em><\/p>\n<p><em>&nbsp; &nbsp; Recovery Manager: Release 12.1.0.2.0 &#8211; Production on Thu Jun 09 03:25:22 2020<\/em><\/p>\n<p><em>&nbsp; &nbsp; Copyright (c) 1982, 2011, Oracle and\/or its affiliates. &nbsp;All rights reserved.<\/em><\/p>\n<p><em>&nbsp; &nbsp; target database Password:<br \/>\n&nbsp; &nbsp; connected to target database: PROD_DR (DBID=4252464621)<br \/>\n&nbsp; &nbsp; auxiliary database Password:<br \/>\n&nbsp; &nbsp; connected to an auxiliary database: TEST (not mounted)<\/em><\/p>\n<p><strong>Restore and duplicate the database<\/strong><\/p>\n<p><em>&nbsp; &nbsp; RMAN&gt; target sys@PROD_DR &nbsp;auxiliary sys@TEST<br \/>\n&nbsp; &nbsp; RMAN&gt; duplicate target database to TEST from active database nofilenamecheck;<\/em><\/p>\n<p>After the duplicate command has been completed, you need to restart the standby<br \/>\ndatabase and re-enable recovery by using the following commands:<\/p>\n<p><em>&nbsp; &nbsp; PROD_DR&gt; shut immediate<br \/>\n&nbsp; &nbsp; PROD_DR&gt; startup mount;<br \/>\n&nbsp; &nbsp; PROD_DR&gt; alter database recover managed standby database disconnect from session;<\/em><\/p>\n<p><strong>Check the target database status<\/strong><\/p>\n<p>Use the following commands to check the status of the target database:<\/p>\n<p>&nbsp; &nbsp; [oracle@TEST.ras.com dbs]$ sqlplus &#8220;\/ as sysdba&#8221;<\/p>\n<p>&nbsp; &nbsp; SQL*Plus: Release 12.1.0.2.0 Production on Tue Jun 9 05:15:53 2020<\/p>\n<p>&nbsp; &nbsp; Copyright (c) 1982, 2014, Oracle. &nbsp;All rights reserved.<\/p>\n<p>\n&nbsp; &nbsp; Connected to:<br \/>\n&nbsp; &nbsp; Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 &#8211; 64bit Production. With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics&nbsp;and Real Application Testing options<\/p>\n<p>&nbsp; &nbsp; SQL&gt; &nbsp;select name, open_mode, log_mode , database_role from v$database;<\/p>\n<p>&nbsp; &nbsp; NAME &nbsp; &nbsp; &nbsp;OPEN_MODE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;LOG_MODE &nbsp; &nbsp; DATABASE_ROLE<br \/>\n&nbsp; &nbsp; &#8212;&#8212;&#8212; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n&nbsp; &nbsp; TEST &nbsp; &nbsp; &nbsp;READ WRITE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ARCHIVELOG &nbsp; PRIMARY<\/p>\n<p><strong>Conclusion<\/strong><\/p>\n<p>In this blog, we duplicated a database from a physical standby without taking&nbsp;any physical backups and we restored the target database to the latest archive&nbsp;supplied in the standby database.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Duplication of databases from a physical standby<\/p>\n","protected":false},"author":2,"featured_media":7840,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","format":"standard","meta":{"content-type":"","nid":"26513","content_type":"blog","created_by":"10130","authored_on":"2024-01-18T14:55:24+00:00","field_article_industries":"","tag_category":"Technical","field_blog_author_text":"by Venkata Gogineni, Oracle Applications Database Administrator, Rackspace Technology","seo_description":"Learn the steps to duplicate a database from a physical standby database, a process made easy with RMAN backups and copies.\r\n","field_featured_image":"","insights_image":"\/wp-content\/uploads\/2026\/blog_technical_images\/26513-insights_image-oracle-technical-blog-1-insights.jpg","field_partners":"","rxt_platforms":"Oracle","product":"","publisheddate":"2020-12-31T14:55:25","rxt_solutions":"Data, Databases","opengraph_tag":"","x_tag":"","teaser_flag":"Technical Blog","seo_titile":"Database Duplication Physical Standby | Rackspace Technology","field_topics":"","field_slug":"duplication-of-databases-from-a-physical-standby","footnotes":""},"categories":[178],"tags":[204],"class_list":["post-7838","blogs","type-blogs","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-technical"],"_links":{"self":[{"href":"https:\/\/www.rackspace.com\/de\/wp-json\/wp\/v2\/blogs\/7838","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rackspace.com\/de\/wp-json\/wp\/v2\/blogs"}],"about":[{"href":"https:\/\/www.rackspace.com\/de\/wp-json\/wp\/v2\/types\/blogs"}],"author":[{"embeddable":true,"href":"https:\/\/www.rackspace.com\/de\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rackspace.com\/de\/wp-json\/wp\/v2\/comments?post=7838"}],"version-history":[{"count":1,"href":"https:\/\/www.rackspace.com\/de\/wp-json\/wp\/v2\/blogs\/7838\/revisions"}],"predecessor-version":[{"id":7839,"href":"https:\/\/www.rackspace.com\/de\/wp-json\/wp\/v2\/blogs\/7838\/revisions\/7839"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rackspace.com\/de\/wp-json\/wp\/v2\/media\/7840"}],"wp:attachment":[{"href":"https:\/\/www.rackspace.com\/de\/wp-json\/wp\/v2\/media?parent=7838"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rackspace.com\/de\/wp-json\/wp\/v2\/categories?post=7838"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rackspace.com\/de\/wp-json\/wp\/v2\/tags?post=7838"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}