使用 Oracle Express 10g 获取 ORA-12560
当我在 Oracle 10g 中使用 C# 时,我开始收到此错误。
ORA-12560
我真的需要解决它,因为我的毕业项目时间已经不多了。
I started to receive this error while I`m using C# with Oracle 10g.
ORA-12560
and I really need to solve it as I`m running out of time on my grad project.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
ORA-12560 是一个配置问题。这使得远程诊断变得困难。我之前在SO上回答过类似的问题。我的建议很笼统,应该对你也有帮助。 了解更多信息。
如果没有,您需要发布
listener.ora
、tnsnames.ora
以及您的hosts
文件的更多详细信息。编辑
嗯。
listener.ora
和tnsnames.ora
均引用HOST = SIKAS-TOSH
,但服务器不包含在hosts
中文件。编辑2
如果您的数据库位于您的 PC 上,则某些 Web 服务器上的文件无关紧要。它是
listener.ora
和tnsnames.ora
在您的 PC 上,这些版本的文件需要引用HOST = localhost
,否则您的hosts
需要包含SIKAS-TOSH
code> 作为 127.0.0.1 的别名。ORA-12560 is a configuration issue. This makes it difficult to diagnose remotely. I have answered a similar question on SO before. my advice is general enough that it should help you too. Find out more.
If it doesn't you'll need to post more details of your
listener.ora
,tnsnames.ora
and perhaps yourhosts
files.edit
Hmmmm. Both
listener.ora
andtnsnames.ora
referenceHOST = SIKAS-TOSH
but server is not included in thehosts
file.edit 2
If your database is on your PC then the files on some web-server are irrelevant. It is the
listener.ora
andtnsnames.ora
on your PC which matter. Those versions of the file need to referenceHOST = localhost
or else yourhosts
needs to includeSIKAS-TOSH
as an alias for 127.0.0.1.确保您的侦听器正在运行。如果是,请尝试重新启动它并重新注册数据库(通过 sqlplus 作为 sysdba,键入命令
alter system register;
)。另外,如果您运行本地防火墙,请确保您已允许端口 1521 用于传入流量(或者您的自定义端口,如果您已更改此端口)。在 Windows 中,侦听器是一项服务,前缀为 oracle home name + TNSListener。
在 Linux 中,设置您的 oracle 主环境并输入:
Make sure your listener is running. If it is, try restarting it and re-registering your database with it (through sqlplus as sysdba, type the command
alter system register;
). Also, make sure that if you run a local firewall you have allowed the port 1521 for incoming traffic (or your custom port if you have changed this).In Windows the listener is a service, prefixed with the oracle home name + TNSListener.
In Linux, set your oracle home environment and type:
我已经多次卸载并重新安装了oracle 10g以及ODAC112011beta,上次我没有安装
ODAC112011beta
,而是使用了Oracle.DataAccess.Client
在C:\oraclexe\app\oracle\product\10.2.0\server\BIN\Oracle.DataAccess.dll
中找到 code> 文件...然后我从START 启动了服务->所有程序->Oracle Database 10g Express Edition->以管理员身份启动数据库
...现在我可以通过C#连接到Oracle ...我希望我不再遇到问题I have unintalled and re-installed the oracle 10g many times as well as the ODAC112011beta, last time I didn`t install the
ODAC112011beta
, instead, I used theOracle.DataAccess.Client
file found in theC:\oraclexe\app\oracle\product\10.2.0\server\BIN\Oracle.DataAccess.dll
... then I started the service fromSTART->All Programs->Oracle Database 10g Express Edition->Start Database
as administrator ... now I can connect to the Oracle through C# ... I hope I face no more problems