{"id":4259,"date":"2014-12-29T19:28:00","date_gmt":"2014-12-29T18:28:00","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/oracle-multitenant-dictionary-object-links\/"},"modified":"2014-12-29T19:28:00","modified_gmt":"2014-12-29T18:28:00","slug":"oracle-multitenant-dictionary-object-links","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/oracle-multitenant-dictionary-object-links\/","title":{"rendered":"Oracle multitenant dictionary: object links"},"content":{"rendered":"<h2>By Franck Pachot<\/h2>\n<p>.<br \/>\nI&#8217;ve described Oracle 12c metadata and object links internals in a <a href=\"https:\/\/www.dbi-services.com\/index.php\/blog\/entry\/oracle-12c-cdb-metadata-a-object-links-internals#comment-363\">previous post<\/a>. But before that, the first time I investigated on it, I made a wrong assumption because I was looking at AUDIT_ACTIONS which is not correctly implemented. That investigation came from a question on <a href=\"http:\/\/www.dba-village.com\/village\/dvp_forum.OpenThread?ThreadIdA=69321#202961\">dba-village<\/a>. And recently Ivica Arsov (<a href=\"https:\/\/twitter.com\/IvicaArsov\">@IvicaArsov<\/a>) has made an interesting <a href=\"https:\/\/www.dbi-services.com\/index.php\/blog\/entry\/oracle-12c-cdb-metadata-a-object-links-internals#comment-363\">comment<\/a> about AUDIT_ACTIONS object link table, so I&#8217;ll explain here what is special with it.<\/p>\n<h3>AUDIT_ACTIONS<\/h3>\n<p>Here is how is defined AUDIT_ACTIONS:<\/p>\n<pre><code>SQL&gt; select object_name,object_type,sharing from dba_objects where object_name in ('DBA_AUDIT_TRAIL','AUDIT_ACTIONS') order by object_name,object_type;\n\nOBJECT_NAME          OBJECT_TYPE     SHARING\n-------------------- --------------- -------------\nAUDIT_ACTIONS        SYNONYM         METADATA LINK\nAUDIT_ACTIONS        TABLE           OBJECT LINK\nDBA_AUDIT_TRAIL      SYNONYM         METADATA LINK\nDBA_AUDIT_TRAIL      VIEW            METADATA LINK\n<\/code><\/pre>\n<p>It&#8217;s a sharing=object table so you expect that the data is common to all containers. And we will also query a view that reads that table &#8211; DBA_AUDIT_TRAIL.<\/p>\n<p>Then let&#8217;s query the table from CDB$ROOT and from a PDB and check from ROWID if we read the same rows:<\/p>\n<pre><code>SQL&gt; alter session set container=CDB$ROOT;\nSession altered.\n\nSQL&gt; select rowid,action,name,dbms_rowid.rowid_to_absolute_fno(rowid,'SYS','AUDIT_ACTIONS') file_id from AUDIT_ACTIONS where action=3;\n\nROWID                  ACTION NAME       FILE_ID\n------------------ ---------- ------- ----------\nAAABG7AABAAACo5AAD          3 SELECT           1\n\nSQL&gt; alter session set container=PDB1;\nSession altered.\n\nSQL&gt; select rowid,action,name,dbms_rowid.rowid_to_absolute_fno(rowid,'SYS','AUDIT_ACTIONS') file_id from AUDIT_ACTIONS where action=3;\n\nROWID                  ACTION NAME       FILE_ID\n------------------ ---------- ------- ----------\nAAABG5AABAAAA3pAAD          3 SELECT           8\n\n<\/code><\/pre>\n<p>The rows are not coming from the same file, but from the local SYSTEM tablespace of each container. This is a proof that this OBJECT LINK table is not common at all.<\/p>\n<h3>DBA_AUDIT_TRAIL<\/h3>\n<p>Now I want to check what happens when we query through the view. I don&#8217;t have the ROWID so let&#8217;s update the table in the PDB so that we can distinguish rows coming from CDB$ROOT and from PDB1:<\/p>\n<pre><code>SQL&gt; update AUDIT_ACTIONS set name='select' where action=3;\n\n1 row updated.\n\nSQL&gt; select rowid,action,name from AUDIT_ACTIONS where action=3;\n\nROWID                  ACTION NAME\n------------------ ---------- -------\nAAABG5AABAAAA3pAAD          3 select\n\nSQL&gt; select distinct dbid,action,action_name from DBA_AUDIT_TRAIL;\n\n      DBID     ACTION ACTION_NAME\n---------- ---------- ----------------------------\n 314687597          3 select\n\n<\/code><\/pre>\n<p>Ok. I&#8217;ve changed one &#8216;ACTION_NAME&#8217; to lowercase &#8211; only in the PDB1. And when I query through the view I see the local row. This definitly prooves that the implementation of AUDIT_ACTIONS is not achieving the goal of multinenant dictionary: store common oracle objects only in CDB$ROOT to avoid duplication and faciliate upgrade. Note that it is not a big problem anyway as it is just a 200 rows table.<\/p>\n<h3>DBA_CPOOL_INFO<\/h3>\n<p>In order to show the normal behaviour of object links I&#8217;ll do the same with DBA_CPOOL_INFO which is a view over SYS.CPOOL$. I&#8217;ve described this behaviour <a href=\"https:\/\/www.dbi-services.com\/index.php\/blog\/entry\/oracle-12c-cdb-metadata-a-object-links-internals\">previously<\/a> by creating my own objects but here I&#8217;ll show how it is used to store the DRCP information which is at CDB level. Here are the involved table and views:<\/p>\n<pre><code>SQL&gt; select object_name,object_type,sharing from dba_objects where object_name in ('CPOOL$','INT$DBA_CPOOL_INFO','DBA_CPOOL_INFO') order by object_name,object_type;\n\nOBJECT_NAME          OBJECT_TYPE     SHARING\n-------------------- --------------- -------------\nCPOOL$               TABLE           OBJECT LINK\nDBA_CPOOL_INFO       SYNONYM         METADATA LINK\nDBA_CPOOL_INFO       VIEW            METADATA LINK\nINT$DBA_CPOOL_INFO   VIEW            OBJECT LINK\n<\/code><\/pre>\n<p>CPOOL$ is defined with sharing=object. An internal view INT$DBA_CPOOL_INFO is defined on it with sharing=object as well. And finally that view is exposed through DBA_CPOOL_INFO.<\/p>\n<p>As before, I check the ROWID of CPOOL$ row from CDB$ROOT and PDB1:<\/p>\n<pre><code>SQL&gt; alter session set container=CDB$ROOT;\nSession altered.\n\nSQL&gt; select rowid,minsize,dbms_rowid.rowid_to_absolute_fno(rowid,'SYS','CPOOL$') file_id from SYS.CPOOL$;\n\nROWID                 MINSIZE    FILE_ID\n------------------ ---------- ----------\nAAABz5AABAAADb5AAA          4          1\n\nSQL&gt; alter session set container=PDB1;\nSession altered.\n\nSQL&gt; select rowid,minsize,dbms_rowid.rowid_to_absolute_fno(rowid,'SYS','CPOOL$') file_id from SYS.CPOOL$;\n\nROWID                 MINSIZE    FILE_ID\n------------------ ---------- ----------\nAAABz3AABAAABQJAAA          4          8\n\n<\/code><\/pre>\n<p>So this is the same as we have seen before: an OBJECT LINK has its data in each PDB.<\/p>\n<p>But what is different here is the view charing which is sharing=object. Let&#8217;s query that view after changing the value in PDB1:<\/p>\n<pre><code>SQL&gt; update SYS.CPOOL$ set minsize=0;\n1 row updated.\n\nSQL&gt; select rowid,minsize,dbms_rowid.rowid_to_absolute_fno(rowid,'SYS','CPOOL$') file_id from SYS.CPOOL$;\n\nROWID                 MINSIZE    FILE_ID\n------------------ ---------- ----------\nAAABz3AABAAABQJAAA          0          8\n\nSQL&gt; select minsize from INT$DBA_CPOOL_INFO;\n\n   MINSIZE\n----------\n         4\n\nSQL&gt; select minsize from DBA_CPOOL_INFO;\n\n   MINSIZE\n----------\n         4\n\n<\/code><\/pre>\n<p>Now we have a view which will always show the CDB$ROOT rows, even when we are in a PDB container. We still have rows in the PDB containers, but they will not be used. Once again, this defeats the goal of deduplication, but this is a very small table.<\/p>\n<h3>AWR tables<\/h3>\n<p>The main advantage of multitenant dictionary architecture is with the big tables storing data which is common in the whole CDB, such as the AWR data:<\/p>\n<pre><code>SQL&gt; alter session set container=CDB$ROOT;\nSession altered.\n\nSQL&gt; select con_id,count(*) from containers(WRH$_SQLTEXT) group by con_id;\n\n    CON_ID   COUNT(*)\n---------- ----------\n         1       5549\n\nSQL&gt; alter session set container=PDB1;\n\nSession altered.\n\nSQL&gt; select count(*) from WRH$_SQLTEXT;\n\n  COUNT(*)\n----------\n         0\n\n<\/code><\/pre>\n<p>This information &#8211; stored only from CDB$ROOT &#8211; is shared in all PDB through the OBJECT LINK view.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By Franck Pachot . I&#8217;ve described Oracle 12c metadata and object links internals in a previous post. But before that, the first time I investigated on it, I made a wrong assumption because I was looking at AUDIT_ACTIONS which is not correctly implemented. That investigation came from a question on dba-village. And recently Ivica Arsov [&hellip;]<\/p>\n","protected":false},"author":27,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[198,59],"tags":[220,455,64,96,209,66,223],"type_dbi":[],"class_list":["post-4259","post","type-post","status-publish","format-standard","hentry","category-database-management","category-oracle","tag-cdb","tag-internals","tag-multitenant","tag-oracle","tag-oracle-12c","tag-pdb","tag-pluggable-databases"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Oracle multitenant dictionary: object links - dbi Blog<\/title>\n<meta name=\"description\" content=\"How object links are implemented in 12c\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/oracle-multitenant-dictionary-object-links\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Oracle multitenant dictionary: object links\" \/>\n<meta property=\"og:description\" content=\"How object links are implemented in 12c\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/oracle-multitenant-dictionary-object-links\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2014-12-29T18:28:00+00:00\" \/>\n<meta name=\"author\" content=\"Oracle Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Oracle Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/oracle-multitenant-dictionary-object-links\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/oracle-multitenant-dictionary-object-links\/\"},\"author\":{\"name\":\"Oracle Team\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/66ab87129f2d357f09971bc7936a77ee\"},\"headline\":\"Oracle multitenant dictionary: object links\",\"datePublished\":\"2014-12-29T18:28:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/oracle-multitenant-dictionary-object-links\/\"},\"wordCount\":548,\"commentCount\":0,\"keywords\":[\"CDB\",\"internals\",\"multitenant\",\"Oracle\",\"Oracle 12c\",\"PDB\",\"Pluggable Databases\"],\"articleSection\":[\"Database management\",\"Oracle\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/oracle-multitenant-dictionary-object-links\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/oracle-multitenant-dictionary-object-links\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/oracle-multitenant-dictionary-object-links\/\",\"name\":\"Oracle multitenant dictionary: object links - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"datePublished\":\"2014-12-29T18:28:00+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/66ab87129f2d357f09971bc7936a77ee\"},\"description\":\"How object links are implemented in 12c\",\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/oracle-multitenant-dictionary-object-links\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/oracle-multitenant-dictionary-object-links\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/oracle-multitenant-dictionary-object-links\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Oracle multitenant dictionary: object links\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/66ab87129f2d357f09971bc7936a77ee\",\"name\":\"Oracle Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/f711f7cd2c9b09bf2627133755b569fb5be0694810cfd33033bdd095fedba86d?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f711f7cd2c9b09bf2627133755b569fb5be0694810cfd33033bdd095fedba86d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f711f7cd2c9b09bf2627133755b569fb5be0694810cfd33033bdd095fedba86d?s=96&d=mm&r=g\",\"caption\":\"Oracle Team\"},\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/oracle-team\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Oracle multitenant dictionary: object links - dbi Blog","description":"How object links are implemented in 12c","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/oracle-multitenant-dictionary-object-links\/","og_locale":"en_US","og_type":"article","og_title":"Oracle multitenant dictionary: object links","og_description":"How object links are implemented in 12c","og_url":"https:\/\/www.dbi-services.com\/blog\/oracle-multitenant-dictionary-object-links\/","og_site_name":"dbi Blog","article_published_time":"2014-12-29T18:28:00+00:00","author":"Oracle Team","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Oracle Team","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/oracle-multitenant-dictionary-object-links\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/oracle-multitenant-dictionary-object-links\/"},"author":{"name":"Oracle Team","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/66ab87129f2d357f09971bc7936a77ee"},"headline":"Oracle multitenant dictionary: object links","datePublished":"2014-12-29T18:28:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/oracle-multitenant-dictionary-object-links\/"},"wordCount":548,"commentCount":0,"keywords":["CDB","internals","multitenant","Oracle","Oracle 12c","PDB","Pluggable Databases"],"articleSection":["Database management","Oracle"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/oracle-multitenant-dictionary-object-links\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/oracle-multitenant-dictionary-object-links\/","url":"https:\/\/www.dbi-services.com\/blog\/oracle-multitenant-dictionary-object-links\/","name":"Oracle multitenant dictionary: object links - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2014-12-29T18:28:00+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/66ab87129f2d357f09971bc7936a77ee"},"description":"How object links are implemented in 12c","breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/oracle-multitenant-dictionary-object-links\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/oracle-multitenant-dictionary-object-links\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/oracle-multitenant-dictionary-object-links\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Oracle multitenant dictionary: object links"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/66ab87129f2d357f09971bc7936a77ee","name":"Oracle Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/f711f7cd2c9b09bf2627133755b569fb5be0694810cfd33033bdd095fedba86d?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/f711f7cd2c9b09bf2627133755b569fb5be0694810cfd33033bdd095fedba86d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f711f7cd2c9b09bf2627133755b569fb5be0694810cfd33033bdd095fedba86d?s=96&d=mm&r=g","caption":"Oracle Team"},"url":"https:\/\/www.dbi-services.com\/blog\/author\/oracle-team\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/4259","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/27"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=4259"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/4259\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=4259"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=4259"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=4259"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=4259"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}