尝试在内部连接到 Oracle,获得空闲实例?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/349886/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 01:40:19  来源:igfitidea点击:

Trying to connect internally to Oracle, getting an idle instance?

oracleinstanceidle-processing

提问by

So I have an Oracle instance, and I know it's running on this system, I've su'd to the oracle user, and I'm trying to connect using "/ as sysdba". However, when I do connect, it says the instance is idle. I know the database is up and opened, because my application's talking to it. My paths (ORACLE_HOME, etc.) might be incorrect: any idea which incorrect setting might result in this?

所以我有一个 Oracle 实例,并且我知道它正在这个系统上运行,我已经向 oracle 用户授予了权限,并且我正在尝试使用“/ as sysdba”进行连接。但是,当我连接时,它说实例空闲。我知道数据库已启动并已打开,因为我的应用程序正在与之交谈。我的路径(ORACLE_HOME 等)可能不正确:知道哪个不正确的设置可能会导致这种情况吗?

% sqlplus "/ as sysdba"

SQL*Plus: Release 10.2.0.3.0 - Production on Mon Dec 8 09:23:22 2008

Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.

Connected to an idle instance.

09:23:22 SQL> Disconnected

% ps -ef | grep smon
 oracle  6961     1   0   Nov 05 ?           1:24 ora_smon_ORA003
%

回答by Matthew Watson

make sure you have your ORACLE_HOME setup exactly the same as when the server was started, I've seen this problem with oracle 9.2.0.5.0 on solaris,

确保您的 ORACLE_HOME 设置与服务器启动时完全相同,我在 solaris 上看到 oracle 9.2.0.5.0 存在此问题,

ORACLE_HOME=/opt/oracle
ORACLE_HOME=/opt/oracle/

is two different things, and will result in issues connecting locally.

是两件不同的事情,会导致本地连接问题。

回答by Igor Zelaya

that means that the database instance is not mounted nor open. Execute the startupcommand and see if any errors appear.

这意味着数据库实例既没有安装也没有打开。执行启动命令,查看是否出现错误。

回答by Leigh Riffel

The database cannot be idle and in use by your application at the same time. It seems like the sqlplus session must be connected to a different instance than the application. Try specifying the connect identifier in the connect statement as follows:

数据库不能同时空闲和被您的应用程序使用。似乎 sqlplus 会话必须连接到与应用程序不同的实例。尝试在连接语句中指定连接标识符,如下所示:

sqlplus "/@ConnectIdentifier as sysdba"

回答by Leigh Riffel

try from the machine console

从机器控制台尝试

export ORACLE_SID=your sid here
sqlplus /nolog
startup

I know on windows there is a command to create a service to start up an instance for you, oradmin -new -sid %ORACLE_SID% -intpwd %oracle_pwd% -startmode A

我知道在 Windows 上有一个命令可以创建一个服务来为你启动一个实例,或者admin -new -sid %ORACLE_SID% -intpwd %oracle_pwd% -startmode A

回答by pchov

thanks. it indeed was that extra front slash at the end in ORACLE_HOME variable.

谢谢。这确实是 ORACLE_HOME 变量末尾的额外前斜线。

In my case, see the wierdness - I logged in to the server and tried connecting but got the above error. I knew that instance was up and DB was opened. So checked the ORACLE_HOME because I was sort of aware about this possibility. What I saw was that ORACLE_HOME was fine (i.e. no extra front slash at the end). Then after trying a lot when I read this thread, it struck me. The DB was started with ORACLE_HOME set with that extra front slash. So DB was started with ORACLE_HOME=/u01/app/oracle/product/10.2.0.3/ and all the while, I was trying with ORACLE_HOME=/u01/app/oracle/product/10.2.0.3 :(

就我而言,请查看奇怪之处 - 我登录到服务器并尝试连接,但出现上述错误。我知道该实例已启动并且数据库已打开。所以检查了 ORACLE_HOME 因为我有点意识到这种可能性。我看到的是 ORACLE_HOME 很好(即末尾没有额外的前斜线)。然后当我读到这个线程时,尝试了很多之后,它让我印象深刻。数据库以 ORACLE_HOME 开头,并设置了额外的前斜杠。所以 DB 是从 ORACLE_HOME=/u01/app/oracle/product/10.2.0.3/ 开始的,一直以来,我都在尝试使用 ORACLE_HOME=/u01/app/oracle/product/10.2.0.3 :(

Thanks again.

再次感谢。

回答by Anwar Husain

Try this Login with sqlplus sys/sys as sysdba

试试这个登录 sqlplus sys/sys as sysdba

SQL> startup

OUTPUT SHOULD BE LIKE:\n

输出应该是这样的:\n

Total System Global Area  467652608 bytes
Fixed Size          2214416 bytes
Variable Size         352323056 bytes
Database Buffers      104857600 bytes
Redo Buffers            8257536 bytes
Database mounted.
Database opened.

回答by Edmael

Ok here's what i've Found out about instance idle it has to do with the spfile.. sometimes your init.orais located somewhere else

好的,这是我发现的有关实例空闲的信息,它与 spfile 有关.. 有时您init.ora位于其他地方

try to search for init.ora, once you found the location

init.ora找到位置后尝试搜索

try that code startup spfile="C:\location";

试试那个代码 startup spfile="C:\location";

it will say that instance started.

它会说那个实例开始了。

well that one worked for me

那个对我有用

回答by dbamanager

I had the same problem. By removing the extra "/" at the end of ORACLE_HOME solved it.

我有同样的问题。通过删除 ORACLE_HOME 末尾的额外“/”解决了它。

Thanks for sharing - it would have been really difficult to diagnose and resolve this problem in the absence of this blog.

感谢分享 - 如果没有这个博客,诊断和解决这个问题真的很困难。

回答by DCookie

Case is significant on *nix systems, so make sure your ORACLE_SID exactly matches the instance name. In this case, ORA003 is NOT the same as ora003.

大小写在 *nix 系统上很重要,因此请确保您的 ORACLE_SID 与实例名称完全匹配。在这种情况下,ORA003 与 ora003 不同。

回答by Eter Pani

The problem can be if the session could not be opened due to extremally busy database. in this case connection using any user even dummy one

问题可能是由于数据库非常繁忙而无法打开会话。在这种情况下,连接使用任何用户甚至是虚拟用户

sqlplus dummy/dummy

sqlplus 虚拟/虚拟

would give you actual problem but not idle instance.

会给你实际的问题,但不是空闲的实例。