Sql plus无法连接到oracle
我已经在Windows7操作系统上安装了Oracle 11g。 这工作正常,但在从Sqlplus连接oracle时突然出现错误Sql plus无法连接到oracle,sql,oracle,oracle11g,Sql,Oracle,Oracle11g,我已经在Windows7操作系统上安装了Oracle 11g。 这工作正常,但在从Sqlplus连接oracle时突然出现错误 C:\>sqlplus SQL*Plus: Release 11.2.0.1.0 Production on Sun Aug 24 00:14:32 2014 Copyright (c) 1982, 2010, Oracle. All rights reserved. Enter user-name: system Enter password: ERR
C:\>sqlplus
SQL*Plus: Release 11.2.0.1.0 Production on Sun Aug 24 00:14:32 2014
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Enter user-name: system
Enter password:
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Process ID: 0
Session ID: 0 Serial number: 0
我已将ORACLE\u HOME=C:\app\product\11.2.0\dbhome\u 1和ORACLE\u SID设置为orcl
listener.ora
#Network Configuration File: C:\app\product\11.2.0\dbhome_1\network\admin\listener.ora
#Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\app\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\app\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
ADR_BASE_LISTENER = C:\app
特斯奈姆斯·奥拉
# tnsnames.ora Network Configuration File: C:\app\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
更新1
我的init.ora文件:
# Example INIT.ORA file
#
# This file is provided by Oracle Corporation to help you start by providing
# a starting point to customize your RDBMS installation for your site.
#
# NOTE: The values that are used in this file are only intended to be used
# as a starting point. You may want to adjust/tune those values to your
# specific hardware and needs. You may also consider using Database
# Configuration Assistant tool (DBCA) to create INIT file and to size your
# initial set of tablespaces based on the user input.
###############################################################################
# Change '<ORACLE_BASE>' to point to the oracle base (the one you specify at
# install time)
db_name='ORCL'
memory_target=1G
processes = 150
audit_file_dest='<ORACLE_BASE>/admin/orcl/adump'
audit_trail ='db'
db_block_size=8192
db_domain=''
db_recovery_file_dest='<ORACLE_BASE>/flash_recovery_area'
db_recovery_file_dest_size=2G
diagnostic_dest='<ORACLE_BASE>'
dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'
open_cursors=300
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
# You may want to ensure that control files are created on separate physical
# devices
control_files = (ora_control1, ora_control2)
compatible ='11.2.0'
我很感谢有人能在这方面提供帮助。提前谢谢。C:\>sqlplus/nolog
C:\> sqlplus /nolog
SQL> conn / as sysdba
SQL> startup
**Database starts**
SQL> conn <<your_user>>
SQL>conn/as sysdba
SQL>启动
**数据库启动**
SQL>conn
若数据库未启动,则表明您的init.ora
文件有问题
祝你好运。它既有用又博学,希望在这里也有用:
http://ora-data.blogspot.com/2016/11/sqlplus-not-connecting-in-oracle.html
[oracle@ebs sqlplus]$ echo $PATH
/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/oracle/bin
[oracle@ebs sqlplus]$ pwd
/u01/StageR122/oracle/product/11.2.0/dbhome_1/sqlplus
[oracle@ebs sqlplus]$ export PATH=$PATH:/u01/StageR122/oracle/product/11.2.0/dbhome_1/bin/
[oracle@ebs sqlplus]$ sqlplus '/as sysdba'
SQL*Plus: Release 11.2.0.1.0 Production on Mon Jul 11 12:52:30 2016
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL>
谢谢,请确保Windows服务
OracleOradb18Home1TNListener
正在运行。如果它已经在运行,请重新启动服务
运行以下shell命令:
sqlplus sys as sysdba
startup
您也可以运行此命令来检查它
sqlplus myUsername/myPassword@localhost
请确保数据库已启动。运气不好。这是我的init.ora文件内容。db\u name='ORCL'memory\u target=1G processs=150 audit\u file\u dest='/admin/ORCL/adump'audit\u trail='db'db\u block\u size=8192 db\u domain'=db\u recovery\u file\u dest='/flash\u recovery\u area'db\u recovery\u file\u dest\u size=2G diagnostic\u dest=''dispatchers='(协议=TCP)(服务=ORCLXDB)“open_cursors=300 remote_login_passwordfile='EXCLUSIVE'undo_tablespace='UNDOTBS1'#您可能希望确保在单独的物理设备上创建控制文件控制文件=(ora_control1,ora_control2)compatible='11.2.0'我的错。在nolog模式下打开SQLplus后,尝试以sysdba身份连接:conn/as sysdba(仅当您以安装Oracle的SO用户身份登录时才起作用)。然后尝试启动命令。我将编辑答案以添加它。尝试过了,但没有成功,我已经在update1下添加了有问题的init.ora文件以及启动命令结果。哦,天哪。看起来像是后台进程或数据文件有问题,因为其他一切看起来都很好。也许dba.stackoverflow.com上的人可以帮助您。您必须查看警报日志和跟踪,但这似乎不是该站点的正确问题。也许从备份中恢复?
sqlplus myUsername/myPassword@localhost