
{"id":7654,"date":"2020-06-30T08:54:21","date_gmt":"2020-06-30T08:54:21","guid":{"rendered":"https:\/\/rax-stg-wp-aws.com\/blogs\/use-the-oracle-database-refreshable-clone-feature-part-two-demonstration\/"},"modified":"2026-11-03T19:28:47","modified_gmt":"2026-11-03T19:28:47","slug":"use-the-oracle-database-refreshable-clone-feature-part-two-demonstration","status":"publish","type":"blogs","link":"https:\/\/www.rackspace.com\/de\/blogs\/use-the-oracle-database-refreshable-clone-feature-part-two-demonstration\/","title":{"rendered":"Use the Oracle Database refreshable clone feature &#8211; Part Two: Demonstration"},"content":{"rendered":"<p><strong>Introduction<\/strong><\/p>\n<p>Part one of the series&nbsp;provides an introduction to Oracle\u00ae; refreshable clones, including when and why&nbsp;to use them. In this post, I demonstrate how to set up, configure, maintain, and&nbsp;drop a refreshable clone pluggable database (PDB) in Oracle 18c.<\/p>\n<p><strong>Prerequisites for a refreshable clone PDB<\/strong><\/p>\n<p>To follow along with this demonstration, complete the following prerequisites:<\/p>\n<ol>\n<li>Have a database link for a newly created refreshable clone pointing to a local&nbsp;or a remote container.<\/li>\n<li>Set <em>archive_log_mode<\/em>&nbsp;to <em>enabled<\/em>.<\/li>\n<li>Use an engineered system or Enterprise Edition (EE) Oracle Cloud. If it&#8217;s not available in the same platform or version, set the hidden parameter, <em>_exadata_feature_on<\/em>`, to `<em>True<\/em>`&nbsp;for this demonstration.<\/li>\n<li>Set `<em>local_undo_mode<\/em>` to <em>`enabled`.<\/em><\/li>\n<\/ol>\n<p>You can set the refreshable PDB in either <strong>CLOSED<\/strong>&nbsp;or <strong>OPEN READ ONLY<\/strong>&nbsp;mode and in <strong>OPEN READ ONLY<\/strong>&nbsp;mode for queries after a refresh.<\/p>\n<p><strong>&nbsp;Environment<\/strong><\/p>\n<p>For this demonstration, make sure your environment conforms to the following specifications:<\/p>\n<p>&#8211; Install Oracle 18c and perform the prerequisites on the machine and database.<\/p>\n<p>&#8211; For the role of the production database:<\/p>\n<p>&nbsp; &nbsp; &nbsp;&#8211; Set the container database (CDB) name: <strong>YCDB1<\/strong><\/p>\n<p>&nbsp; &nbsp; &nbsp;&#8211; Set the PDB Name: <strong>PURCH_PDB<\/strong><\/p>\n<p>&#8211; For the role of refreshable clone PDB:<\/p>\n<p>&nbsp; &nbsp; &nbsp;&#8211; Set the CDB Name: <strong>XCDB1<\/strong><\/p>\n<p>&nbsp; &nbsp; &nbsp;&#8211; Set the PDB Name: <strong>PDB2_REFRO<\/strong><\/p>\n<p>&nbsp; &nbsp; &nbsp;&#8211; Set the PDB to refresh automatically every 30 minutes<\/p>\n<p><strong>&nbsp;Demonstration<\/strong><\/p>\n<p>This demonstration performs the following activities:<\/p>\n<ul>\n<li>Sets up the environment.<\/li>\n<li>Finds the refresh mode of the production database.<\/li>\n<li>Shows how to the refresh mode of the refreshable clone, including disabling&nbsp;refresh on the&nbsp;refreshable clone.<\/li>\n<li>Switch between production and the refreshable clone.<\/li>\n<\/ul>\n<p><strong>Set up the refreshable clone environment:<\/strong><\/p>\n<p>For the refreshable clone environment, take the following actions.<\/p>\n<p><strong>Actions to take on YCDB1:<\/strong><\/p>\n<p>1. Create a production database and open it.<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26463-body-Picture1_12.png\" alt=\"PDB pic 1\" \/><\/p>\n<p>2. Import the data from the <strong>EXPDP<\/strong>&nbsp;dumps that you took by using the `<em>impdp<\/em>`&nbsp;utility or importing an HR schema into <strong>PURCH\\_PDB<\/strong>. For this example, import an HR schema by running the following script on the database:&nbsp;<\/p>\n<p>&nbsp;<em>@?\/demo\/schema\/human_resources\/hr_main.sql<\/em><\/p>\n<p>After it finishes, validate the HR schema details, as shown in the following figure:<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26463-body-Picture2_6.png\" alt=\"PDP pic 2\" \/><\/p>\n<p><strong>Actions to take on XCDB1:&nbsp;<\/strong><\/p>\n<p>1. Create a database link to point to the production database, <strong>PURCH\\_PDB<\/strong>.<\/p>\n<p>2. Create a refreshable <strong>PDB<\/strong>, set the refresh period to every 30 minutes, and&nbsp;validate that the data is refreshed.<\/p>\n<p>You can use all the attributes when you create a PDB that you plan to use to&nbsp;create a database in another location. For example, to modify a PDB datafile&nbsp;location, use <strong>CREATE\\_FILE\\_DEST<\/strong>&nbsp;or&nbsp; <strong>FILE\\_NAME\\_CONVERT<\/strong><\/p>\n<p>\nThe only addition is the <strong>REFRESH MODE<\/strong>&nbsp;attribute. To simplify this demonstration,&nbsp;I did not add any of the optional attributes.<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26463-body-Picture3_3.png\" alt=\"PDB pic 3\" \/><\/p>\n<p><strong>Find the refresh mode and production database details<\/strong><\/p>\n<p>You can query table <strong>DBA_PDBS<\/strong>&nbsp;to check details of the refreshable PDB mode,&nbsp;status, last refresh SCN, and its parent production database details. For&nbsp;<strong>PDB2\\_REFRO<\/strong>&nbsp;PDB, check the output as shown in the following example:<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26463-body-Picture4_1.png\" alt=\"PDB Pic 4\" \/><\/p>\n<p>After you complete your task, you should convert the refreshable PDB back to&nbsp;<strong>MOUNTED<\/strong>&nbsp;mode for a continuous refresh according to the schedule. Use the&nbsp;following commands to do this activity. The&nbsp; <em>open_mode.sql<\/em>&nbsp;used here is a&nbsp;query to check the current open_mode of the database.<\/p>\n<p>You might see the following error if you did not close the database instance<br \/>\nfor refresh:<\/p>\n<p><em>&nbsp; &nbsp; ORA-65025: Pluggable database is not closed on all instances<\/em><\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26463-body-Picture5_0.png\" alt=\"pdb pic 5\" \/><\/p>\n<p><strong>&nbsp;<\/strong><\/p>\n<p><strong>Change the refresh mode of the refreshable clone<\/strong><\/p>\n<p>You can change the mode of a refreshable clone as follows:<\/p>\n<ul>\n<li>Change manual refresh to automatic refresh.<\/li>\n<li>Change automatic refresh to manual refresh.<\/li>\n<li>Disable refresh from automatic or manual refresh mode.<\/li>\n<\/ul>\n<p><strong>Convert a manual refresh to an automatic refresh and vice versa<\/strong><\/p>\n<p><strong>Note<\/strong>: You cannot change the PDB refresh mode when logged into one other PDB.&nbsp;For example, you can&#8217;t change the mode of <strong>XPDB<\/strong>&nbsp;while logged into <strong>YPDB<\/strong>.<br \/>\nIf you try, the following error occurs:<\/p>\n<p>ORA-65118: An operation affecting a pluggable database cannot be performed from&nbsp;another pluggable database.<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26463-body-Picture6_0.png\" alt=\"pdb pic 6\" \/><\/p>\n<p>&nbsp;In manual refresh mode, you can refresh your cloned PDB as needed by using the&nbsp;following command:<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26463-body-Picture7_0.png\" alt=\"PDB pic 7\" \/><\/p>\n<p><strong>Disable PDB refresh and convert a read-only clone to a read-write-enabled database&nbsp;<\/strong><\/p>\n<p>You can disable the refresh mode of a PDB to convert your refreshable clone into<br \/>\nread-write mode.<\/p>\n<p><strong>Note<\/strong>: After you disable refresh for your pluggable database, you cannot&nbsp;enable it again. You must re-create the PDB to have it be a refreshable PDB. If&nbsp;you try to convert from the <strong>NONE<\/strong>&nbsp;refresh mode to refresh mode, you get the&nbsp;following error:<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<em>ORA-65261: pluggable database PDB2_REFRO3 not enabled for refresh.<\/em><\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26463-body-Picture8_0.png\" alt=\"PDB pic 8\" \/><\/p>\n<p>&nbsp;After you disable refresh, the PDB has read-write access.<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26463-body-Picture9_0.png\" alt=\"PDB Pic 9\" \/><\/p>\n<p><strong>Switch from production to the refreshable clone and vice versa.&nbsp;<\/strong><\/p>\n<p>Before Oracle 18c, you needed to perform all the steps to switch over the role,&nbsp;including shutting the primary and opening it as read-only.<\/p>\n<p>In this demonstration, I do the following:&nbsp;<\/p>\n<p>1. Create user <strong>C##SWITCHUSER<\/strong>&nbsp;on the container databases XCDB1 and YCDB1 by using grant connect, <strong>sysoper<\/strong>.<\/p>\n<p>2. Create a database link, <strong>dblink<\/strong>, pointing to another container database.&nbsp;In <strong>YCDB1<\/strong>, create the dblink, <strong>XCDB1SYSOPER<\/strong>, to connect <strong>XCDB1<\/strong>. Use database views, <strong>DBA\\_DB\\_LINKS and V$DATABASE<\/strong>&nbsp;to collect database details after creating the database link.<\/p>\n<p>3. Open the refreshable clone database as read-only.<\/p>\n<p>4. Run the switchover command.<\/p>\n<p>5. Validate the database status and open mode after switching the production and refreshable clone databases.<\/p>\n<p><strong>Actions to take on YCDB1:<\/strong><\/p>\n<p>Complete prerequisites 1 through 3 before executing the switchover command.<\/p>\n<p>Database link details:<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26463-body-Picture10_0.png\" alt=\"pdb pic 10\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Actions to take on XCDB1<\/strong><\/p>\n<p>Check the database link details and find the database <strong>open mode<\/strong>&nbsp;by using&nbsp;<strong>DBA\\_DB\\_LINKS<\/strong>&nbsp;and <strong>V$DATABASE<\/strong>.<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26463-body-Picture11_0.png\" alt=\"PDP pic 11\" \/><\/p>\n<p>After the switchover completes, the source PDB <strong>PURCH\\_PDB<\/strong>&nbsp;becomes&nbsp;the refreshable clone PDB. This PDB is currently in <strong>MOUNT<\/strong>&nbsp;status, and from&nbsp;now on, you can open it only in <strong>READ ONLY<\/strong>&nbsp;mode. In contrast, the original&nbsp;refreshable clone, PDB <strong>PDB2\\_REFRO<\/strong>&nbsp;is now open in <strong>READ<\/strong>&nbsp;or <strong>WRITE<\/strong>&nbsp;mode<br \/>\nand functions as a source PDB.&nbsp;<\/p>\n<p><strong>Conclusion:<\/strong><\/p>\n<p>You should not consider the refreshable clone PDB feature as a replacement for Data Guard from the perspective of high availability. However, you can use a&nbsp;refreshable clone to maintain a replica database on another server.<\/p>\n<p>This post describes how to use refreshable PDBs as replicas so that you can&nbsp;resume certain low-load, non-critical application operations, whether the&nbsp;switchover is a planned or unplanned event. Keep in mind, that you should consider&nbsp;the switchovers from the point of view of Recovery Time Objectives (RTOs, time&nbsp;to resume operations) and Recovery Point Objectives (RPOs, such as achieving&nbsp;minimal data loss).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Use the Oracle Database refreshable clone feature&#8212;;Part Two: Demonstration<\/p>\n","protected":false},"author":2,"featured_media":7656,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","format":"standard","meta":{"content-type":"","nid":"26463","content_type":"blog","created_by":"10130","authored_on":"2024-01-08T09:54:21+00:00","field_article_industries":"","tag_category":"Technical","field_blog_author_text":"by Tejashkumar Patel, Oracle Database Administrator, Rackspace Technology","seo_description":"Continue learning about Oracle refreshable clone pluggable databases (PDBs) in Oracle 18c. Utilize Oracle refreshable clones effectively.\r\n","field_featured_image":"","insights_image":"\/wp-content\/uploads\/2026\/blog_technical_images\/26463-insights_image-oracle-technical-blog-1-insights.jpg","field_partners":"","rxt_platforms":"Oracle","product":"","publisheddate":"2020-06-30T08:54:21","rxt_solutions":"Databases","opengraph_tag":"","x_tag":"","teaser_flag":"Technical Blog","seo_titile":"Using Oracle Database Refreshable Clones | Rackspace Technology","field_topics":"","field_slug":"use-the-oracle-database -refreshable-clone-feature-part-two-demonstration","footnotes":""},"categories":[178],"tags":[204],"class_list":["post-7654","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\/7654","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=7654"}],"version-history":[{"count":3,"href":"https:\/\/www.rackspace.com\/de\/wp-json\/wp\/v2\/blogs\/7654\/revisions"}],"predecessor-version":[{"id":9594,"href":"https:\/\/www.rackspace.com\/de\/wp-json\/wp\/v2\/blogs\/7654\/revisions\/9594"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rackspace.com\/de\/wp-json\/wp\/v2\/media\/7656"}],"wp:attachment":[{"href":"https:\/\/www.rackspace.com\/de\/wp-json\/wp\/v2\/media?parent=7654"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rackspace.com\/de\/wp-json\/wp\/v2\/categories?post=7654"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rackspace.com\/de\/wp-json\/wp\/v2\/tags?post=7654"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}