{"id":2084,"date":"2021-11-21T18:55:16","date_gmt":"2021-11-21T16:55:16","guid":{"rendered":"http:\/\/www.ludovicocaldara.net\/dba\/?p=2084"},"modified":"2021-11-21T18:55:16","modified_gmt":"2021-11-21T16:55:16","slug":"can-i-rename-a-pdb-in-a-data-guard-configuration","status":"publish","type":"post","link":"https:\/\/www.ludovicocaldara.net\/dba\/can-i-rename-a-pdb-in-a-data-guard-configuration\/","title":{"rendered":"Can I rename a PDB in a Data Guard configuration?"},"content":{"rendered":"<p>Someone asked me this question recently.<\/p>\n<p><strong>The answer is: yes!<\/strong><\/p>\n<p>Let&#8217;s see it in action.<\/p>\n<p>On the primary I have:<\/p>\n<pre class=\"lang:plsql highlight:0 decode:true\">----- PRIMARY\r\nSQL&gt; show pdbs;\r\n\r\n    CON_ID CON_NAME                       OPEN MODE  RESTRICTED\r\n---------- ------------------------------ ---------- ----------\r\n         2 PDB$SEED                       READ ONLY  NO\r\n         3 RED                            READ WRITE NO\r\n         4 SAND                           READ WRITE NO<\/pre>\n<p>And of course the same PDBs on the standby:<\/p>\n<pre class=\"lang:plsql highlight:0 decode:true\">----- STANDBY\r\nSQL&gt; show pdbs\r\n\r\n    CON_ID CON_NAME                       OPEN MODE  RESTRICTED\r\n---------- ------------------------------ ---------- ----------\r\n         2 PDB$SEED                       MOUNTED\r\n         3 RED                            MOUNTED\r\n         4 SAND                           MOUNTED<\/pre>\n<p>Let&#8217;s change the PDB RED name to TOBY: The PDB rename operation is straightforward (but it requires a brief downtime). To be done on the primary:<\/p>\n<pre class=\"lang:plsql highlight:0 decode:true\">SQL&gt; alter pluggable database red close;\r\n\r\nPluggable database altered.\r\n\r\nSQL&gt; alter pluggable database red open restricted;\r\n\r\nPluggable database altered.\r\n\r\nSQL&gt; alter session set container=red;\r\n\r\nSession altered.\r\n\r\nSQL&gt; alter pluggable database rename global_name to toby;\r\n\r\nPluggable database altered.\r\n\r\nSQL&gt; alter session set container=cdb$root;\r\n\r\nSession altered.\r\n\r\nSQL&gt; show pdbs\r\n\r\n    CON_ID CON_NAME                       OPEN MODE  RESTRICTED\r\n---------- ------------------------------ ---------- ----------\r\n         2 PDB$SEED                       READ ONLY  NO\r\n         3 TOBY                           READ WRITE YES\r\n         4 SAND                           READ WRITE NO\r\n\r\nSQL&gt; alter pluggable database toby close;\r\n\r\nPluggable database altered.\r\n\r\n\r\nSQL&gt; alter pluggable database toby open;\r\n\r\nPluggable database altered.\r\n\r\nSQL&gt;<\/pre>\n<p>On the standby, I can see that the PDB changed its name:<\/p>\n<pre class=\"lang:plsql highlight:0 decode:true \">SQL&gt; show pdbs\r\n\r\n    CON_ID CON_NAME                       OPEN MODE  RESTRICTED\r\n---------- ------------------------------ ---------- ----------\r\n         2 PDB$SEED                       MOUNTED\r\n         3 TOBY                           MOUNTED\r\n         4 SAND                           MOUNTED\r\nSQL&gt;<\/pre>\n<p>The PDB name change is propagated transparently with the redo apply.<\/p>\n<p>&#8212;<\/p>\n<p>Ludo<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Someone asked me this question recently. The answer is: yes! Let&#8217;s see it in action. On the primary I have: &#8212;&#8211; PRIMARY SQL&gt; show pdbs; CON_ID CON_NAME OPEN MODE RESTRICTED &#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;- 2 PDB$SEED READ ONLY NO 3 &hellip; <a href=\"https:\/\/www.ludovicocaldara.net\/dba\/can-i-rename-a-pdb-in-a-data-guard-configuration\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[329,328],"tags":[],"class_list":["post-2084","post","type-post","status-publish","format-standard","hentry","category-oracle-dg","category-oracle-mt"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/posts\/2084","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/comments?post=2084"}],"version-history":[{"count":3,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/posts\/2084\/revisions"}],"predecessor-version":[{"id":2087,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/posts\/2084\/revisions\/2087"}],"wp:attachment":[{"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/media?parent=2084"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/categories?post=2084"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/tags?post=2084"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}