简体   繁体   English

如何连接到新安装的Oracle XE实例?

[英]How to connect to newly installed Oracle XE instance?

I have installed Oracle XE on Win7 x64 machine. 我在Win7 x64机器上安装了Oracle XE。 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. 我查看了开放端口列表,并且没有安装过程中注意到的8080端口。 Also I can't connect via SQLPlus. 我也无法通过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? 我需要更改什么才能连接到它?

I figured out the issue. 我想出了这个问题。
I was using domain login to install Oracle XE. 我使用域登录来安装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). 如果您使用域登录来安装Oracle XE,则数据库创建将失败(尽管您可能无法获得有关此方面的任何错误消息)。
Solution: 解:
Install Oracle using a local admin user. 使用本地管理员用户安装Oracle。
Change SQLNET.AUTHENTICATION_SERVICES to (NONE) in sqlnet.ora. 在sqlnet.ora中将SQLNET.AUTHENTICATION_SERVICES更改为(NONE)。
Now login with your domain user to use oracle XE. 现在使用您的域用户登录以使用oracle XE。

  1. Make sure oracle service is started. 确保启动oracle服务。
  2. did to ran netca after installation? 安装后运行netca吗? - if not you can ran it from cmd - 如果没有,你可以从cmd运行它
  3. You can't connect using system if the instacne is down only as sysdba (user sys) 如果instacne仅作为sysdba(用户sys)关闭,则无法使用系统进行连接
  4. Make sure your ORACLE_HOME,ORACLE_SID,PATH environment variables are ok 确保您的ORACLE_HOME,ORACLE_SID,PATH环境变量正常
  5. If everything was ok then you can try to start/connect to the instance manually 如果一切正常,那么您可以尝试手动启动/连接到实例

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;

检查Oracle服务是否已启动

您是否将ORACLE_SID环境变量设置为要连接的实例的名称?

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所说,安装oracle XE与本地Windows用户,并切换回域用户帐户,启动db,能够连接。

Config 配置

  • Office Laptop Office笔记本电脑
  • Windows 7 64 Bit Windows 7 64位
  • Oracle 11g XE Oracle 11g XE

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,则尝试使用用户名和密码进行连接。

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. 查看app \\ oracle \\ admin \\ xe \\ bdump \\ alert_xe.log,查看上次启动Oracle服务期间的任何错误消息。

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. 以防有人和我一样“幸运”:我最近无法使用本地用户安装Oracle(如前所述),因为目标计算机(Win2k8 x64)也是该网络的域控制器。 All users were in domain - no local users available :( 所有用户都在域中 - 没有本地用户可用:(

Here are the steps I performed: 以下是我执行的步骤:

  • Installed Oracle XE in my local machine (that works fine). 在我的本地机器上安装了Oracle XE(运行正常)。 Made a backup (using the built-in backup.bat ); 做了备份(使用内置的backup.bat );
  • Transferred the fast_recovery_area folder to my target machine; fast_recovery_area文件夹转移到我的目标机器;
  • Installed the Oracle XE in the target machine normally; 正常地在目标机器上安装Oracle XE;
  • Edited the %ORA_HOME%\\network\\admin\\sqlnet.ora file and performed this well-known edit : 编辑了%ORA_HOME%\\network\\admin\\sqlnet.ora文件并执行了这个众所周知的编辑

    SQLNET.AUTHENTICATION_SERVICES= (NONE)

  • Edited the %ORA_HOME%\\bin\\restore.bat file: 编辑%ORA_HOME%\\bin\\restore.bat文件:

    • Replaced every entry rman target / (...) by rman target sys/MySysDbaPass (...) rman target sys/MySysDbaPass (...)替换每个入口rman target / (...) rman target sys/MySysDbaPass (...)
    • Replaced every entry (...) connect / as sysdba^; 替换每个条目(...) connect / as sysdba^; by (...) connect sys/MySysDbaPass as sysdba^; 通过(...) connect sys/MySysDbaPass as sysdba^;
  • Runned restore.bat - when prompted, pointed to the fast_recovery_area I've transferred before. 运行restore.bat - 出现提示时,指向我之前传输的fast_recovery_area

  • Done! 完成! ( pheew! ) 瞧!

Sorry for answering this YEARS old question, but I managed to make it work... 很抱歉回答这个YEARS旧问题,但我设法让它工作......

Make sqlnet.ora change. make 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',并且还允许您连接而不会出错。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM