12C 连接方式和 Oracle Easy Connect Naming method

1.12C 连接方式

 

PDB is not an instance, so using SID in the connection string will not work.

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). I
nstance "cdb1", status READY, has 1 handler(s) for this service... The command completed successfully 

 

 

2.Oracle Easy Connect Naming method

 

sqlplus hddtusr/hddtusr_0824@//192.168.27.145:15021/phddtuat

 

 

在Oracle 10g中,Oracle还提供了一种称为“Oracle Easy Connect Naming method"
的连接方式。这种方法是对hostnaming method的一种改进,因为hostnaming method
只能使用缺省的1521 port,而Oracle Easy Connect Naming method则可以指定自己的
port.
配置Oracle Easy Connect Naming method基本要求:
1)Oracle 10g Net Serrices必须安装在client端
2)在服务端和客户端必须同时支持TCP/IP协议
3)使用这种连接方式,不支持比较高级的连接符,比如连接池和外部过程 调用(external procedure calls)
语法比较简单:只需要按照如下的格式指定HOST:PORT/SERVICE_NAME就可以了。 但如果通过url连接的话,
需要在@后面增加2个反斜杠"//"
比如:
sqlplus study/study@localhost:1522/study
sqlplus study/study@//10.10.10.1/study
备注: 1)如果使用默认port,可以不指定:PORT部分,直接HOST/SERVICE_NAME
2)在10g中当安装了Oracle Net后,这种连接方式被自动配置
3)对应sqlnet.ora中names.diretory_path中的方法EZCONNECT
NAMES.DIRECTORY_PATH= (TNSNAMES,EZCONNECT,HOSTNAME)
下面测试一下看看。

C:sqlplus study/study@127.0.0.1:1521/study
SQL*Plus: Release 10.2.0.1.0 - Production on 星期一 6月 11 16:52:44 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options
SQL> exit 从 Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options 断开


C:sqlplus study/study@127.0.0.1/study


SQL*Plus: Release 10.2.0.1.0 - Production on 星期一 6月 11 16:52:51 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options
SQL> exit

从 Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options 断开
C:

转载于:https://www.cnblogs.com/feiyun8616/p/5970198.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值