用的是oracle11g,sqlplus可以正常登陆,然而 plsql 出现ORA-12514
解决办法, 打开静默安装服务端的 tnsnames.ora文件
# tnsnames.ora Network Configuration File: E:/app/product/11.1.0/db_2/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
UMS =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
发现SERVICE_NAME = orcl(安装数据库的时候默认是orcl)
打开listener.ora 修改为这样
# listener.ora Network Configuration File: E:/app/product/11.1.0/db_2/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = E:/app/product/11.1.0/db_2)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = ums)
(ORACLE_HOME = E:/app/product/11.1.0/db_2)
(SID_NAME = ums)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
)
)
将 GLOBAL_DBNAME 的值设置为 ums
关于ORACLE_HOME 的值,其实listener.ora的头文件中就有
# listener.ora Network Configuration File: E:/app/product/11.1.0/db_2/network/admin/listener.ora
它的值就是 E:/app/product/11.1.0/db_2
网上有很多这样的问题,然而写的都不详细,所以写了这个博客,希望能帮助到编程的朋友。