刚在WIN10安装了ORACLE 11G R2的客户端,然后想直接去配置TNS用PLSQL登录公司的数据库,碰到了问题。

puzzzle 2016-02-14 10:08:29
描述下我碰到的问题,请教下各位大神:我在文件选择TNSNAMES的时候发现刚安装的这个文件格式跟一般的不同具体格式最后贴上,然后我想把公司的TNS贴上发现一直是另存为格式,强行保存报错:拒绝访问。然后我看了电脑的服务里面也没有oracle的相关服务。

以下是我刚安装完TNSNAMES.ORA里面的内容:
请教下应该怎么修改才能让我的PLSQL登录上公司的数据库,万分感谢!

# This file contains the syntax information for
# the entries to be put in any tnsnames.ora file
# The entries in this file are need based.
# There are no defaults for entries in this file
# that Sqlnet/Net3 use that need to be overridden
#
# Typically you could have two tnsnames.ora files
# in the system, one that is set for the entire system
# and is called the system tnsnames.ora file, and a
# second file that is used by each user locally so that
# he can override the definitions dictated by the system
# tnsnames.ora file.

# The entries in tnsnames.ora are an alternative to using
# the names server with the onames adapter.
# They are a collection of aliases for the addresses that
# the listener(s) is(are) listening for a database or
# several databases.

# The following is the general syntax for any entry in
# a tnsnames.ora file. There could be several such entries
# tailored to the user's needs.

<alias>= [ (DESCRIPTION_LIST = # Optional depending on whether u have
# one or more descriptions
# If there is just one description, unnecessary ]
(DESCRIPTION=
[ (SDU=2048) ] # Optional, defaults to 2048
# Can take values between 512 and 32K
[ (ADDRESS_LIST= # Optional depending on whether u have
# one or more addresses
# If there is just one address, unnecessary ]
(ADDRESS=
[ (COMMUNITY=<community_name>) ]
(PROTOCOL=tcp)
(HOST=<hostname>)
(PORT=<portnumber (1521 is a standard port used)>)
)
[ (ADDRESS=
(PROTOCOL=ipc)
(KEY=<ipckey (PNPKEY is a standard key used)>)
)
]
[ (ADDRESS=
[ (COMMUNITY=<community_name>) ]
(PROTOCOL=decnet)
(NODE=<nodename>)
(OBJECT=<objectname>)
)
]
... # More addresses
[ ) ] # Optional depending on whether ADDRESS_LIST is used or not
[ (CONNECT_DATA=
(SID=<oracle_sid>)
[ (GLOBAL_NAME=<global_database_name>) ]
)
]
[ (SOURCE_ROUTE=yes) ]
)
(DESCRIPTION=
[ (SDU=2048) ] # Optional, defaults to 2048
# Can take values between 512 and 32K
[ (ADDRESS_LIST= ] # Optional depending on whether u have more
# than one address or not
# If there is just one address, unnecessary
(ADDRESS
[ (COMMUNITY=<community_name>) ]
(PROTOCOL=tcp)
(HOST=<hostname>)
(PORT=<portnumber (1521 is a standard port used)>)
)
[ (ADDRESS=
(PROTOCOL=ipc)
(KEY=<ipckey (PNPKEY is a standard key used)>)
)
]
... # More addresses
[ ) ] # Optional depending on whether ADDRESS_LIST
# is being used
[ (CONNECT_DATA=
(SID=<oracle_sid>)
[ (GLOBAL_NAME=<global_database_name>) ]
)
]
[ (SOURCE_ROUTE=yes) ]
)
[ (CONNECT_DATA=
(SID=<oracle_sid>)
[ (GLOBAL_NAME=<global_database_name>) ]
)
]
... # More descriptions
[ ) ] # Optional depending on whether DESCRIPTION_LIST is used or not
...全文
651 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
huangdh12 2016-03-10
  • 打赏
  • 举报
回复
这个文件 把内容清空,然后从其他地方拷贝内容过来都行。
lhdz_bj 2016-02-14
  • 打赏
  • 举报
回复
1、客户端没有服务。 2、确定客户端安装目录,且设置环境变量$ORACLE_HOME为该目录。 3、在$ORACLE_HOME\NETWORK\ADMIN\tnsnames.ora添加: 连接串名字 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = IP地址)(PORT = 端口)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = 实例名) ) ) 用实际内容替换以上汉字部分。
puzzzle 2016-02-14
  • 打赏
  • 举报
回复
我记得原来安装 就上面两行字,然后底下是一个本地的数据库连接的字段,我们修改其中一些参数就可以用PLSQL找到并且连接到其他的数据库上面了。。不知道这是什么情况这个TNS会是这种情况

17,377

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