iSelfSchooling.com  Since 1999     References  |  Search more  | Oracle Syntax  | Free Online Oracle Training

    Home      .Services     Login       Start Learning     Certification      .                 .Share your BELIEF(s)...

 

. Online Accounting        .Copyright & User Agreement   |
    .Vision      .Biography     .Acknowledgement

.Contact Us      .Comments/Suggestions       Email2aFriend    |

 

Oracle 12c New Features

Online Oracle Training

LESSON 06

How to login to a pluggable database and query from it

 

Let us connect to mypdb1 pluggable database. First you need to open the pluggable database.

Connect to root.

# sqlplus /nolog

SQL> connect  / as sysdba

 

Open your pluggable database (mypdb1).

SQL> ALTER PLUGGABLE DATABASE mypdb1 OPEN;

Altered

 

Connect to mypdb1 pluggable database.

SQL> connect system/mypass@mypdb1

 

Use show CON_NAME and CON_ID

SQL> show con_name

SQL> show con_id

Notice that you are not anymore in the root container.

 

Query the data files using the DBA_DATA_FILES view. Assume you are connected to the mypdb1 pluggable database.

SQL> SELECT tablespace_name, file_name FROM dba_data_files;

 

TABLESPACE_NAME

FILE_NAME

USERS

/oradata/mycdb/mypdb1/users01.dbf

UNDOTBS1

/oradata/mycdb/mypdb1/undotbs1.dbf

SYSAUX

/oradata/mycdb/mypdb1/sysaux01.dbf

SYSTEM

/oradata/mycdb/mypdb1/system01.dbf

 

 

Notice that you only see the mypdb1 pluggable database data files.

 

Query the temp file of the mypdb1 container using the DBA_TEMP_FILES view.

SQL> SELECT tablespace_name, file_name FROM dba_temp_files;

 

TABLESPACE_NAME

FILE_NAME

TEMP

/oradata/mycdb/mypdb1/temp01.dbf

Notice that the TEMP tablespace is on the mypdb1 pluggable databases.

 

Notice that there is only one spfile and password file (CDB).

# cd $ORACLE_HOME/dbs/*mycdb*

FILE_NAME

-rw "r ------ 1 oracle dba 7682 Nov 7 00:37 spfilemycdb.ora

-rw "r ------ 1 oracle dba 7682 Nov 8 10:14 orapwmycdb

 

Good Luck!

 

 

Google
 
Web web site