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

发布于 2024-07-09 18:40:26 字数 521 浏览 5 评论 0原文

所以我有一个 Oracle 实例,并且我知道它正在该系统上运行,我已经向 oracle 用户授予了 su 权限,并且我正在尝试使用“/ 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
%

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?

% 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
%

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

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

发布评论

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

评论(13

污味仙女 2024-07-16 18:40:26

确保 ORACLE_HOME 设置与服务器启动时完全相同,我在Solaris 上的oracle 9.2.0.5.0 上看到过这个问题,

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

这是两个不同的事情,并且会导致本地连接问题。

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=/opt/oracle
ORACLE_HOME=/opt/oracle/

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

喵星人汪星人 2024-07-16 18:40:26

这意味着数据库实例未安装或打开。 执行startup命令并查看是否出现任何错误。

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

ゃ人海孤独症 2024-07-16 18:40:26

谢谢。 它确实是 ORACLE_HOME 变量末尾的额外前斜杠。

就我而言,请参阅奇怪的地方 - 我登录到服务器并尝试连接,但收到上述错误。 我知道实例已启动并且数据库已打开。 所以检查了 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. it indeed was that extra front slash at the end in ORACLE_HOME variable.

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
:(

Thanks again.

简美 2024-07-16 18:40:26

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

sqlplus "/@ConnectIdentifier as sysdba"

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 "/@ConnectIdentifier as sysdba"
感性 2024-07-16 18:40:26

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

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.

北城半夏 2024-07-16 18:40:26

尝试从机器控制台

export ORACLE_SID=your sid here
sqlplus /nolog
startup

我知道在 Windows 上有一个命令来创建一个服务来为您启动一个实例,
oradmin -new -sid %ORACLE_SID% -intpwd %oracle_pwd% -startmode A

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

铁憨憨 2024-07-16 18:40:26

我有同样的问题。
通过删除 ORACLE_HOME 末尾多余的“/”解决了这个问题。

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

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

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

从﹋此江山别 2024-07-16 18:40:26

尝试使用 sqlplus sys/sys as sysdba 登录

SQL> startup

,输出应该如下所示:\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.

Try this Login with sqlplus sys/sys as sysdba

SQL> startup

OUTPUT SHOULD BE LIKE:\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.
残疾 2024-07-16 18:40:26

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

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

尝试该代码startup spfile="C:\location";

它会说实例已启动。

好吧,那对我有用

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

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

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

it will say that instance started.

well that one worked for me

栖迟 2024-07-16 18:40:26

我在指定错误的 SID(xe 而不是 XE)时遇到了同样的问题。
如果使用 rpm 安装数据库,请检查 /etc/inid.d/oracle 中的所有环境

I had same issue while specify wrong SID (xe instead of XE).
If you install database with rpm, check all enviroment at /etc/inid.d/oracle

长伴 2024-07-16 18:40:26

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

sqlplus dummy/dummy

都会给您带来实际问题,但不会给您带来空闲实例。

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

would give you actual problem but not idle instance.

分分钟 2024-07-16 18:40:26

我尝试了 sqlplus dummy/dummy,它给了我实际的问题(内存不足)。 我使内存可用,并且能够毫无问题地登录。

I tried sqlplus dummy/dummy and it gave me the actual issue (out of memory). I made memory available and I was able to login without any issue.

寂寞美少年 2024-07-16 18:40:26

只需输入:

shutdown abort

然后

startup

just type :

shutdown abort

then

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