博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
12C 启用客户端通过SID 连接PDB,防止ORA-12545
阅读量:5306 次
发布时间:2019-06-14

本文共 3382 字,大约阅读时间需要 11 分钟。

 
12C 通过SID 连接PDB 报ora-12545
 

 

通过在监听 listener.ora 加上配置:
 USE_SID_AS_SERVICE_
listener name
=ON
 

 

在重新配置TNS:

 

测试连接:
 

 

 
参考文档:
文档 ID 1644355.1

APPLIES TO:Oracle Net Services - Version 12.1.0.1 and later


Information in this document applies to any platform.

SYMPTOMS

 Client connection string uses SID to connect to TEST database .For example :

net12c =

  (DESCRIPTION =
    (ADDRESS=(protocol = tcp)(HOST=test.oracle.com)(port = 1521))
    (CONNECT_DATA=(SERVER=DEDICATED)(SID = TEST))
)

The TEST database is changed to a pluggable database and client connection fais with ORA-12505.

 C:\Users\test>sqlplus sys/test_12c@net12c as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Wed Apr 16 18:15:25 2014
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
ERROR:
ORA-12505: TNS:listener does not currently know of SID given in connect
descriptor

CHANGES

 The TEST database is now a PDB. Connections to a pluggable database use service name .

 

CAUSE

PDB is not an instance, so using SID in the connection string will not work unless the following listener.ora file

setting is in place:  USE_SID_AS_SERVICE_listener name=ON

When the database is an Oracle Database 12c container database, the client must specify a service name in order to connect to it. 

Listener status shows TEST as only a service :

Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=test.oracle.com)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521ipc)))
Services Summary...
Service "CDB1" has 1 instance(s).
Instance "cdb1", status READY, has 1 handler(s) for this service...
Service "CDB1XDB" has 1 instance(s).
Instance "cdb1", status READY, has 1 handler(s) for this service...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service.
Service "TEST" has 1 instance(s).
Instance "cdb1", status READY, has 1 handler(s) for this service...
The command completed successfully 

 

SOLUTION

Use USE_SID_AS_SERVICE_listener_name=on in listener.ora and restart the listener . This will enable the system identifier (SID) in the connect descriptor to be interpreted as a service name when a user attempts a database connection. Database clients with earlier releases of Oracle Database that have hard-coded connect descriptors can use this parameter to connect to a container or pluggable database.

Example of usage in listener.ora:

LISTENER= 

   (DESCRIPTION=
    (ADDRESS_LIST= (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
  )

USE_SID_AS_SERVICE_LISTENER=ON

The connection will work after this change:

C:\Users\test>sqlplus sys/test_12c@TNSNet12c as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Wed Apr 16 18:28:40 2014
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing opt
ions
SQL>

 OR

- Modify client connection string to use the actual PDB service name in the SID field :

TNSNet12c =

  (DESCRIPTION =
    (ADDRESS=(protocol = tcp)(HOST=test.oracle.com)(port = 1521))
    (CONNECT_DATA=(SERVER=DEDICATED)(SID = TEST))
  )

 

The listener will interpret the value for SID=TEST as SERVICE_NAME=TEST and allow the connection.

 

 

 
 
 

<wiz_tmp_tag id="wiz-table-range-border" contenteditable="false" style="display: none;">

 
 
 
 

转载于:https://www.cnblogs.com/cqdba/p/2816d957f7fe0e1eaddab830b9274b14.html

你可能感兴趣的文章
简单了解HashCode()
查看>>
闭包理解
查看>>
asp.net C#后台实现下载文件的几种方法(全)
查看>>
Web前端开发工程师的具备条件
查看>>
实用Android开发工具和资源精选
查看>>
TileMap
查看>>
JS属性大全
查看>>
java复制文件
查看>>
第一册:lesson seventy nine.
查看>>
GCD的同步异步串行并行、NSOperation和NSOperationQueue一级用dispatch_once实现单例
查看>>
团队作业
查看>>
数据持久化时的小bug
查看>>
mysql中key 、primary key 、unique key 与index区别
查看>>
bzoj2257
查看>>
Linux查看文件编码格式及文件编码转换<转>
查看>>
Leetcode: Find Leaves of Binary Tree
查看>>
Vue 模板解释
查看>>
http://www.bootcss.com/
查看>>
20145308 《网络对抗》 注入shellcode+Return-to-libc攻击 学习总结
查看>>
将多张图片和文字合成一张图片
查看>>