Sunday, January 11, 2015

What are Pluggable database in Oracle & Setting up ODI Repository with Oracle 12c.



Oracle 12 c has recently introduced a new concept of plug-gable databases which actually aims to separate the metadata from business user data. The concept is to create a container that will hold the user data schema. The details about the plug-gable database and how they work can be referenced from below. 


But here are few questions?

How do I connect to a pluggable database using SQL developer or TOAD?

The Answer is simple with oracle installation it creates and ask for the name of the pluggable database e.g. PDBORCL (in our case this is the pluggable database name). If you are not sure you can login to system using SYS user and execute below query. You can see I have a PDB with name as PDBORCL and its open. If it’s not open you can open it by issuing the second SQL statement below

select name, open_mode from v$pdbs;

PDBORCL             READ WRITE

Alter pluggable database all open;

Now you have to define a TNS entry in your oracletns.ora file as follows and you will be able to connect it using TOAD/SQL Developer.
PDBORCL=
  (DESCRIPTION=
    (ADDRESS=
      (PROTOCOL=TCP)
      (HOST=localhost)
      (PORT=1521)
    )
    (CONNECT_DATA=
      (SERVER=dedicated)
      (SERVICE_NAME=PDBORCL)
    )
  )


How do I Setup the ODI repository into a pluggable database using RCU?

The RCU utility will setup the repository for you in the oracle 12c, but if you have configured the pluggable database option the RCU pre check fails with below error.
RCU-6002: The specified database does not meet the minimum requirement to load metadata repository. RCU-6080: Global prerequisite check failed - Check requirement for specified database the selected Oracle database is a multitenant container database (CDB). Connecting to a multitenant container database (CDB) is not supported. Instead, connect to a valid pluggable database (PDB).
So to solve this issue while RCU asks for the details on “Database connection details” step provide the Service Name: PDBORCL instead of your main service name e.g. ORCL which is by default.  Doing so all the repository objects and user will be created in the PDBORCL database and later you will use the below steps to create or connect to your PDB based repository.

How do I connect to a pluggable database using ODI or any other application?

For my case we have an issue while connecting to the PDB database while setting up the ODI repository we did the following while filling up the JDBC URL. Giving only the service name will give error and to resolve it we did the following by providing the full TNS entry details.

jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=PDBORCL)))


Hope that helps.
Reference.
http://blog.e-dba.com/blog/2013/06/29/oracle-database-12c-pluggable-databases/
http://www.youtube.com/watch?v=ynUURa5dA6Q