Friday, July 05, 2013

Connect to pluggable database

After creating the second pluggable database, next step is to connect to the pluggable databases and cretae a tablespace in one of them.

Before connecting, be sure the pluggable databases are listed in the listener.ora..

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
    )
  )
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PDBORATEST)
      (ORACLE_HOME = /u01/app/oracle/product/12.1.0)
    )
    (SID_DESC =
      (SID_NAME = PLUGDB02)
      (ORACLE_HOME = /u01/app/oracle/product/12.1.0)
    )
)


So now we are able to make a connection to one of the pluggable databases

[oracle@localhost admin]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Fri Jul 5 11:05:13 2013

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> show con_name

CON_NAME
------------------------------
CDB$ROOT


This is still the container database, to connect to the pluggable database..

[oracle@localhost admin]$ sqlplus sys@pdboratest as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Fri Jul 5 11:06:59 2013

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Enter password:

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> show con_name

CON_NAME
------------------------------
PDBORATEST


In the pdboratest I have created a basefarm tablespace..

SQL> select tablespace_name from dba_tablespaces;

TABLESPACE_NAME
------------------------------
SYSTEM
SYSAUX
TEMP
USERS
BASEFARM01











Let's check the other pluggable database

SQL> show con_name

CON_NAME
------------------------------
PLUGDB02

SQL> select tablespace_name from dba_tablespaces;

TABLESPACE_NAME
------------------------------
SYSTEM
SYSAUX
TEMP
USERS


Tablespace just created is not there.
Lets check the container database..

SQL> show con_name

CON_NAME
------------------------------
CDB$ROOT
SQL> select tablespace_name from dba_tablespaces;

TABLESPACE_NAME
------------------------------
SYSTEM
SYSAUX
UNDOTBS1
TEMP
USERS


Also not visible...

1 comment:

Priscilla said...

This is great!