简体   繁体   English

当 cdb 正在连接时,无法从 sql 开发人员连接到 pdb Oracle 19c

[英]Unable to connect to pdb from sql developer while cdb is getting connected Oracle 19c

I have recently installed Oracle 19c enterprise edition on Virtual box with host as windows 10 while guest machine in Linux Oracle. I have recently installed Oracle 19c enterprise edition on Virtual box with host as windows 10 while guest machine in Linux Oracle.

I am able to connect to CDB database both from sqlplus(Installed on Virtualbox ie guest machine) and SQLDeveloper installed on windows 10.我能够从 sqlplus(安装在 Virtualbox 即来宾机器上)和安装在 windows 10 上的 SQLDeveloper 连接到 CDB 数据库。

But I am unable to connect to PDB database from SQL Developer while I am able to connect it from SQL PLUS ie from guest machine using export ORACLE_PDB_SID=testpdb1但是我无法从 SQL Developer 连接到 PDB 数据库,而我能够从 SQL PLUS 连接它,即从客户机使用export ORACLE_PDB_SID=testpdb1

In SQLDeveloper I am getting below error message.在 SQLDeveloper 中,我收到以下错误消息。

  Status : Failure -Test failed: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
  (CONNECTION_ID=+zZy85nyTtSOaamzG3UnBw==)

在此处输入图像描述

When using the service name raido button below error message apprears:使用下面的服务名称 raido 按钮时出现错误消息:

Status : Failure -Test failed: Listener refused the connection with the following error:
ORA-12514, TNS:listener does not currently know of service requested in connect descriptor
  (CONNECTION_ID=H5R80kOxSAy+Cv74InS7MQ==)

Below are my Listener.ora and Tnsnames.ora下面是我的 Listener.ora 和 Tnsnames.ora

testcdb =
  (ADDRESS_LIST=
#   (ADDRESS=(PROTOCOL=tcp)(HOST=atif.localdomain)(PORT=1521))
    (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.29.71)(PORT=1521))
#   (ADDRESS=(PROTOCOL=tcp)(HOST=atif)(PORT=1521))
#   (ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY))
)   

# SID_LIST_<lsnr>
#   List of services the listener knows about and can connect 
#   clients to.  There is no default.  See the Net8 Administrator's
#   Guide for more information.
#
 SID_LIST_testcdb=
   (SID_LIST=
    (SID_DESC=
#           #BEQUEATH CONFIG
#          (GLOBAL_DBNAME=salesdb.mycompany)
          (SID_NAME=testcdb)            
         (ORACLE_HOME=/f01/app/oracle/product/19.3)
#           #PRESPAWN CONFIG
#         (PRESPAWN_MAX=20)
#     (PRESPAWN_LIST=
#           (PRESPAWN_DESC=(PROTOCOL=tcp)(POOL_SIZE=2)(TIMEOUT=1))
#         )
        )
      )
STARTUP_WAIT_TIME_testcdb=0
CONNECT_TIMEOUT_testcdb=10
TRACE_LEVEL_testcdb=OFF
LOG_DIRECTORY_testcdb=/f01/app/oracle/product/19.3/network/admin
LOG_FILE_testcdb=testcdb
TRACE_DIRECTORY_testcdb=/f01/app/oracle/product/19.3/network/admin
TRACE_FILE_testcdb=testcdb
ADMIN_RESTRICTIONS_testcdb=ON
SUBSCRIBE_FOR_NODE_DOWN_EVENT_testcdb=OFF

Tnsnames.ora Tnsnames.ora

testcdb =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.29.71)(PORT = 1521))
#       (ADDRESS = (PROTOCOL = TCP)(HOST = atif)(PORT = 1521)
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = testcdb)
#       (INSTANCE_NAME = testcdb)
     )
   )
testpdb1 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.29.71)(PORT = 1521))
#       (ADDRESS = (PROTOCOL = TCP)(HOST = atif)(PORT = 1521)
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = testpdb1)
#       (INSTANCE_NAME = testcdb)
     )
   )

You MUST use the PDB service name when connecting to a multi-tenanted pluggable database.连接到多租户可插拔数据库时,您必须使用 PDB 服务名称。

The SID will also be used to go back to a Container Database. SID 还将用于将 go 返回到容器数据库。

Change your radio button to 'Service Name' from 'SID'将单选按钮从“SID”更改为“服务名称”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM