不安装oracle客户端的情况下,plsql连接数据

[复制链接]
查看11 | 回复8 | 2011-11-1 16:26:59 | 显示全部楼层 |阅读模式
本帖最后由 lastwinner 于 2012-1-10 01:46 编辑
1.下载 oracle client package,instant client package-basic
2.保存 instant client package
3.建立目录 C:oracle_client\instant_clinet
4.在此目录下建立sqlnet.ora,tnsnames.ora 配置sqlnet.ora,tnsnames.ora.
5.sqlnet.ora内容是:Sqlnet.Authentication_Services=(Nts) Names.Directory_Path=(Tnsnames,Ezconnect)
6.然后配紫红tnsnames.ora连接
7.设置环境变量:变量名:tns_admin 变量值:C:\oracle_client\instant_clinet
不配置否则出现:ora-12154错误
8.安装plsql
9.在plsql中工具、首选项的连接设置oracle主目录名
10.oracle 主目录名:C:\oracle_client\instant_client
oci库:C:\oracle_client\instant_client\oci.dll
-------------------------------------------------------
这是在网上搜到,但是我没有做成功,报错仍然是ora-12154也就是没有连接到tnsnames.ora
问题1plsql远程连接是是怎么找到tnsnames.ora的,如果通过环境变量我也是设置了tns_admin变量
我用的是w7系统,请问为什么不能连接成功?

回复

使用道具 举报

千问 | 2011-11-1 16:26:59 | 显示全部楼层
plsql里oci设置好了么?
oracle_home和OCI LIBRARY都设置对了么?
回复

使用道具 举报

千问 | 2011-11-1 16:26:59 | 显示全部楼层
w7是什么?win 7?
将 Sqlnet.Authentication_Services=(Nts)注释掉看看(前面加 #即可)
报错仍然是ora-12154也就是没有连接到tnsnames.ora
你这说法不对,官方文档是这么解释12154的
ORA-12154: TNS:could not resolve the connect identifier specified
Cause: A connection to a database or other service was requested using a connect
identifier, and the connect identifier specified could not be resolved into a connect
descriptor using one of the naming methods configured. For example, if the type
of connect identifier used was a net service name then the net service name could
not be found in a naming method repository, or the repository could not be located
or reached.
Action:
- If you are using local naming (TNSNAMES.ORA file):
- Make sure that "TNSNAMES" is listed as one of the values of the
NAMES.DIRECTORY_PATH parameter in the Oracle Net profile (SQLNET.ORA)
- Verify that a TNSNAMES.ORA file exists and is in the proper directory and is
accessible.
- Check that the net service name used as the connect identifier exists in the
TNSNAMES.ORA file.
- Make sure there are no syntax errors anywhere in the TNSNAMES.ORA file.
Look for unmatched parentheses or stray characters. Errors in a TNSNAMES.ORA
file may make it unusable.
9-2 Oracle Database Error Messages
- If you are using directory naming:
- Verify that "LDAP" is listed as one of the values of the NAMES.DIRETORY_
PATH parameter in the Oracle Net profile (SQLNET.ORA).
- Verify that the LDAP directory server is up and that it is accessible.
- Verify that the net service name or database name used as the connect identifier
is configured in the directory.
- Verify that the default context being used is correct by specifying a fully qualified
net service name or a full LDAP DN as the connect identifier
- If you are using easy connect naming:
- Verify that "EZCONNECT" is listed as one of the values of the
NAMES.DIRETORY_PATH parameter in the Oracle Net profile (SQLNET.ORA).
- Make sure the host, port and service name specified are correct.
- Try enclosing the connect identifier in quote marks. See the Oracle Net Services
Administrators Guide or the Oracle operating system specific guide for more
information on naming.
回复

使用道具 举报

千问 | 2011-11-1 16:26:59 | 显示全部楼层
lz用的就是一个最简化的客户端
回复

使用道具 举报

千问 | 2011-11-1 16:26:59 | 显示全部楼层
我去试试
回复

使用道具 举报

千问 | 2011-11-1 16:26:59 | 显示全部楼层
没玩过这个.
回复

使用道具 举报

千问 | 2011-11-1 16:26:59 | 显示全部楼层
听海★蓝心梦 发表于 2012-1-9 22:09
plsql里oci设置好了么?
oracle_home和OCI LIBRARY都设置对了么?

设置是正确的,是不是OCI版本不一样呢?服务器是10g,我在官网上下载的好像是11g,但是也不应该呀,11g应该兼用10g的呢
回复

使用道具 举报

千问 | 2011-11-1 16:26:59 | 显示全部楼层
我也是10g客户端连11g的库,可以连。
操作系统是win7 for 64位
回复

使用道具 举报

千问 | 2011-11-1 16:26:59 | 显示全部楼层
确实没有用过这个,感受一下
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行