终于解决了----ORA-12514 TNS 监听程序当前无法识别连接描述符中请求服务

特别是链接linux上的Oracle容易遇到此问题,解决方式:
找到Oracle服务器上的“u01/app/oracle/product/11.2.0/db_1/network/admin”(此处是中linux系统的安装路径)中的tnsnames.ora文件,打开文件找到类似于以下的这句话

ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oa.adellock.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl.adellock.com)
)
)


将这句话复制出来,贴到自己本机电脑装的Oracle的路径中的tnsnames.ora文件中,例如本机是“D:\OracleClient\app\Administrator\product\11.2.0\client_1\network\admin”。

放进去了,那该测试一下了,自己电脑开始-->cmd--->netca,输入命令后,自动弹出

[img]http://dl2.iteye.com/upload/attachment/0095/7249/c84f4a3f-dc03-3919-99e3-afd06e2e5509.jpg[/img]

[img]http://dl2.iteye.com/upload/attachment/0095/7243/576874df-87cc-3610-a885-54f3df53cceb.jpg[/img]


[img]http://dl2.iteye.com/upload/attachment/0095/7245/dc62dae2-12e3-33a6-bd96-709e4f9efd67.jpg[/img]


[img]http://dl2.iteye.com/upload/attachment/0095/7251/1f9e8fd2-4e96-35a7-b3d8-0c5354912d4d.jpg[/img]


[img]http://dl2.iteye.com/upload/attachment/0095/7253/80082daa-e256-3149-9603-4e6d8e095747.jpg[/img]


[img]http://dl2.iteye.com/upload/attachment/0095/7255/bf76668c-8de8-3faf-b2e5-b872cb26cc84.jpg[/img]

如果还是连接不上,那改一下HOST,改为数据库服务器的地址,例如192.168.1.4,
将刚刚加到tnsnames.ora的那句话改成下面这个,注意数据服务器上的tnsnames.ora不用改

ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.4)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl.adellock.com)
)
)

你可能感兴趣的:(oracle)