oracle ora-12514解决办法

时间:2022-09-16 18:10:31

原来配置好的数据库监听用plsql登陆报错ORA-12514 TNS 监听程序当前无法识别连接描述符中请求服务

网上说的改listener.ora 添加如下配置

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = ORCL)
      (ORACLE_HOME = D:\oracle_base\oracle11g\product\11.2.0\dbhome_1)
      (PROGRAM = ORCL)
    )
   (SID_DESC =
       (GLOBAL_DBNAME = MONT)
       (ORACLE_HOME = D:\oracle_base\oracle11g\product\11.2.0\dbhome_1)  
       (SID_NAME = MONT)
      )
  )

改了以后并不起作用

错误原因在tnsnames.ora里面

修改前

MONT =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.169.6.64)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = MONT)
    )
  )
SERVICE_NAME = MONT要和实际数据库SID一样
外面的可以随便,区分不同的数据库
修改后
MONT =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.169.6.64)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = ORCL)
    )
  )