con_id,dbid,NAME,OPEN_MODE
from
v$pdbs;? ? CON_ID? ? ?
?DBID NAME? ? ? ? ? ? ? ? ? ? ? ? ?
OPEN_MODE----------
?---------- ------------------------------ ----------? ? ? ? 3
?3313918585 PDB1? ? ? ? ? ? ? ? ? ? ? ? ? READ
WRITE
pdb的管理可以在cdb中进行也可以在pdb中进行,如果是cdb中进行,需要PLUGGABLE关键字,如果是pdb中直接和普通数据库一样
登录pdb
[oracle@xifenfei
?~]$ lsnrctl status LSNRCTL
for
Linux: Version 12.1.0.1.0 - Production on
12-MAY-2013 08:07:02 Copyright
?(c) 1991, 2013, Oracle.? All
rights reserved. Connecting
to
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xifenfei)(PORT=1521)))STATUS
of
the LISTENER------------------------Alias? ? ? ? ? ? ? ? ? ?
?LISTENERVersion? ? ? ? ? ? ? ? ?
?TNSLSNR for
Linux: Version 12.1.0.1.0 - ProductionStart
Date? ? ? ? ? ? ?
11-MAY-2013 18:30:54Uptime? ? ? ? ? ? ? ? ?
?0 days 13 hr. 36 min.
?8 secTrace
Level? ? ? ? ? ? ?
offSecurity? ? ? ? ? ? ? ?
ON:
Local
OS AuthenticationSNMP? ? ? ? ? ? ? ? ? ?
OFFListener
?Parameter File? /u01/app/grid/product/12.1/network/admin/listener.oraListener
?Log File? ? ? ? /u01/app/grid/diag/tnslsnr/xifenfei/listener/alert/log.xmlListening
?Endpoints Summary...? (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))? (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=xifenfei)(PORT=1521)))? (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=xifenfei)(PORT=5500))(Security=(my_wallet_directory=/u01/oracle/12.1/db_1/admin/cdb/xdb_wallet))(Presentation=HTTP)(Session=RAW))Services
?Summary...Service
"+ASM"
has 1 instance(s).? Instance
"+ASM",
?status READY, has 1 handler(s) for
this service...Service
"cdb"
has 1 instance(s).? Instance
"cdb",
?status READY, has 1 handler(s) for
this service...Service
"cdbXDB"
has 1 instance(s).? Instance
"cdb",
?status READY, has 1 handler(s) for
this service...Service
"pdb1"
has 1 instance(s).? Instance
"cdb",
?status READY, has 1 handler(s) for
this service...Service
"pdb2"
has 1 instance(s).? Instance
"cdb",
?status READY, has 1 handler(s) for
this service...The
?command completed successfully[oracle@xifenfei
?~]$ tnsping pdb1 TNS
?Ping Utility for
Linux: Version 12.1.0.1.0 - Production on
12-MAY-2013 08:07:09 Copyright
?(c) 1997, 2013, Oracle.? All
rights reserved. Used
?parameter files:? Used
?TNSNAMES adapter to
resolve the aliasAttempting
to
contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = xifenfei)(PORT
?= 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = pdb1)))OK
?(20 msec)[oracle@xifenfei
?~]$ sqlplus sys/xifenfei@pdb1 as
sysdba SQL*Plus:
?Release 12.1.0.1.0 Production on
Sun May 12 08:08:02 2013 Copyright
?(c) 1982, 2013, Oracle.? All
rights reserved.? Connected
to:Oracle
Database
12c Enterprise Edition Release 12.1.0.1.0 - 64bit ProductionWith
the Partitioning, Automatic Storage Management, OLAP, Advanced Analyticsand
Real
Application Testing options SQL>
?show con_name; CON_NAME------------------------------PDB1? [oracle@xifenfei
?~]$ sqlplus / as
sysdba SQL*Plus:
?Release 12.1.0.1.0 Production on
Sun May 12 08:09:14 2013 Copyright
?(c) 1982, 2013, Oracle.? All
rights reserved.? Connected
to:Oracle
Database
12c Enterprise Edition Release 12.1.0.1.0 - 64bit ProductionWith
the Partitioning, Automatic Storage Management, OLAP, Advanced Analyticsand
Real
Application Testing options SQL>
alter
session set
container=pdb1; Session
?altered. SQL>
?show con_name; CON_NAME------------------------------PDB1
pdb可以通过alter session container进入也可以直接通过tns方式登录
创建用户
SQL>
?show con_name; CON_NAME-----