简体   繁体   English

突然收到ORA-12514错误Oracle 11gr2

[英]Suddenly getting ORA-12514 error Oracle 11gr2

I installed Oracle 11g r2 fine, had 2 databases (se3 and mydb, both have db_domain .orcl ie mydb.orcl and se3.orcl) running on it fine till yesterday. 我安装了Oracle 11g r2很好,有2个数据库(se3和mydb,都具有db_domain .orcl,即mydb.orcl和se3.orcl)可以在其上运行直到昨天。 but suddenly im getting ORA-12514 error (TNS:listener doesn't know of service requested in connect descriptor).. 但是突然我收到ORA-12514错误(TNS:listener不知道连接描述符中请求的服务)。

My tnsnames.ora file: 我的tnsnames.ora文件:

# tnsnames.ora Network Configuration File: G:\oracledb\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

LISTENER_MYDB =
  (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))


ORACLR_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (CONNECT_DATA =
      (SID = CLRExtProc)
      (PRESENTATION = RO)
    )
  )

MYDB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = mydb.orcl)
    )
  )

SE3 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = se3.orcl)
    )
  )

LISTENER_SE3 =
  (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))

LISTENER.ORA FILE:
# listener.ora Network Configuration File: G:\oracledb\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = G:\oracledb\product\11.2.0\dbhome_1)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:G:\oracledb\product\11.2.0\dbhome_1\bin\oraclr11.dll")
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
  )

ADR_BASE_LISTENER = G:\oracledb

I am able to "tnsping mydb/se3" fine.. Tried to change tnsnames.ora and listener.ora files too (now restored) but cannot connect to either one of them through sqlplus or sqldeveloper/visual studio.. plz help me.. thanks! 我能够“ tnsping mydb / se3”很好。试图也更改tnsnames.ora和listener.ora文件(现在已还原),但无法通过sqlplus或sqldeveloper / visual studio连接到其中任何一个。.plz帮助我。 。 谢谢!

Based on your own comment "im able to set ORACLE_SID but cannot connect via sqlplus ... ORA-01034 - Oracle not available" it's likely that your database instances are down. 根据您自己的注释“可以设置ORACLE_SID但不能通过sqlplus连接... ORA-01034-Oracle不可用”,您的数据库实例很可能已关闭。 It is theoretically possible to have the underlying Windows service OracleServiceMYDB running and corresponding oracle.exe in processes, but the database instance being down. 从理论上讲,可以在进程中运行基础Windows服务OracleServiceMYDB并运行相应的oracle.exe,但是数据库实例已关闭。 Your best bet is to look on the server for the trace directory containing alert_mydb.log and review the last entries. 最好的选择是在服务器上查找包含alert_mydb.log的跟踪目录,并查看最后一个条目。

If the database is simply not running and alert log shows no serious errors, start it like this: 如果数据库根本没有运行,并且警报日志没有显示严重错误,请按以下方式启动它:

set ORACLE_SID=MYDB
set ORACLE_HOME=D:\my\oracle\home

%ORACLE_HOME%\bin\sqlplus "/ as sysdba"
ORACLE not available.
SQL> STARTUP 
SQL> EXIT

lsnrctl services

The last command should show MYDB is registered. 最后一条命令应显示MYDB已注册。 Proceed with ORACLE_SID=SE3 继续使用ORACLE_SID = SE3

In my case, I received the ORA-12514 error when attempting to connect via SQL*Plus from a client-only machine to a remote database: 就我而言,当尝试通过SQL * Plus仅客户端的计算机连接到远程数据库时,我收到ORA-12514错误:

C:\Temp>sqlplus username@connect_descriptor

SQL*Plus: Release 11.2.0.3.0 Production on Wed Sep 24 09:43:04 2014

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Enter password:
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor

I found this puzzling because tnsping responded successfully: 我感到困惑,因为tnsping成功响应了:

C:\Temp>tnsping connect_descriptor

TNS Ping Utility for 32-bit Windows: Version 11.2.0.3.0 - Production on 24-SEP-2
014 09:48:04

Copyright (c) 1997, 2011, Oracle.  All rights reserved.

Used parameter files:
D:\Oracle\product\11.2.0\client_1\network\admin\sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = host
.intranet.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME =
HOST13)))
OK (20 msec)

Ultimately, I tracked down my problem as an incorrect SERVICE_NAME value in my tnsnames.ora file: 最终,我在tnsnames.ora文件中找到了一个错误的SERVICE_NAME值来查找问题:

CONNECT_DESCRIPTOR =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = host.intranet.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = HOST13)
    )
  )

After changing HOST13 (via an ordinary text editor) to the correct value for SERVICE_NAME , I was able to connect to the remote Oracle database. HOST13 (通过普通的文本编辑器)更改为SERVICE_NAME的正确值之后,我能够连接到远程Oracle数据库。

On my Oracle 11.2 client machine, here is the location of tnsnames.ora : 在我的Oracle 11.2客户端计算机上,这是tnsnames.ora的位置:

C:\Oracle\product\11.2.0\client_1\network\admin\tnsnames.ora

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Windows 8 中安装 Oracle 11gR2 - Oracle 11gR2 installation in Windows 8 Oracle DB - 从 19c 客户端连接 11gR2 DB - ORA-12650:没有通用加密或数据完整性算法 - Oracle DB - Connecting 11gR2 DB from 19c Client - ORA-12650 : No Common Encryption or data integrity algorithm 如何在Oracle 11gr2中安装过程选项 - How to install Procedural Option in Oracle 11gr2 Oracle 11gR2加载多个文件:sqlldr还是外部表? - Oracle 11gR2 loading multiple files: sqlldr or external tables? Oracle 11GR2 TKPROF - 如何捕获递归调用树 - Oracle 11GR2 TKPROF - How to capture the recursive call-tree 无法加载文件或程序集'Oracle.DataAccess'11gR2 VS 2008 - Could not load file or assembly 'Oracle.DataAccess' 11gR2 VS 2008 除了创建会话之外,无法在oracle 11gR2中为用户授予任何权限 - Unable to grant any privileges to user in oracle 11gR2 except create session 启动计算机时,如何在ubuntu 16.04上禁用Oracle 11gR2的自动启动? - how to disable autostart of Oracle 11gR2 on ubuntu 16.04 when i start my computer? 重新安装Oracle Enterprise 11gR2后,从.dbf文件重新创建Oracle Databse。 - Recreate Oracle Databse from .dbf files after re-installation of Oracle Enterprise 11gR2 如何使用Java或REST API监视Oracle 11gr2性能指标 - How to monitor oracle 11gr2 performace metrics using java or REST API
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM