Skip to main content

OOW2012 - The Oracle Database 12c: The Pluggable Database

To me, one of the biggest announcements this week was not that Larry finally learnt how to use a clicker, but the disclosure of some of the new features of the next version of the Oracle Database. This version is also the "first real multi-tenant database". So what does this mean?
In the current version of the database the core Oracle data dictionary is mixed up with the tables, packages etc you created yourself. All information is stored in the same obj$, tab$ and source$ tables. In 12c there is an architectural separation between the core Oracle system and your own application. The core Oracle data dictionary is called the Container Database (CDB). The part of the database that contains your own code is called the Pluggable Database (PDB). This PDB also contains its own datadictionary with it own obj$, tab$ etc tables. So it is a sort of hierarchy: objects are first located in the PDB, when they're not found there, information from the CDB is retrieved. 
The best thing is, you can plugin many PDB's into one CDB. And so creating a true separation of data and sources between two databases that are plugged in into one CDB. It is obvious that both the CDB and the PDB have a much smaller footprint than a database containing both. So upgrading the Oracle software will be done on the CDB only and will be much faster. Cloning a PDB - containing your application - can be done way faster because you don't need to clone all the core Oracle stuff
Implementation under the covers is done using transportable tablespaces with data and metadata. This architecture also implies there are different types of users: local users in a PDB and a common user in the CDB. A PDB can be administered by a privileged local user, the metadata about the PDBs are administered by the common user. And any privileged user can switch between PDBs. Every PDB has a default service with its name. Service names across the CDB hav to be unique within the CDB. And you can define database links between PDBs.
You can imagine that creating a new, empty, PDB is 1000 times faster than creating a whole new database...

From an APEX point of view this implies that you actually can run multiple versions of APEX in one database - as long as every APEX version runs in a separate PDB!

Comments

Martin Berger said…
Roel,
thank you for this first details.
Just a short question: from a CBDs view, is there only one obj$ which holds all the objects of itself and all the PDBs, or is there it's own obj$ and a set of different PDB1.obj$, PDB2.obj$, PDB3.obj$?
Roel said…
AFAIK the PDB has it's own set of (local) obj$ etc tables containing only the local stuff - and not the core Oracle ones (and certainly not the information of the other PDB's)
Huber said…
I'm oracle dba, but i kown sql-server and i think this part feature is same to sql-server
DanyC said…
Indeed Huber - MS SQL has this feature since 2k version and personally i'm still trying to understand how the tunning/ different oracle version will work with this new feature? Maybe there are good pros but a lot of cons as well.

@Roel - any view on the points i raised?

Thx a lot,
DaniC
Roel said…
Using this feature you can easily transport applications (in one PDB) from one environment to another by "plug and play". Also upgrading is more simple. Once you have a 12.x.x CDB, you can plug in any older PDB and it's upgraded on the spot. And creating a "Database" (PDB in this case) is a matter of seconds....
DanyC said…
This are good pros for sure but i still don't see how will work from tunning side.

Say you have a live PDB and you have to investigate a performance issue,you "plug & play" into Dev CDB but

a) you won't have the same env since will be different stats/ plans
b) if you collect stats you might affect performance of all the others PDBs

DaniC
Roel said…
I am not sure, a I haven't got the chance to play with it, but I think tuning won't be much different. Statistics and plans are in the PDB, so you could clone a production PDB and plug it in elsewhere to investigate an issue (but the hardware may be different though). It looks like it will be easier than nowadays....
Anonymous said…
Read more insights on Oracle 12c PDB here:
http://www.dadbm.com/2013/02/oracle-12c-pluggable-database-plug-unplug-and-clone/

-- Kirill Loifman

Popular posts from this blog

apex_application.g_f0x array processing in Oracle 12

If you created your own "updatable reports" or your custom version of tabular forms in Oracle Application Express, you'll end up with a query that looks similar to this one: then you disable the " Escape special characters " property and the result is an updatable multirecord form. That was easy, right? But now we need to process the changes in the Ename column when the form is submitted, but only if the checkbox is checked. All the columns are submitted as separated arrays, named apex_application.g_f0x - where the "x" is the value of the "p_idx" parameter you specified in the apex_item calls. So we have apex_application.g_f01, g_f02 and g_f03. But then you discover APEX has the oddity that the "checkbox" array only contains values for the checked rows. Thus if you just check "Jones", the length of g_f02 is 1 and it contains only the empno of Jones - while the other two arrays will contain all (14) rows. So for

Filtering in the APEX Interactive Grid

Remember Oracle Forms? One of the nice features of Forms was the use of GLOBAL items. More or less comparable to Application Items in APEX. These GLOBALS where often used to pre-query data. For example you queried Employee 200 in Form A, then opened Form B and on opening that Form the Employee field is filled with that (GLOBAL) value of 200 and the query was executed. So without additional keys strokes or entering data, when switching to another Form a user would immediately see the data in the same context. And they loved that. In APEX you can create a similar experience using Application Items (or an Item on the Global Page) for Classic Reports (by setting a Default Value to a Search Item) and Interactive Reports (using the  APEX_IR.ADD_FILTER  procedure). But what about the Interactive Grid? There is no APEX_IG package ... so the first thing we have to figure out is how can we set a filter programmatically? Start with creating an Interactive Grid based upon the good old Employ

Stop using validations for checking constraints !

 If you run your APEX application - like a Form based on the EMP table - and test if you can change the value of Department to something else then the standard values of 10, 20, 30 or 40, you'll get a nice error message like this: But it isn't really nice, is it? So what do a lot of developers do? They create a validation (just) in order to show a nicer, better worded, error message like "This is not a valid department".  And what you then just did is writing code twice : Once in the database as a (foreign key) check constraint and once as a sql statement in your validation. And we all know : writing code twice is usually not a good idea - and executing the same query twice is not enhancing your performance! So how can we transform that ugly error message into something nice? By combining two APEX features: the Error Handling Function and the Text Messages! Start with copying the example of an Error Handling Function from the APEX documentation. Create this function