ITPub博客

首页 > 数据库 > 数据库开发技术 > 使用hostname方式连接数据库!

使用hostname方式连接数据库!

原创 数据库开发技术 作者:warehouse 时间:2008-06-26 10:17:48 0 删除 编辑

hostname方式是通过client端hostname连接数据库,无需配置tns!

[@more@]

1. HOSTNAME

修改listener.ora中的如下信息
(SID_DESC =
(GLOBAL_DBNAME = your_hostname) --你的机器名
(ORACLE_HOME = E:oracleora92) --oracle home
(SID_NAME = orcl) --sid name
)
然后在客户端的sqlnet.ora中,确保有
NAMES.DIRECTORY_PATH= (HOSTNAME)

无需在client端配置tns

测试一下:

C:>sqlplus xys/manager@xys

SQL*Plus: Release 10.2.0.1.0 - Production on 星期四 6月 26 09:56:03 2008

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

我的主机名是xys

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

上一篇: SYS_CONTEXT小记!
请登录后发表评论 登录
全部评论

注册时间:2007-12-07

  • 博文量
    717
  • 访问量
    5366307