金沙国际平台登录-金沙国际会员登录

热门关键词: 金沙国际平台登录,金沙国际会员登录

但是在连接虚拟机中的orcl服务却连不通,为了能

谈到ora-12154问题,网上有一大堆解决方法,原因基本统一:tns或listener配置不正确。对于listener配置不正确的一般较少发生,大多数人都是按照默认配置一路“下一步”过来的,基本都是orcl的服务名,如果说本地可以连通orcl,别的机子就连不通那应该跟listener关系不大。大部分都是tns配置不正确。我遇到的现象是:在本机建了一个2003的虚拟机,虚拟机里面装了oracle10g,默认配置。本机只装了oracle10g的客户端,当我以前用本机连接局域网内数据库的orcl服务时没有问题,但是在连接虚拟机中的orcl服务却连不通,总是报ora-12154错误。而虚拟机内,plsql却可以连接虚拟机oracle,但是不能连接本机所在局域网内的oracle。

配置好rac后,两个节点用tnsping都可以ping通,但用sqlplus连接都出现以下错误,不知道哪里出了问题[oracle@rac2 admin]$ lsnrctl statusLSNRCTL for Linux: Version 9.2.0.4.0 - Production on 04-MAR-2008 08:32:26Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rac2)(PORT=1521)))STATUS of the LISTENER------------------------Alias LISTENERVersion TNSLSNR for Linux: Version 9.2.0.4.0 - ProductionStart Date 04-MAR-2008 08:29:03Uptime 0 days 0 hr. 3 min. 22 secTrace Level offSecurity OFFSNMP OFFListener Parameter File /home/oracle/9.2.0.4/network/admin/listener.oraListener Log File /home/oracle/9.2.0.4/network/log/listener.logListening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac2)(PORT=1521)))Services Summary...Service "PLSExtProc" has 1 instance(s). Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...Service "esal" has 2 instance(s). Instance "rac1", status READY, has 1 handler(s) for this service... Instance "rac2", status READY, has 1 handler(s) for this service...The command completed successfully[oracle@rac2 admin]$ lsnrctl serviceLSNRCTL for Linux: Version 9.2.0.4.0 - Production on 04-MAR-2008 08:32:32Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rac2)(PORT=1521)))Services Summary...Service "PLSExtProc" has 1 instance(s). Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:0 refused:0 LOCAL SERVERService "esal" has 2 instance(s). Instance "rac1", status READY, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:0 refused:0 state:ready REMOTE SERVER (address=(protocol=tcp)(host=rac1)(port=1521)) Instance "rac2", status READY, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:0 refused:0 state:ready LOCAL SERVERThe command completed successfully[oracle@rac2 admin]$ sqlplus cy/zh@esalSQL*Plus: Release 9.2.0.4.0 - Production on Tue Mar 4 08:32:45 2008Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.ERROR:ORA-12154: TNS:could not resolve service name

本篇博文前面是一些基础知识介绍,后面才是总结篇。

按照如下过程,一般都能解决:

Enter user-name: ERROR:ORA-01017: invalid username/password; logon denied

一、在solaris上面装oracle 10g教程

在虚拟机内开cmd,用lsnrctl status查看监听器监听的服务 如看到监听服务“orcl”,那在本机的tns配置中(SERVICE_NAME = orcl)必须写orcl;如果想要自定义,则在虚拟机内的listener配置中就要加入自定义服务名,记得要重启监听服务:lsnrctl reload 最后形成的配置文件如下

Enter user-name: cy/zh@rac1ERROR:ORA-12154: TNS:could not resolve service name

目前官网已经没有32位的oracle11g了,取而代之的都是64位的oracle11g,为了能在32位的solaris系统上安装oracle,目前只能安装oracle 10g。

虚拟机listener:

SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus[oracle@rac2 admin]$ sqlplus cy/zh@rac2SQL*Plus: Release 9.2.0.4.0 - Production on Tue Mar 4 08:32:59 2008Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.ERROR:ORA-12154: TNS:could not resolve service name

1)为solaris添加硬盘

SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = test) 自定义服务名 (ORACLE_HOME = E:oracleproduct10.2.0db_1) db_home (SID_NAME = test) ) (SID_DESC = (PROGRAM = extproc) (SID_NAME = PLSExtProc) (ORACLE_HOME = E:oracleproduct10.2.0db_1) ##这个服务保证你可以使用外部过程,如C程序 ) )

Enter user-name:

2)安装oracle10g

本机tns:

按照如下过程,一般都能解决:在虚拟机内开cmd,用lsnrctl status查看监听器监听的服务 如看到监听服务“orcl”,那在本机的tns配置中(SERVICE_NAME = orcl)必须写orcl;如果想要自定义,则在虚拟机内的listener配置中就要加入自定义服务名,记得要重启监听服务:lsnrctl reload 最后形成的配置文件如下 虚拟机listener:

参考资料: Solaris添加新硬盘

ORCL_XNJ = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 182.12.15.232)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = test) 与自定义服务名对应 ) )
SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = test) 自定义服务名 (ORACLE_HOME = E:oracleproduct10.2.0db_1) db_home (SID_NAME = test) ) (SID_DESC = (PROGRAM = extproc) (SID_NAME = PLSExtProc) (ORACLE_HOME = E:oracleproduct10.2.0db_1) ##这个服务保证你可以使用外部过程,如C程序 ) )

本文由金沙国际平台登录发布于金沙国际平台登录,转载请注明出处:但是在连接虚拟机中的orcl服务却连不通,为了能

您可能还会对下面的文章感兴趣: