java Io 异常:Oracle 云中的 Oracle 错误 ORA-12650
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/46919402/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Io exception: Oracle Error ORA-12650 in Oracle Cloud
提问by Wanna Coffee
I have been using Oracle cloud PAAS linux server for my DB machine (Oracle 11g) and having linux application server where i can run all my Java applications.
我一直在为我的 DB 机器(Oracle 11g)使用 Oracle 云 PAAS linux 服务器,并拥有 linux 应用程序服务器,我可以在其中运行我所有的 Java 应用程序。
Assume i have spring based web application which can connect cloud DB machine. I have tried to access the schema in Toad for oracle, it is working as expected but when i try to hit the DB for retrieving the data from application it gives below error.
假设我有可以连接云数据库机器的基于 spring 的 Web 应用程序。我曾尝试访问 Toad 中的模式 for oracle,它按预期工作,但是当我尝试访问数据库以从应用程序检索数据时,它给出以下错误。
java.sql.SQLException: Io exception: Oracle Error ORA-12650
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:420)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:154)
at GetConnection.main(GetConnection.java:35)
I have also tried to extend the service access from SID to service name in DB machine. Still give same error. Same code works fine in another cloud machine, which was set by us. But this cloud machine was done by oracle team and most of the things are by default.
我还尝试将服务访问从 SID 扩展到 DB 机器中的服务名称。仍然给出同样的错误。相同的代码在我们设置的另一台云机器上运行良好。但是这个云机是oracle团队做的,大部分都是默认的。
Please share your suggestion to fix this issue.
请分享您的建议以解决此问题。
采纳答案by Wanna Coffee
This issue is because of Oracle DB machine encryption ENCRYPTION_SERVERsettings. As i understood which is default and set it to enabled, when we set it to disabledor comment the line then application will work as expected. Below is the file name for reference,
这个问题是因为 Oracle DB 机器加密ENCRYPTION_SERVER设置。据我所知,这是默认设置并将其设置为启用,当我们将其设置为禁用或注释该行时,应用程序将按预期工作。以下是供参考的文件名,
Filename : sqlnet.ora (We have to disable ENCRYPTION_SERVER settings)
File Location : ../oracle/product/11.2.0/dbhome_1/network/admin
Hope this helps some one.!
希望这对某人有所帮助。!
回答by Pavlos Klonis
It did not help me at all. Actually I followed your solution and I ended up having another error more critical and serious than the one trying to solve. Let me explain. First of all the value "disabled" that you mentioned is not even an accepted value for this parameter. According to Oracle (Oracle Docs) these are the accepted values that anyone can use:
它根本没有帮助我。实际上,我遵循了您的解决方案,结果我遇到了另一个比试图解决的错误更严重和更严重的错误。让我解释。首先,您提到的“禁用”值甚至不是此参数的可接受值。根据 Oracle ( Oracle Docs),这些是任何人都可以使用的公认值:
SQLNET.ENCRYPTION_SERVER Purpose
SQLNET.ENCRYPTION_SERVER 目的
To turn encryption on for the database server.
为数据库服务器打开加密。
Default
默认
accepted
公认
Values
价值观
accepted
: to enable the security service if required or requested by the other side.rejected
: to disable the security service, even if the required by the other side.requested
: to enable the security service if the other side allows it.required
: to enable the security service and disallow the connection if the other side is not enabled for the security service.
accepted
:在对方要求或要求时启用安全服务。rejected
: 禁用安全服务,即使对方要求。requested
: 在对方允许的情况下启用安全服务。required
: 开启安全服务,如果对方没有开启安全服务,则禁止连接。
Example
例子
SQLNET.ENCRYPTION_SERVER=accepted
In my case being a 12c Oracle Cloud database the default was set to "required" giving me the error "Io exception: Oracle Error ORA-12650" when trying to start my application. Setting the parameter to "accepted" solved the issue and managed to start my application. In case you still get the error you can also set the following parameter to accepted: SQLNET.CRYPTO_CHECKSUM_SERVER = accepted if you see that in your sqlnet.ora the value is set to "required".
在我的情况下是 12c Oracle Cloud 数据库,默认设置为“必需”,在尝试启动我的应用程序时给我错误“Io 异常:Oracle 错误 ORA-12650”。将参数设置为“已接受”解决了问题并成功启动了我的应用程序。如果您仍然遇到错误,您还可以将以下参数设置为已接受: SQLNET.CRYPTO_CHECKSUM_SERVER = 接受,如果您在 sqlnet.ora 中看到该值设置为“必需”。
Please have in mind that my application as well as my OCI setup are for testing purposes only and they are not intended to be used in production environment. Setting the value of SQLNET.ENCRYPTION_SERVER
and SQLNET.CRYPTO_CHECKSUM_SERVER
to "accepted" will significantly lower your Database's security making it vulnerable to any attacks from any application that has access to it. The best case scenario is to modify your application to use the ENCRYPTION as "required".
请记住,我的应用程序以及我的 OCI 设置仅用于测试目的,并不打算在生产环境中使用。设置的值SQLNET.ENCRYPTION_SERVER
,并SQLNET.CRYPTO_CHECKSUM_SERVER
为“公认的”会显著降低你的数据库的安全性使得它容易从访问任何应用程序的任何攻击。最好的情况是修改您的应用程序以将 ENCRYPTION 用作“必需”。