热门标签 | HotTags
当前位置:  开发笔记 > 数据库 > 正文

Oracledatabase11gR2client的sqlplus无法成功连接数据库

Oracledatabase11gR2client的sqlplus无法成功连接数据库,1、数据库版本:OracleDatabase11gEnterpriseEditionRelease

Oracle database 11g R2 client的sqlplus无法成功连接数据库,1、数据库版本: Oracle Database 11g Enterprise Edition Release

问题环境:
1、数据库版本: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
2、操作系统环境:Windows 7 旗舰版 64位
3、本地安装有4个Oracle 数据库软件【四个数据库软件,不是四个数据库哦】如下:
Oracle 10.2服务端软件:e:\oracle\product\10.2.0\db_1\BIN\sqlplus.exe
Oracle 11.2服务端软件:e:\oracle\product\11.2.0\db_1\BIN\sqlplus.exe
Oracle 10.2客户端软件:e:\oracle\product\11.2.0\client_1\BIN\sqlplus.exe
Oracle 11.2客户端软件:e:\oracle\product\10.2.0\client_1\BIN\sqlplus.exe

问题描述:

1、本地启动Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 ,服务名sun,服务状态如下:
C:\Windows\system32>sc query oracleservicesun
SERVICE_NAME:oracleservicesun
TYPE : 10 WIN32_OWN_PROCESS
STATE : 4 RUNNING
(STOPPABLE, PAUSABLE, ACCEPTS_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0


2、使用Oracle 10.2服务端软件可以正常连接数据库,如下:C:\Windows\system32>set ORACLE_SID=sun
C:\Windows\system32>e:\oracle\product\10.2.0\db_1\BIN\sqlplus.exe / as sysdba
SQL*Plus: Release 10.2.0.4.0- Production on 星期一 5月 14 17:06:32 2012
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.

连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

sys@SUN>

3、使用Oracle 11.2服务端软件可以正常连接数据库,如下:C:\Windows\system32>set ORACLE_SID=sun
C:\Windows\system32>e:\oracle\product\11.2.0\db_1\BIN\sqlplus.exe / as sysdba
SQL*Plus: Release 11.2.0.1.0Production on 星期一 5月 14 17:07:23 2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.

连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

sys@SUN>


4、使用Oracle 10.2客户端软件可以正常连接数据库,如下:
C:\Windows\system32>set ORACLE_SID=sun
C:\Windows\system32>E:\oracle\product\10.2.0\client_1\BIN\sqlplus.exe / as sysdba
SQL*Plus: Release 10.2.0.4.0- Production on 星期一 5月 14 17:11:27 2012
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.

连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

sys@SUN>


5、使用Oracle 11.2客户端软件无法连接数据库,如下
C:\Windows\system32>set ORACLE_SID=sun
C:\Windows\system32>e:\oracle\product\11.2.0\client_1\BIN\sqlplus.exe / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on 星期一 5月 14 17:13:08 2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.


ERROR:
ORA-12560: TNS: 协议适配器错误

请输入用户名:

补充信息:
Oracle 11.2客户端sqlnet.ora文件如下:
# sqlnet.ora Network Configuration File: e:\oracle\product\11.2.0\client_1\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.

# This file is actually generated by netca. But if customers choose to
# install "Software Only", this file wont exist and without the native
# authentication, they will not be able to connect to the database on NT.

SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
请各位湿湿们不吝赐教,,折腾了很久也没搞明白原因,纠结中。。

linux

推荐阅读
author-avatar
涵涵
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有