{"id":3704,"date":"2025-05-29T16:49:09","date_gmt":"2025-05-29T16:49:09","guid":{"rendered":"https:\/\/w3buddy.com\/?post_type=cposts&#038;p=3704"},"modified":"2025-05-29T16:49:11","modified_gmt":"2025-05-29T16:49:11","slug":"container-database-cdb","status":"publish","type":"cposts","link":"https:\/\/w3buddy.com\/blog\/notes\/getting-started-with-oracle-dba\/container-database-cdb\/","title":{"rendered":"Container Database (CDB)"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Multitenant Container Database (CDB)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83e\udde0 <strong>Introduction<\/strong><br>What is a <strong>Container Database (CDB)<\/strong>?<br>Think of it like a <strong>hotel<\/strong> \ud83c\udfe8:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The <strong>hotel building<\/strong> is the <strong>CDB<\/strong><\/li>\n\n\n\n<li>Each <strong>hotel room<\/strong> is a <strong>Pluggable Database (PDB)<\/strong><\/li>\n\n\n\n<li>Guests (apps\/users) stay in the rooms (PDBs), not in the lobby (root)<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s break it down!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83e\udde9 <strong>What Is a CDB?<\/strong><br>A <strong>CDB (Container Database)<\/strong> is an Oracle database that includes multiple separate databases inside it, called <strong>PDBs (Pluggable Databases)<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Each PDB contains <strong>schemas, tables, indexes<\/strong>, and <strong>application-specific data<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udccc From an app or user perspective:<br>\u27a4 The <strong>PDB<\/strong> looks and behaves like a standalone database.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udccc From the operating system or Oracle perspective:<br>\u27a4 The <strong>CDB<\/strong> is the actual database instance running on disk.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83e\udde0 <strong>What Containers Exist in a CDB?<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>CDB$ROOT (Root Container)<\/strong><br>\u27a4 Stores <strong>Oracle-supplied metadata<\/strong><br>\u27a4 Manages <strong>common users<\/strong> (users shared across all PDBs)<br>\u27a4 Does <strong>not<\/strong> contain user data<\/li>\n\n\n\n<li><strong>PDB$SEED (Seed Pluggable Database)<\/strong><br>\u27a4 Read-only <strong>template<\/strong> used to create new PDBs<br>\u27a4 Cannot be modified<\/li>\n\n\n\n<li><strong>User-Created PDBs (Pluggable Databases)<\/strong><br>\u27a4 Created by DBAs to run applications<br>\u27a4 Each PDB is <strong>logically isolated<\/strong><br>\u27a4 You can plug multiple PDBs into a CDB<br>\u27a4 But a PDB <strong>can\u2019t be plugged into multiple CDBs<\/strong><\/li>\n\n\n\n<li><strong>Application Containers (Optional)<\/strong><br>\u27a4 Group of PDBs that <strong>share application data and metadata<\/strong><br>\u27a4 Helps build and manage complex multi-tenant applications<br>\u27a4 Think of it like a <strong>sub-hotel<\/strong> within your main hotel<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83e\uddf1 <strong>What\u2019s Shared and What\u2019s Not?<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table has-small-font-size\"><table><thead><tr><th>Component<\/th><th>Shared Across PDBs<\/th><th>PDB-Specific<\/th><\/tr><\/thead><tbody><tr><td>Control File<\/td><td>\u2705 Yes<\/td><td>\u274c No<\/td><\/tr><tr><td>Redo Log Files<\/td><td>\u2705 Yes<\/td><td>\u274c No<\/td><\/tr><tr><td>Data Files<\/td><td>\u274c No<\/td><td>\u2705 Each container<\/td><\/tr><tr><td>Tablespaces<\/td><td>\u274c No<\/td><td>\u2705 Each container<\/td><\/tr><tr><td>Metadata (Root)<\/td><td>\u2705 Common Users<\/td><td>\u274c No User Data<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udcc1 Each container has its own <strong>data files<\/strong> and <strong>tablespaces<\/strong>, but <strong>control files<\/strong> and <strong>redo logs<\/strong> are shared by the whole CDB.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udccc <strong>Important Note<\/strong><br>Oracle has <strong>desupported Non-CDB architecture<\/strong> in <strong>Oracle Database 21c<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u27a4 You can <strong>no longer create non-CDB instances<\/strong> using tools like:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Oracle Universal Installer<\/li>\n\n\n\n<li>DBCA (Database Configuration Assistant)<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>Multitenant Architecture<\/strong> is now <strong>mandatory<\/strong> \u2014 and honestly, it&#8217;s way more flexible and scalable.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udee0\ufe0f <strong>DBA Tip of the Day<\/strong><br>The <strong>CDB\/PDB model<\/strong> is your go-to for <strong>modern Oracle deployments<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2714\ufe0f Use it to consolidate multiple apps<br>\u2714\ufe0f Securely isolate environments<br>\u2714\ufe0f Clone PDBs quickly for dev\/test<br>\u2714\ufe0f Simplify upgrades and patching<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you&#8217;re still thinking in terms of one database = one app, it&#8217;s time to <strong>think multitenant<\/strong>!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Multitenant Container Database (CDB) \ud83e\udde0 IntroductionWhat is a Container Database (CDB)?Think of it like a hotel \ud83c\udfe8: Let\u2019s break it down! \ud83e\udde9 What Is a CDB?A CDB (Container Database) is an Oracle database that includes multiple separate databases inside it, called PDBs (Pluggable Databases). Each PDB contains schemas, tables, indexes, and application-specific data. \ud83d\udccc From [&hellip;]<\/p>\n","protected":false},"template":"","meta":{"googlesitekit_rrm_CAowu461DA:productID":""},"categories":[960,952],"class_list":["post-3704","cposts","type-cposts","status-publish","hentry","category-getting-started-with-oracle-dba","category-notes"],"_links":{"self":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/cposts\/3704","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/cposts"}],"about":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/types\/cposts"}],"wp:attachment":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/media?parent=3704"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/categories?post=3704"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}