Posted on

Editioning – new Data Dictionary Views

There are of course some changes to data dictionary views to make them understand editions. Often you’ll find a new column called “edition” or “edition_name” and that contains exactly what you’d expect. But in this new world where objects that used to be unique in their namespace can now be instantiated in multiple editions, how can you see what is in an edition other than the one your session is using?

That is the purpose of the “_ae” views. That stands for “all editions”, by the way. These views also contain the edition column that has appeared on the traditional views, but these views can contain multiple rows. I’ll use dba_objects and dba_objects_ae to illustrate this. The effective PK for dba_objects is owner + object_name + object_type, in other words, if you were to get counts grouping by these 3 columns, you would find them all to be 1. If you ran the same query on dba_objects_ae you might get some rows with counts > 1 because it contains rows from multiple editions. The edition shown in dba_objects rows will not always be the current edition of your session because you might be inheriting some objects from parent editions, but the edition name will never be a child edition of your current edition (children inherit from parents, never the other way). That is not true for dba_objects_ae, it will show you objects in editions that are children to your current edition, it ignores your current edition and shows you everything. A good analogy is to consider the difference between user_tables and dba_tables, the first filters out any tables you do not own, the second shows them all. Similarly, dba_objects filters out all objects that are not visible in your current edition, dba_objects_ae shows them all.

So for general purposes, use the views that you always have — they are your session’s “reality”, but to query objects across all the editions use the “_ae” views. They might seem rather pointless to you now, but get familiar with them anyway, because you will need them in the future.

You might also find that there are some missing “_ae” views. I have found two in particular that I needed and had to create myself. I will address those in future posts because they are large topics in themselves and need enough explanation to warrant their own post.