ORA-12560: TNS: 协议适配器错误
我通过 Google[d] 查找此错误ORA-12560:TNS:协议适配器错误
谁能告诉我一个完美的解决方案来解决登录问题。
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(20)
转到“开始”->“运行-> Windows 中的 Services.msc。
找到OracleService SID >(此处为
OracleServiceORCL
),然后单击Start
启动 Oracle 数据库服务(如果尚未运行)启动并运行后,从命令提示符运行以下命令:
(tnsalias 条目您可以在
tnsnames.ora
文件中找到它)Go to Start -> Run -> Services.msc in Windows.
Locate OracleService < SID > (here
OracleServiceORCL
) and click onStart
to start the oracle database service (if not already running)Once it is up and running, from the command prompt run the following:
(tnsalias entry you can find it in
tnsnames.ora
file)就我而言,我在 Windows
Services.msc
中没有OracleService
(OracleServiceORCL),如 Bharathi 的回答。我执行了这个命令:
然后名为 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 WindowsServices.msc
as described in Bharathi's answer.I executed this command:
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
好像数据库没有起来。这可能是由于重新启动计算机而导致实例未设置为自动启动,因此从服务屏幕启动后未手动启动。
只需转到命令提示符
设置 Oracle SID
C:>set oracle_sid=ORCL
现在运行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
Set Oracle SID
C:>set oracle_sid=ORCL
Now run Net start command.
C:>net start oracleserviceORCL
从命令控制台,如果您收到此错误,您可以通过键入来避免它,
然后您可以连接
from command console, if you get this error you can avoid it by typing
then you can connect
将以下变量和值添加到环境变量中,以标识 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
就我而言(对于 OracleExpress),服务正在运行,但是当我尝试通过 sqlplus 访问没有连接标识符的数据库时遇到了这个问题:
为了使其工作,我需要添加连接标识符(对于 Oracle Express 是 XE),因此以下命令工作正常:
如果仍然收到 ORA-12560,请确保可以 ping XE 服务。使用:
您应该收到 OK 消息以及完整的连接字符串(tnsping 命令位于 oracle 的安装目录中:[oracle express 安装目录]\app\oracle\product\11.2.0\server\bin)。如果无法 ping 通,请确保 sqlplus 可以访问您的
tnsnames.ora
文件。您可能需要设置 TNS_ADMIN 环境变量,使其指向文件所在的 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:
To make it work I needed to add the connection identifier (XE for Oracle Express), so following command worked ok:
If you still get ORA-12560, make sure you can ping the XE service. Use:
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:经过一番搜索,找到了一个简单的方法来解决它。
只需按照步骤操作即可。
lsnrctl status
现在打开以下目录中的
listener.ora
文件:C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN
您可以通过右键单击
我的电脑
并检查您的计算机名称来获取您的计算机名称,并将主机参数替换为您的计算机名称,如下所示:监听器 =
(描述列表=
(描述=
(地址 =(协议 = IPC)(密钥 = EXTPROC1))
(地址 =(协议 = TCP)(主机 = Electron-PC)(端口 = 1521)
)
)
)
所以在这里你可以观察到
HOST = Electron-PC
,这是我的计算机名称。保存listener.ora文件并再次返回cammand propt
3.在命令提示符中键入以下内容
lsnrctl start
这将启动
OracleTNSListner
。您可以通过打开任务管理器的服务选项卡在服务中检查它。如果没有自动启动,您可以启动它。
就这么多,您就可以再次在 Oracle 上工作了。
祝你好运。
After searching alot got a simple way to solve it.
Just follow the steps.
lsnrctl status
Now open
listener.ora
file which is present in following directory:C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN
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.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.
通常这意味着侦听器尚未启动。检查服务面板。
在 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.)
我已经用简单的方法解决了这个问题。我的预言机过去运行得很好。在我安装 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.
另一个可能的解决方案对我有用...考虑到我使用本地登录作为 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.
只需添加即可,按照屏幕截图操作,如果未选择,请选择本地帐户启动。然后启动服务。
Just to add up, follow the screenshot and choose local account to start if not selected. Then start the service.
如果以上方法都不起作用,请尝试以下操作:
修改
LISTENER.ora
(我的位于:oracle\product\11.2.0\dbhome_1\NETWORK\ADMIN\listener.ora
)==>添加指向您的数据库(SID)的自定义侦听器,例如我的 SID 是 XZ0301,因此:重新启动计算机
对于 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 :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
它确实在我的机器上有效。但我找到了 OracleServiceXE,而不是 OracleServiceORCL。
It really has worked on my machine. But instead of OracleServiceORCL I found OracleServiceXE.
执行以下步骤:
编辑您的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 文件
sqlplus username/passowrd@oracle_connection_alias
示例:
用户名:your_database_username
密码:您的数据库密码
oracle_connection_alias :上面示例的 SCHEMADEV。
Flow the flowing steps :
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
)
ADR_BASE_LISTENER = C: [here c is oralce home directory]
b. add in tnsnames.ora file
sqlplus username/passowrd@oracle_connection_alias
Example :
username : your_database_username
password : Your_database_password
oracle_connection_alias : SCHEMADEV for above example.
您需要告诉 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.
ORA-12560: TNS: 协议设置错误
SQLNET.AUTHENTICATION_SERVICES = (NTS)
ORA-12560: TNS:erro de adaptador de protocolo
SQLNET.AUTHENTICATION_SERVICES = (NTS)
我尝试 2 个选项:
注:orcle12c->您笔记本电脑中运行的 OracleService 名称的名称
I try 2 option:
Note: orcle12c -> name of OracleService name run in you laptop
可以应用以下修复来解决
TNS 12560
错误SQL*NET
客户端软件的最新补丁$ORACLE_HOME
和$PATH< /code> 变量(系统用户应该可以访问)
$TNS_ADMIN
变量如果出现网络跟踪错误,请检查以下链接:
http://dba-oracle.com/t_sql_net_tracing.htm< /a>
Below fixes can be applied to resolve
TNS 12560
errorSQL*NET
client software$ORACLE_HOME
and$PATH
variable (should be accessible for System user)$TNS_ADMIN
variableCheck below link in case of net tracing error:
http://dba-oracle.com/t_sql_net_tracing.htm
由于某种原因,我的笔记本电脑上同时存在 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.
就我而言,(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.