{"id":5545,"date":"2026-03-07T18:36:02","date_gmt":"2026-03-07T13:06:02","guid":{"rendered":"https:\/\/w3buddy.com\/?p=5545"},"modified":"2026-03-07T18:36:04","modified_gmt":"2026-03-07T13:06:04","slug":"how-to-change-pdb-dbid-in-oracle-using-the-clone-method","status":"publish","type":"post","link":"https:\/\/w3buddy.com\/blog\/how-to-change-pdb-dbid-in-oracle-using-the-clone-method\/","title":{"rendered":"How to Change PDB DBID in Oracle Using the Clone Method"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In Oracle Multitenant architecture, every <strong>Pluggable Database (PDB)<\/strong> has a unique <strong>DBID (Database Identifier)<\/strong>. Oracle and tools like RMAN use this identifier to uniquely identify a database.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Many DBAs think unplugging and plugging a PDB automatically generates a new DBID. However, this is not always true. The DBID is stored inside the <strong>database datafiles<\/strong>, so Oracle will not change it unless new datafiles are created.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The easiest way to generate a new DBID is to <strong>clone the PDB<\/strong>. During cloning, Oracle creates new datafiles and automatically assigns a new DBID.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This guide shows the exact steps.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: Connect to the Root Container<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Connect to the database as SYSDBA and switch to the root container.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sqlplus \/ as sysdbaSHOW CON_NAME;ALTER SESSION SET CONTAINER = CDB$ROOT;<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2: Check the Current PDB DBID<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">First, check the DBID of the existing PDB.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SELECT con_id, name, dbid FROM v$pdbs;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Example output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">CON_ID  NAME   DBID<br>------  -----  ----------<br>3       PDB1   1234567890<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3: Clone the PDB<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Next, create a clone of the PDB. Oracle will generate new datafiles during this process.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">CREATE PLUGGABLE DATABASE PDB1_NEW FROM PDB1;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Because new datafiles are created, Oracle assigns a <strong>new DBID<\/strong> to the cloned PDB.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4: Open the New PDB<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">After cloning completes, open the new PDB.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ALTER PLUGGABLE DATABASE PDB1_NEW OPEN;<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Step 5: Verify the New DBID<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now check the DBID again.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SELECT con_id, name, dbid FROM v$pdbs;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Example output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">CON_ID  NAME       DBID<br>------  --------   ----------<br>3       PDB1       1234567890<br>5       PDB1_NEW   9876543210<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The cloned PDB now has a <strong>different DBID<\/strong>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Step 6: Remove the Old PDB (Optional)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you only needed a new DBID, you can remove the old PDB.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Close the PDB first:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ALTER PLUGGABLE DATABASE PDB1 CLOSE IMMEDIATE;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then drop it:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">DROP PLUGGABLE DATABASE PDB1 INCLUDING DATAFILES;<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Important Points<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Oracle does <strong>not allow direct DBID modification<\/strong><\/li>\n\n\n\n<li>DBID is stored in <strong>database datafiles<\/strong><\/li>\n\n\n\n<li>DBID changes only when <strong>new datafiles are created<\/strong><\/li>\n\n\n\n<li><strong>Cloning a PDB automatically generates a new DBID<\/strong><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Changing the DBID of a PDB is not possible directly in Oracle. Instead, you should <strong>clone the PDB<\/strong>. The cloning process creates new datafiles and automatically assigns a new DBID.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This method is commonly used in <strong>testing environments, database cloning, and backup conflict resolution<\/strong>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Oracle Multitenant architecture, every Pluggable Database (PDB) has a unique DBID (Database Identifier). Oracle and tools like RMAN use this identifier to uniquely identify a database. Many DBAs think unplugging and plugging a PDB automatically generates a new DBID. However, this is not always true. The DBID is stored inside the database datafiles, so [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":5546,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"googlesitekit_rrm_CAowu461DA:productID":"","footnotes":""},"categories":[1225],"tags":[],"class_list":["post-5545","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/posts\/5545","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/comments?post=5545"}],"version-history":[{"count":1,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/posts\/5545\/revisions"}],"predecessor-version":[{"id":5547,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/posts\/5545\/revisions\/5547"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/media\/5546"}],"wp:attachment":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/media?parent=5545"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/categories?post=5545"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/tags?post=5545"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}