12c连接pdb的两种方法
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了12c连接pdb的两种方法相关的知识,希望对你有一定的参考价值。
连接可插拔数据库的两种方法
<roidb01:cdb:/home/oracle>$sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Sat Jan 20 17:59:56 2018
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB1 READ WRITE NO
4 PDB2 READ WRITE NO
5 PDB3 READ WRITE NO
6 PDB4 READ WRITE NO
--方法1
SQL> alter session set container=pdb1;
Session altered.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
3 PDB1 READ WRITE NO
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
--方法二
<roidb01:cdb:/home/oracle>$sqlplus sys/[email protected]:1521/pdb1 as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Sat Jan 20 18:02:02 2018
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
3 PDB1 READ WRITE NO
SQL> show user;
USER is "SYS"
SQL>
以上是关于12c连接pdb的两种方法的主要内容,如果未能解决你的问题,请参考以下文章
oracle12C安装完成后,尝试用PLSQL连接PDB数据库,发现个问题PDB有没有SID?使用服务名来连接还是用SID?