如何连接到新安装的 Oracle XE 实例?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5405969/
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
How to connect to newly installed Oracle XE instance?
提问by michael nesterenko
I have installed Oracle XE on Win7 x64 machine. Installation completed successfully without problem, or perhaps installer didn't tell about them. But after installation I can't connect to database; its web interface is not working. I have looked through list of open ports, and there is no 8080 port as was noted during installation. Also I can't connect via SQLPlus.
我已经在 Win7 x64 机器上安装了 Oracle XE。安装成功完成,没有问题,或者安装程序没有告诉他们。但是安装后我无法连接到数据库;它的网络界面不工作。我查看了开放端口列表,没有安装过程中提到的 8080 端口。我也无法通过 SQLPlus 连接。
SQL> connect SYSTEM
Enter password:
ERROR:
ORA-12638: Credential retrieval failed
Somewhere in the web it was told to edit sqlnet.ora
file, I have changed it in the following way:
在网络上的某个地方被告知要编辑sqlnet.ora
文件,我已按以下方式对其进行了更改:
# SQLNET.AUTHENTICATION_SERVICES = (NTS)
SQLNET.AUTHENTICATION_SERVICES = (NONE)
and now I get next error
现在我得到下一个错误
SQL> connect SYSTEM
Enter password:
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
What do I need to change so that I can connect to it?
我需要更改什么才能连接到它?
回答by Rejeev Divakaran
I figured out the issue.
I was using domain login to install Oracle XE. If you are using domain login to install Oracle XE then the database creation will fail (though you may not get any error messages on that regard).
Solution:
Install Oracle using a local admin user.
Change SQLNET.AUTHENTICATION_SERVICES to (NONE) in sqlnet.ora.
Now login with your domain user to use oracle XE.
我想通了这个问题。
我使用域登录来安装 Oracle XE。如果您使用域登录来安装 Oracle XE,那么数据库创建将失败(尽管您可能不会收到任何关于这方面的错误消息)。
解决方案:
使用本地管理员用户安装 Oracle。
在 sqlnet.ora 中将 SQLNET.AUTHENTICATION_SERVICES 更改为 (NONE)。
现在使用您的域用户登录以使用 oracle XE。
回答by cagcowboy
Check the Oracle services are started
检查Oracle服务是否启动
回答by DCookie
Did you set your ORACLE_SID environment variable to the name of the instance you're connecting to?
您是否将 ORACLE_SID 环境变量设置为要连接的实例的名称?
回答by asafm
- Make sure oracle service is started.
- did to ran netca after installation? - if not you can ran it from cmd
- You can't connect using system if the instacne is down only as sysdba (user sys)
- Make sure your ORACLE_HOME,ORACLE_SID,PATH environment variables are ok
- If everything was ok then you can try to start/connect to the instance manually
- 确保 oracle 服务已启动。
- 安装后是否运行netca?- 如果没有,您可以从 cmd 运行它
- 如果 instacne 仅作为 sysdba(用户 sys)关闭,则无法使用系统连接
- 确保你的 ORACLE_HOME、ORACLE_SID、PATH 环境变量没问题
- 如果一切正常,那么您可以尝试手动启动/连接到实例
Sample:
样本:
C:\Documents and Settings\asafm>
C:\Documents and Settings\asafm>
C:\Documents and Settings\asafm>sqlplus "sys as sysdba"
SQL*Plus: Release 11.2.0.1.0 Production on Fri May 11 16:21:42
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Enter password:
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 535662592 bytes
Fixed Size 1375792 bytes
Variable Size 360710608 bytes
Database Buffers 167772160 bytes
Redo Buffers 5804032 bytes
Database mounted.
Database opened.
SQL>
SQL>
SQL>select status from v$instance;
回答by Senthil
As Rejeev Divakaran said, installing oracle XE with local windows user, and switching back to domain user account, started db, able to connect.
正如Rejeev Divakaran所说,用本地windows用户安装oracle XE,并切换回域用户帐户,启动db,能够连接。
Config
配置
- Office Laptop
- Windows 7 64 Bit
- Oracle 11g XE
- 办公笔记本电脑
- 视窗 7 64 位
- 甲骨文 11g XE
回答by J.Hudler
Just in case someone is as "lucky" as me: I recently couldn't install Oracle with a local user (as suggested here before) because the target machine (Win2k8 x64) was also the Domain Controller of that network. All users were in domain - no local users available :(
以防万一有人像我一样“幸运”:我最近无法使用本地用户安装 Oracle(如之前建议的那样),因为目标机器 (Win2k8 x64) 也是该网络的域控制器。所有用户都在域中 - 没有可用的本地用户:(
Here are the steps I performed:
以下是我执行的步骤:
- Installed Oracle XE in my local machine (that works fine). Made a backup (using the built-in
backup.bat
); - Transferred the
fast_recovery_area
folder to my target machine; - Installed the Oracle XE in the target machine normally;
Edited the
%ORA_HOME%\network\admin\sqlnet.ora
file and performed this well-known edit:SQLNET.AUTHENTICATION_SERVICES= (NONE)
Edited the
%ORA_HOME%\bin\restore.bat
file:- Replaced every entry
rman target / (...)
byrman target sys/MySysDbaPass (...)
- Replaced every entry
(...) connect / as sysdba^;
by(...) connect sys/MySysDbaPass as sysdba^;
- Replaced every entry
Runned restore.bat - when prompted, pointed to the
fast_recovery_area
I've transferred before.- Done! (pheew!)
- 在我的本地机器上安装了 Oracle XE(工作正常)。做了一个备份(使用内置的
backup.bat
); - 将
fast_recovery_area
文件夹转移到我的目标机器上; - 在目标机器上正常安装了Oracle XE;
编辑
%ORA_HOME%\network\admin\sqlnet.ora
文件并执行此众所周知的编辑:SQLNET.AUTHENTICATION_SERVICES= (NONE)
编辑了
%ORA_HOME%\bin\restore.bat
文件:- 将每个条目替换
rman target / (...)
为rman target sys/MySysDbaPass (...)
- 将每个条目替换
(...) connect / as sysdba^;
为(...) connect sys/MySysDbaPass as sysdba^;
- 将每个条目替换
运行 restore.bat - 出现提示时,指向
fast_recovery_area
我之前传输过的。- 完毕!(呸!)
回答by Fernando Volquind
Sorry for answering this YEARS old question, but I managed to make it work...
很抱歉回答这个多年的老问题,但我设法让它工作......
Make sqlnet.ora change.
更改 sqlnet.ora。
Run StopDB.bat
运行 StopDB.bat
Run MakeDB.bat
运行 MakeDB.bat
This will create a demo database, reset the password to 'oracle', and will also allow you to connect without error.
这将创建一个演示数据库,将密码重置为“oracle”,并且还允许您无误地连接。
回答by HAL 9000
This error message usually occurs when the database could not be started. The windows service may be running, but still Oracle might not be able to spawn server threads and hand out client connections.
当数据库无法启动时,通常会出现此错误消息。Windows 服务可能正在运行,但 Oracle 仍可能无法生成服务器线程并分发客户端连接。
Have a Look into app\oracle\admin\xe\bdump\alert_xe.log for any error messages during the last start of the Oracle service.
在上次启动 Oracle 服务期间查看 app\oracle\admin\xe\bdump\alert_xe.log 中的任何错误消息。
回答by Kelly
Can you connect this way from the command line:
您可以从命令行以这种方式连接吗:
sqlplus / as sysdba
if so at the SQL prompt enter
如果是,在 SQL 提示符下输入
SQL>startup
If the command returns ok then try to connect with a username and password.
如果命令返回 ok,则尝试使用用户名和密码进行连接。