免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2255 | 回复: 1
打印 上一主题 下一主题

RH AS 4 U2 oracle 9024环境HOSTNAME连接数据库,不成功,求助 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-03-22 13:57 |只看该作者 |倒序浏览
参考文章http://www.xrss.cn/Dev/DataBase/200753013678.Html
OS:rh as4 u2   DATABASE : ORACLE 9204

两种方法均不行,以下是后一种方法:
[root@ora1 admin]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
192.168.1.196   ora1
127.0.0.1       ora1    localhost.localdomain   localhost
[root@ora1 admin]# cat sqlnet.ora
# SQLNET.ORA Network Configuration File: /opt/app/oracle/product/9.2/network/admin/sqlnet.ora
# Generated by Oracle configuration tools.
#SQLNET.AUTHENTICATION_SERVICES= (NONE)
NAMES.DIRECTORY_PATH= (HOSTNAME)

[root@ora1 admin]# cat listener.ora
# LISTENER.ORA Network Configuration File: /opt/app/oracle/product/9.2/network/admin/listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
(SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /opt/app/oracle/product/9.2)
      (PROGRAM = extproc)
    )
    (SID_DESC =
        (GLOBAL_DBNAME = ora1)
        (SID_NAME = ora9idb)
    )
)
LISTENER =
(DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = ora1)(PORT = 1521))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    )
)
[oracle@ora1 ~]$ tnsping ora1

TNS Ping Utility for Linux: Version 9.2.0.4.0 - Production on 21-MAR-2008 23:15:32

Copyright (c) 1997 Oracle Corporation.  All rights reserved.

Used parameter files:
/opt/app/oracle/product/9.2/network/admin/sqlnet.ora

Used HOSTNAME adapter to resolve the alias
Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SID=*)(SERVICE_NAME=ora1.))(ADDRESS=(PROTOCOL=TCP)(HOST=ora1)(PORT=1521)))
OK (20 msec)
[oracle@ora1 ~]$ lsnrctl status

LSNRCTL for Linux: Version 9.2.0.4.0 - Production on 21-MAR-2008 23:15:51

Copyright (c) 1991, 2002, Oracle Corporation.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ora1)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 9.2.0.4.0 - Production
Start Date                21-MAR-2008 23:06:52
Uptime                    0 days 0 hr. 8 min. 59 sec
Trace Level               off
Security                  OFF
SNMP                      OFF
Listener Parameter File   /opt/app/oracle/product/9.2/network/admin/listener.oraListener Log File         /opt/app/oracle/product/9.2/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ora1)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "ora1" has 1 instance(s).
  Instance "ora9idb", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@ora1 ~]$ sqlplus /nolog

SQL*Plus: Release 9.2.0.4.0 - Production on Fri Mar 21 23:16:27 2008

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

SQL> conn sys/sys@ora1 as sysdba;
ERROR:
ORA-12514: TNS:listener could not resolve SERVICE_NAME given in connect
descriptor


问题出在什么地方?

论坛徽章:
0
2 [报告]
发表于 2008-03-23 18:30 |只看该作者

回复 #1 clarcli 的帖子

你没有在tname里定义你想连接的字符串,是无法进行连接的.兄弟你看看你的tname.ora是怎么写的啊. 格式如下.

openend =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.100)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = oracle)
    )
  )
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP