bs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 TEST_PDB READ WRITE NO
--关闭
SYS@testdb> alter pluggable database test_pdb close;
Pluggable database altered.
SYS@testdb> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 TEST_PDB MOUNTED
7、容器间的切换
SYS@testdb> alter session set container=test_pdb;
Session altered.
SYS@testdb> show con_name
CON_NAME
------------------------------
TEST_PDB
8、使用sql*plus直接连接PDB
查看监听,了解PDB是如何注册的
[oracle@t13s admin]$ lsnrctl status
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 15-MAR-2017 11:23:01
Copyright (c) 1991, 2016, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=bossett13s)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date 15-MAR-2017 09:35:52
Uptime 0 days 1 hr. 47 min. 10 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/app/oracle/product/12.2/db/network/admin/listener.ora
Listener Log File /oracle/app/oracle/diag/tnslsnr/bossett13s/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bossett13s)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "4abd62d724202b74e05358e8ff0a94fe" has 1 instance(s).
Instance "testdb", status READY, has 1 handler(s) for this service...
Service "test_pdb" has 1 instance(s).
Instance "testdb", status READY, has 1 handler(s) for this service...
Service "testdb" has 1 instance(s).
Instance "testdb", status READY, has 1 handler(s) for this service...
Service "testdbXDB" has 1 instance(s).
Instance "testdb", status READY, has 1 handler(s) for this service...
The command completed successfully
需要配置tns
test_pdb =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.255.232.88)(PORT = 1521))
(CONNECT_DATA =
&