这是C:\oracle\product\10.2.0\db_1\NETWORK\ADMIN\listener.ora 虚拟机中的目录注意自己更改ip地址
# listener.ora Network Configuration File: C:\oracle\product\10.2.0\db_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = orcl)
(ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.17.10)(PORT = 1521))
)
)
在虚拟机中使用cmd,使用命令连接报错不存在共享内存域
vMicrosoft Windows [版本 5.2.3790] (C) 版权所有 1985-2003 Microsoft Corp.
C:\Documents and Settings\Administrator>sqlplus system/password@192.168.17.10:15 21/orcl
SQL*Plus: Release 10.2.0.1.0 - Production on 星期二 6月 11 15:17:13 2019 Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
请输入用户名:
ERROR: ORA-01017: 用户名/口令无效; 登录被拒绝
请输入用户名:
ERROR: ORA-01017: 用户名/口令无效; 登录被拒绝
SP2-0157: 在 3 次尝试之后无法连接到 ORACLE, 退出 SQL*Plus
解决步骤
C:\Documents and Settings\Administrator>set oracle_sid=orcl
C:\Documents and Settings\Administrator>sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on 星期二 6月 11 15:18:02 2019 Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn /as sysdba
已连接到空闲例程。
SQL> startup ORACLE
例程已经启动。
Total System Global Area 612368384 bytes
Fixed Size 1250452 bytes
Variable Size 176163692 bytes
Database Buffers 432013312 bytes
Redo Buffers 2940928 bytes 数据库装载完毕。 数据库已经打开。
SQL> exit
从 Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options 断开
C:\Documents and Settings\Administrator>sqlplus system/password@192.168.17.10:15 21/orcl
SQL*Plus: Release 10.2.0.1.0 - Production on 星期二 6月 11 15:18:34 2019 Copyright (c) 1982, 2005, Oracle. All rights reserved.
连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options
SQL>
成功连接到oracle!!!!!