Database 版 (精华区)
发信人: hhong (我想要飞), 信区: Database
标 题: 如何配置Oracle客户端
发信站: 紫 丁 香 (Thu Nov 25 18:27:28 1999), 转信
==> Swz@SMTH (小灵通) 提到:
> 我在NT Server和Workgroup Stations分别安装了ORACLE FOR NT & ORACLE FOR
> Windows,
> NT Server上只有SQL*Net Easy Configuration, Client有ORACLE Network Manager,
> 我如何进行配置,才能在client访问server上的数据库?
你既然在SERVER上有SQL*NET EASY CONFIGURATION, 那应当是2.X版的SQL*NET,
则客户机上也要用2.X版的. 在服务器上的最有用文件是LISTENER.ORA,
而在客户机上最重要的是TNSNAME(S).ORA文件
这两个文件2分别是服务器方接收请求和客户机方寻找服务器的参数文件.
下面是一个TNSNAMES.ORA的例子:
#This is a SQL*Net Configuration file generated by SQL*Net Easy Configuration.
#Attention: Do not modify this file yourself.
#If you do, your SQL*Net Easy Configuration may not function properly.
#这是使用TCP/IP通信的例子:
Example1.world = ]
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = tcp.world)
(PROTOCOL = TCP)
(Host = Production1)
#在上一行中把你的服务器名字或IP地址替换Production1
(Port = 1521)
)
)
(CONNECT_DATA = (SID = SID1)
#在上一行中用你的ORACLE SERVER的实例名字(缺省应该是ORCL)代替SID1
)
)
#这是使用SPX协议的例子
Example2.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = spx.world)
(PROTOCOL = SPX)
(Service = Server_lsnr)
)
)
(CONNECT_DATA = (SID = ORCL)
)
)
Example3.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = nmp.world)
(PROTOCOL = NMP)
(Server = FinanceServer1)
(Pipe = ORAPIPE)
)
)
(CONNECT_DATA = (SID = ORCL)
)
)
Tcp-loopback.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = tcp.world)
(PROTOCOL = TCP)
(Host = 127.0.0.1)
(Port = 1521)
)
)
(CONNECT_DATA = (SID = ORCL)
)
)
#这是我们的服务器参数
caiyi.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = tcp.world)
(PROTOCOL = TCP)
(Host = 162.105.173.160)
(Port = 1521)
)
(ADDRESS =
(COMMUNITY = tcp.world)
(PROTOCOL = TCP)
(Host = 162.105.173.160)
(Port = 1526)
)
)
(CONNECT_DATA = (SID = ORCL)
)
)
下面是SERVER方的LISTENER.ORA的例子:
################
# Filename......: listener.ora
# Node..........: local.world
# Date..........: 24-MAY-94 13:23:20
################
LISTENER =
(ADDRESS =
(COMMUNITY = tcp.world)
(PROTOCOL = TCP)
(Host = 162.105.173.160)
(Port = 1521)
)
STARTUP_WAIT_TIME_LISTENER = 0
#上面一行是收听器响应第一个监听控制命令前的睡眠时间, 缺省为0秒
CONNECT_TIMEOUT_LISTENER = 10
#上面一行是收听器为得到一个有效的SQL*NET V2连接设置请求等待的时间(秒), 缺省值
#为10, 如果设为0, 则将永久等待
TRACE_LEVEL_LISTENER = ADMIN
SID_LIST_LISTENER =
(SID_DESC =
(SID_NAME = ORCL)
)
PASSWORDS_LISTENER = (oracle)
#启动或关闭LISTENER所需要的密码
上述两个文件都在%ORACLE_HOME%/NETWORK/ADMIN/下.
--
※ 来源:.紫 丁 香 bbs.hit.edu.cn.[FROM: mlg.hit.edu.cn]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:5.228毫秒