ITPub博客

首页 > 数据库 > Oracle > oracle客户端连接server 端, tnsnames的三种设置方式

oracle客户端连接server 端, tnsnames的三种设置方式

原创 Oracle 作者:likaiabc 时间:2007-10-03 15:40:14 0 删除 编辑

一、CONNECT_DATA设置为oracle的全局数据库名

TOS =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = soho-ivgcrcy9al)(PORT = 1521))

)

(CONNECT_DATA =

(SERVICE_NAME = tos.lee.com)

)

)

假定数据库init.ora的参数设置为
db_name = tos

db_domain = lee.com

也可以直接指定service_names = tos.lee.com

注意,service_names是个动态参数,pmon进程在动态的注册到listener 时有延迟(大概几分钟)

二、设置SERVICE_NAME listener.ora里的GLOBAL_DBNAME

tnsnames.ora

TOS =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = soho-ivgcrcy9al)(PORT = 1521))

)

(CONNECT_DATA =

(SERVICE_NAME = tos)

)

)

listener.ora

SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(

GLOBAL_DBNAME = tos)

(ORACLE_HOME = D:oracleora92)

(SID_NAME = oracledb)

)

)

三、设置sidlistener.ora里的sid_name

tnsnames.ora

TOS =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = soho-ivgcrcy9al)(PORT = 1521))

)

(CONNECT_DATA =

(sid = oracledb)

)

)

listener.ora

SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(ORACLE_HOME = D:oracleora92)

(SID_NAME = oracledb)

)

)

其中后两种设置方式,listener.ora中的 sid_name必须和 instance_name 一致.

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/8193225/viewspace-974667/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-09-26

  • 博文量
    20
  • 访问量
    13750