ORA-12560: TNS: 协议适配器错误

发布于 2024-11-27 09:22:34 字数 189 浏览 6 评论 0原文

在此处输入图像描述

我通过 Google[d] 查找此错误ORA-12560:TNS:协议适配器错误

谁能告诉我一个完美的解决方案来解决登录问题。

enter image description here

I Google[d] for this error ORA-12560: TNS:protocol adaptor error but not able to find the actual reason and how to solve this error ?

Can anyone tell me a perfect solution to solve login problem.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(20

梦里梦着梦中梦 2024-12-04 09:22:34
  1. 转到托管 Oracle 数据库服务器的 Windows 计算机
  2. 转到“开始”->“运行-> Windows 中的 Services.msc。
    找到OracleService SID >(此处为 OracleServiceORCL),然后单击 Start 启动 Oracle 数据库服务(如果尚未运行)
    服务

  3. 启动并运行后,从命令提示符运行以下命令:

    tnsping < tnsalias > 
    

    tnsalias 条目您可以在 tnsnames.ora 文件中找到它)

  1. Go to the windows machine that hosts the Oracle database server
  2. Go to Start -> Run -> Services.msc in Windows.
    Locate OracleService < SID > (here OracleServiceORCL) and click on Start to start the oracle database service (if not already running)
    Services

  3. Once it is up and running, from the command prompt run the following:

    tnsping < tnsalias > 
    

    (tnsalias entry you can find it in tnsnames.ora file)

提笔落墨 2024-12-04 09:22:34

就我而言,我在 Windows Services.msc 中没有 OracleService (OracleServiceORCL),如 Bharathi 的回答

我执行了这个命令:

C:\> ORADIM -NEW -SID ORCL

然后名为 OracleServiceORCL 的 OracleService 就出现并在 Services.msc 中启动。真的很好。


来源: https://forums.oracle.com/forums/message.jspa ?messageID=4044655#4044655

In my case I didn't have an OracleService (OracleServiceORCL) in Windows Services.msc as described in Bharathi's answer.

I executed this command:

C:\> ORADIM -NEW -SID ORCL

and then the OracleService called OracleServiceORCL just showed up and got started in Services.msc. Really nice.


Source: https://forums.oracle.com/forums/message.jspa?messageID=4044655#4044655

你怎么这么可爱啊 2024-12-04 09:22:34

好像数据库没有起来。这可能是由于重新启动计算机而导致实例未设置为自动启动,因此从服务屏幕启动后未手动启动。

只需转到命令提示符

  1. 设置 Oracle SID
    C:>set oracle_sid=ORCL

  2. 现在运行Net start命令。
    C:>net start oracleserviceORCL

Seems like database is not up. It might be due to restarting machine and the instance is not set to autostart and it so not started munually after starting from services Screen.

Just goto Command prompt

  1. Set Oracle SID
    C:>set oracle_sid=ORCL

  2. Now run Net start command.
    C:>net start oracleserviceORCL

缱绻入梦 2024-12-04 09:22:34

从命令控制台,如果您收到此错误,您可以通过键入来避免它,

c:\> sqlplus /nolog

然后您可以连接

SQL> conn user/pass @host:port/service

from command console, if you get this error you can avoid it by typing

c:\> sqlplus /nolog

then you can connect

SQL> conn user/pass @host:port/service
走野 2024-12-04 09:22:34

将以下变量和值添加到环境变量中,以标识 tnsnames.ora 文件的位置:

TNS_ADMIN

C:\oracle\product\10.2.0\client_1\network\admin

Add to the environment vars the following variable and value to identify the place of the tnsnames.ora file:

TNS_ADMIN

C:\oracle\product\10.2.0\client_1\network\admin

揽月 2024-12-04 09:22:34

就我而言(对于 OracleExpress),服务正在运行,但是当我尝试通过 sqlplus 访问没有连接标识符的数据库时遇到了这个问题:

sqlplus sys/mypassword as sysdba  

为了使其工作,我需要添加连接标识符(对于 Oracle Express 是 XE),因此以下命令工作正常:

sqlplus sys/mypassword@XE as sysdba

如果仍然收到 ORA-12560,请确保可以 ping XE 服务。使用:

tnsping XE

您应该收到 OK 消息以及完整的连接字符串(tnsping 命令位于 oracle 的安装目录中:[oracle express 安装目录]\app\oracle\product\11.2.0\server\bin)。如果无法 ping 通,请确保 sqlplus 可以访问您的 tnsnames.ora 文件。您可能需要设置 TNS_ADMIN 环境变量,使其指向文件所在的 ADMIN 目录,例如:

TNS_ADMIN=[oracle express installation dir]\app\oracle\product\11.2.0\server\network\ADMIN

