CDB$VIEW

You may be familiar with the data dictionary views USER_, ALL_ and DBA_. Oracle 12C introduces the CDB_ views to cater for multitency.

Looking a little deeper these CDB_ views are generated from a function called CDB$VIEW. Lets use CDB_USERS as an example.

We can see from the above CDB$VIEW(“SYS”.”DBA_USERS”). This looks like some sort of pipelined function but interestingly enough there is no table () around it.

Is there any information in relation to CDB$VIEW? I have gone through every data dictionary view I can and can find no information in relation to it. How about a trace and some tests?

We can see the usage of a fixed table above X$CDBVW$42ae64ee. Is this fixed table exposed?

Nope, we can’t select from it. How about a 10046 trace?

Now lets look at the trace file for anything interesting.

Nothing really of interest. How about we look at the X$CDBVW$42ae64ee fixed table view? I can see theres a X$CDBVW$ view but not much information about it.

How about we focus on the X$CDBVW$42ae64ee view. Wonder what this hex number represents 42ae64ee?

And there you go. Its the hex representation of the hash value of the query that is used inside the CDB$VIEW to generate the data. In my case dual.

A memory region looks to be mapped with the hash value of the innerquery which is returned via the function CDB$VIEW. I have run a number of tests and they all follow the same format

But in the scheme of things it still does not tell me a hell of a lot. If anyone out there has any more info I’d like to here about it.

In my next blog posts I’ll show a situation where the cdb$view is not returning the correct data. I have an open SR currently which is what led me to do some investigation on this.

Leave a Reply

Your email address will not be published. Required fields are marked *

CAPTCHA * Time limit is exhausted. Please reload CAPTCHA.