Database Reference
In-Depth Information
precious time during upgrades. But as you have seen in a number of places in this topic: that argument does not carry
as much weight anymore. Instead of patching the whole database, you may be able to simply unplug your PDB and
plug it into an already patched CDB. Bear in mind though that the options need to be compatible with PDBs you
intend to plug into your CDB. In some cases you still will have to recompile the PDB-specific parts of the dictionary.
You can use dbca to create templates of your “golden” image CDb database. Instead of creating the database
manually every time which is time consuming and therefore not very efficient you could create the database from the
template instead.
Note
Exploring the new CDB
Once the new Container Database is created, it is time to connect to it and explore the new Oracle release. Have a look
around; use the CDB% views to query the data dictionary. Create a few PDBs from the seed and see how quickly you
can provision a new environment. When querying the data dictionary and you don't see information about a PDB you
might have to check the open mode and open the PDB read write or read only. If the PDB is not open in those states the
CDB% views won't detect any information about them. Also remember the scope of your commands: when connected
to the root (CDB$ROOT) with DBA privileges you should be able to see all the information pertaining to the attached
and accessible containers. If you are connected to a PDB, then you will only see the information pertaining to those.
You might also want to familiarize yourself with the physical structure of your CDB. You can check the
v$parameter view to see where your control files are located, use cdb_data_files and cdb_temp_files to check where
your data and temp files are—all based or sorted on the con_id for each container. You will also see that there is no
CDB-view for online redo logs. Online redo logs are not container specific and belong to the Container Database as
such. The column CON_ID in V$LOG shows them as member of CON_ID 0. Once you are feeling more comfortable
with your database it is time to move on to Pluggable Databases.
Managing Pluggable Databases
Just before I started writing this section I saw a very good discussion on my favorite mailing list: oracle-l@freelist.
org about preferred methods used by DBAs created their database. Especially given the fact that the execution of the
catalog.sql and catproc.sql plus any ancillary scripts takes a lot of time! I couldn't tell them there and then, but
what made me rejoice was that I could have told them: the creation of a new “database” won't take a lot of time at all!
That of course depends on your understanding of database. If you consider a database as an entity to give to users in
which they can run their applications then a PDB fits the description one hundred percent.
You may recall from the discussion about containers earlier in the chapter that there is always a seed database in
a CDB, called PDB$SEED. It can be cloned in almost no time to spin off a new database for users to start working with
their new data store. If you don't like to use the rather Spartan way the seed-PDB is set up then there are other ways to
address the need to use a PDB as the source for a clone operation. It is even possible to clone a PDB over a database
link, although that method requires careful testing due to bandwidth and latency considerations. Before exploring
each of these methods in more detail it is necessary to describe an extension to the SQL language: the “pluggable”
keyword in the create database statement.
Creating a Pluggable Database
The SQL reference has been extended once again to accommodate the new features available with the new database
release. The create/alter database statement has been extended with the “pluggable” attribute. Whenever the
“pluggable” keyword is found in any of these examples, you immediately know that the command is aimed at one of
the containers. The SQL language reference however has a dedicated section about the “create pluggable database
statement”; it is not an extension of the “create database statement”.
 
 
Search WWH ::




Custom Search