In my case (for OracleExpress) the service was running, but I got this issue when trying to access the database via sqlplus without connection identifier:

sqlplus sys/mypassword as sysdba  

To make it work I needed to add the connection identifier (XE for Oracle Express), so following command worked ok:

sqlplus sys/mypassword@XE as sysdba

If you still get ORA-12560, make sure you can ping the XE service. Use:

tnsping XE

And you should get OK message along with full connection string (tnsping command is located in oracle's installation dir: [oracle express installation dir]\app\oracle\product\11.2.0\server\bin). If you can not ping make sure your tnsnames.ora file is reachable for sqlplus. You might need to set TNS_ADMIN environment variable pointing to your ADMIN directory, where the file is located, for example:

TNS_ADMIN=[oracle express installation dir]\app\oracle\product\11.2.0\server\network\ADMIN
眼眸里的快感 2024-12-04 09:22:34

经过一番搜索,找到了一个简单的方法来解决它。
只需按照步骤操作即可。

  1. 检查听众的状态。
    1. 打开命令提示符并输入lsnrctl status
    2. 你不会得到任何听众。
  2. 现在打开以下目录中的listener.ora文件:C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN

    1. 打开该文件并使用您的计算机名称更改主机参数
    2. 您可以通过右键单击我的电脑并检查您的计算机名称来获取您的计算机名称,并将主机参数替换为您的计算机名称,如下所示:

      监听器 =
      (描述列表=
      (描述=
      (地址 =(协议 = IPC)(密钥 = EXTPROC1))
      (地址 =(协议 = TCP)(主机 = Electron-PC)(端口 = 1521)


      所以在这里你可以观察到HOST = Electron-PC,这是我的计算机名称。

    3. 保存listener.ora文件并再次返回cammand propt

    3.在命令提示符中键入以下内容 lsnrctl start

这将启动OracleTNSListner

您可以通过打开任务管理器的服务选项卡在服务中检查它。如果没有自动启动,您可以启动它。

就这么多,您就可以再次在 Oracle 上工作了。

祝你好运。

After searching alot got a simple way to solve it.
Just follow the steps.

  1. Check status of your listener.
    1. open command prompt and type lsnrctl status
    2. You will get no listener.
  2. Now open listener.ora file which is present in following directory: C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN

    1. Open that file and change the host parameter with you computer name
    2. You can get your computer name by right click on My Computer and check you computer name, and replace host parameter with your computer name as follows:

      LISTENER =
      (DESCRIPTION_LIST =
      (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
      (ADDRESS = (PROTOCOL = TCP)(HOST = Electron-PC)(PORT = 1521)
      )
      )
      )

      So here you can observe HOST = Electron-PC, which is my computer name.

    3. Save the listener.ora file and again return to cammand propt

    3.Type the following in command prompt lsnrctl start

This will start the OracleTNSListner.

you can check it in the service by opening services tab of Task Manager. if not started automatically you can start it.

Just this much and you are ready to work again on oracle.

Best of Luck.

淤浪 2024-12-04 09:22:34

通常这意味着侦听器尚未启动。检查服务面板。

在 Windows 上(正如您一样),另一个常见原因是 ORACLE_SID 未在注册表中定义。编辑注册表或在 CMD 框中设置 ORACLE_SID。 (因为你想运行 sqlplusw.exe 我建议你编辑注册表。)

Quite often this means that the listener hasn't started. Check the Services panel.

On Windows (as you are) another common cause is that the ORACLE_SID is not defined in the registry. Either edit the registry or set the ORACLE_SID in a CMD box. (Because you want to run sqlplusw.exe I suggest you edit the registry.)

Smile简单爱 2024-12-04 09:22:34

我已经用简单的方法解决了这个问题。我的预言机过去运行得很好。在我安装 MS SQL Server 后,我注意到了这个问题。我刚刚在我的机器上卸载了 MS SQL Server,然后问题就消失了。确保之后重新启动计算机。现在我可以再次通过SQLPlus连接到Oracle数据库。我的猜测是两者之间存在一些冲突。希望这有帮助。

I have solved the problem the easy way. My oracle was running just fine in the past. After I installed MS SQL Server was when I noticed this problem. I just uninstalled MS SQL Server on my machine then the problem was gone. Make sure you restart your computer after that. Now I can connect to Oracle database through SQLPlus again. My guess is that there's some conflict between the two. Hope this helps.

℡寂寞咖啡 2024-12-04 09:22:34

另一个可能的解决方案对我有用...考虑到我使用本地登录作为 dba 权限。

按照步骤访问“服务”。右键单击实例并转到“登录”? (可能不是名称,但它是包含权限的选项卡之一)。更改设置以使用 LOCAL。

Another possible solution that just worked for me...considering I was using my local login as the dba permissions.

Follow the steps to get to Services. Right click on the instance and go to 'Log On'? (might not be the name but it's one of the tabs containing permissions). Change the settings to use LOCAL.

千仐 2024-12-04 09:22:34

只需添加即可,按照屏幕截图操作,如果未选择,请选择本地帐户启动。然后启动服务。

输入图片此处描述

Just to add up, follow the screenshot and choose local account to start if not selected. Then start the service.

enter image description here

梦与时光遇 2024-12-04 09:22:34

如果以上方法都不起作用,请尝试以下操作:
修改LISTENER.ora(我的位于:oracle\product\11.2.0\dbhome_1\NETWORK\ADMIN\listener.ora)==>添加指向您的数据库(SID)的自定义侦听器,例如我的 SID 是 XZ0301,因此:

## Base XZ03001

SID_LIST_LISTENER_XZ03001=(SID_LIST=(SID_DESC=(ORACLE_HOME =
E:\oracle\product\11.2.0\dbhome_1)(SID_NAME= XZ03001)))

LISTENER_XZ03001=(DESCRIPTION_LIST=(ADDRESS=(PROTOCOL =
TCP)(HOST=MyComputerName)(PORT= 1521)))

DIAG_ADR_ENABLED_LISTENER_XZ03001=ON

ADR_BASE_LISTENER_XZ03001=E:\oracle

重新启动计算机

对于 Windows 7,请使用以下命令修改 LISTENER.ora:
- 转到开始>所有程序>配件
- 右键单击​​“记事本”,然后单击“以管理员身份运行”。
- 文件>打开并导航到 tnsnames.ora 文件。
- 进行更改然后它应该允许您保存

If none the above work, then try this :
Modify the LISTENER.ora (mine is found in : oracle\product\11.2.0\dbhome_1\NETWORK\ADMIN\listener.ora) ==> add a custom listener that points to your database(SID), example my SID is XZ0301, so :

## Base XZ03001

SID_LIST_LISTENER_XZ03001=(SID_LIST=(SID_DESC=(ORACLE_HOME =
E:\oracle\product\11.2.0\dbhome_1)(SID_NAME= XZ03001)))

LISTENER_XZ03001=(DESCRIPTION_LIST=(ADDRESS=(PROTOCOL =
TCP)(HOST=MyComputerName)(PORT= 1521)))

DIAG_ADR_ENABLED_LISTENER_XZ03001=ON

ADR_BASE_LISTENER_XZ03001=E:\oracle

Restart your machine

For Windows 7, use the following to modify the LISTENER.ora:
- Go to Start > All Programs > Accessories
- Right click Notepad and then click Run as Administrator .
- File>open and navigate to the tnsnames.ora file.
- Make the changes then it should allow you to save

以往的大感动 2024-12-04 09:22:34

它确实在我的机器上有效。但我找到了 OracleServiceXE,而不是 OracleServiceORCL。

It really has worked on my machine. But instead of OracleServiceORCL I found OracleServiceXE.

泛泛之交 2024-12-04 09:22:34

执行以下步骤:

  1. 编辑您的listener.ora和tnsnames.ora文件
    $Oracle_home\product\11.2.0\client_1\NETWORK\ADMIN 位置

    a.添加listener.ora文件

    <前><代码>监听器 =
    (描述列表=
    (描述=
    (地址 =(协议 = IPC)(密钥 = EXTPROC1521))
    (地址 =(协议 = TCP)(主机 = 127.0.0.1)(端口 = 1521))

    )

ADR_BASE_LISTENER = C:[此处c是oralce主目录]

b。添加 tnsnames.ora 文件

    SCHEMADEV =
            (DESCRIPTION =
                     (ADDRESS_LIST =
                     (ADDRESS = (PROTOCOL = TCP)(HOST = dabase_ip)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = SCHEMADEV)
    )
  )
  1. 打开命令提示符并输入
    sqlplus username/passowrd@oracle_connection_alias

示例:
用户名:your_database_username
密码:您的数据库密码
oracle_connection_alias :上面示例的 SCHEMADEV。

Flow the flowing steps :

  1. Edit your listener.ora and tnsnames.ora file in
    $Oracle_home\product\11.2.0\client_1\NETWORK\ADMIN location

    a. add listener.ora file

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

    )

ADR_BASE_LISTENER = C: [here c is oralce home directory]

b. add in tnsnames.ora file

    SCHEMADEV =
            (DESCRIPTION =
                     (ADDRESS_LIST =
                     (ADDRESS = (PROTOCOL = TCP)(HOST = dabase_ip)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = SCHEMADEV)
    )
  )
  1. Open command prompt and type
    sqlplus username/passowrd@oracle_connection_alias

Example :
username : your_database_username
password : Your_database_password
oracle_connection_alias : SCHEMADEV for above example.

绮筵 2024-12-04 09:22:34

您需要告诉 SQLPlus 您要登录哪个数据库。主机字符串需要是连接字符串或 TNSNames.ora 文件中配置的别名。

You need to tell SQLPlus which database you want to log on to. Host String needs to be either a connection string or an alias configured in your TNSNames.ora file.

青衫儰鉨ミ守葔 2024-12-04 09:22:34

ORA-12560: TNS: 协议设置错误

  1. 环境变量:ORACLE_BASE、ORACLE_HOME、ORACLE_SID
  2. 确保您的用户是 ORACLE_GROUP_NAME (Windows) 的一部分
  3. 确保文件 ORACLE_HOME/network/admin/sqlnet.ora 是:
    SQLNET.AUTHENTICATION_SERVICES = (NTS)
  4. (Windows) 添加新的 Oracle 客户端时要小心:向 PATH 环境添加新路径。变量可能会把事情搞砸。此变量中的第一个条目有所不同:证明 ORACLE_HOME (ORACLE_HOME/bin) 中的 sqlplus 可执行文件在 PATH 环境中位于第一个。多变的。

ORA-12560: TNS:erro de adaptador de protocolo

  1. set Environment Variables: ORACLE_BASE, ORACLE_HOME, ORACLE_SID
  2. make sure your user is part of ORACLE_GROUP_NAME (Windows)
  3. make sure the file ORACLE_HOME/network/admin/sqlnet.ora is:
    SQLNET.AUTHENTICATION_SERVICES = (NTS)
  4. (Windows) Be carefull when you add a new Oracle client: adding a new path to the PATH env. variable can mess things up. The first entry in this variable makes a difference: certify that the sqlplus executable in the ORACLE_HOME (ORACLE_HOME/bin) comes first in the PATH env. variable.
厌味 2024-12-04 09:22:34

我尝试 2 个选项:

  1. 您在“服务”选项卡中更改服务 OracleService -> 使用cmd命令运行
  2. 登录:sqlplus user_name/pass_word@orcl12C
    注:orcle12c->您笔记本电脑中运行的 OracleService 名称的名称

I try 2 option:

  1. You change service OracleService in Service Tab -> Running
  2. Login with cmd command: sqlplus user_name/pass_word@orcl12C
    Note: orcle12c -> name of OracleService name run in you laptop
寂寞美少年 2024-12-04 09:22:34

可以应用以下修复来解决 TNS 12560 错误

  1. 获取 SQL*NET 客户端软件的最新补丁
  2. 设置 $ORACLE_HOME$PATH< /code> 变量(系统用户应该可以访问)
  3. 检查 PC 客户端的权限
  4. 检查 $TNS_ADMIN 变量
  5. 检查网络是否存在防火墙或防病毒问题
  6. 检查 Windows 服务是否运行 >>> Services.msc 正在运行 OracleXE 或 OracleORCL 服务
    如果出现网络跟踪错误,请检查以下链接:

http://dba-oracle.com/t_sql_net_tracing.htm< /a>

Below fixes can be applied to resolve TNS 12560 error

  1. Get Latest patch for SQL*NET client software
  2. Set $ORACLE_HOME and $PATH variable (should be accessible for System user)
  3. Check permissions on PC client
  4. Check $TNS_ADMIN variable
  5. Check if network has firewall or antivirus issues
  6. Check if windows services Run >> Services.msc has OracleXE or OracleORCL service running
    Check below link in case of net tracing error:

http://dba-oracle.com/t_sql_net_tracing.htm

冷情妓 2024-12-04 09:22:34

由于某种原因,我的笔记本电脑上同时存在 C:\Oracle\tns_admin\ 和 C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN\ 。我将 C:\Oracle 重命名为 C:\Oracle-DISABLE 以修复错误,并能够再次从命令行使用 sqlplus 来管理我的 Oracle XE 安装。

For some reason I was having both C:\Oracle\tns_admin\ and C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN\ on my laptop. I renamed C:\Oracle to C:\Oracle-DISABLE to fix the error and being able to work with sqlplus from the commandline again to manage my Oracle XE installation.

梦初启 2024-12-04 09:22:34

就我而言,(ORA-12560:TNS 协议适配器错误)数据库连接问题的问题原因,例如数据库、用户名和密码。

一旦你遇到了这个问题。首先,您必须检查连接详细信息,然后检查 oracle 服务等。

我错过了一些连接详细信息,所以只有我收到 TNS 协议适配器错误
我将更改连接详细信息,它会正常工作

In my case, (ORA-12560: TNS protocol adapter error)Issue cause of database connection issue like database, user name and password.

Once you got the issue. Initially you have to check connection details, after check the oracle service and further more.

I missed some connection details, So only i got TNS protocol adapter error,
I will changed the connection details, It would be working fine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文