日期:2014-05-16 浏览次数:20738 次
(一)?
在命令模式下面先启动监听:
?
#>lsnrctl start
?
这个命令会执行较长时间,需要耐心等待,成功后会出现这样的信息:
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 03-DEC-2010 15:26:25
Copyright (c) 1991, 2005, Oracle.? All rights reserved.
Starting /opt/oracle/10.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /opt/oracle/10.2.0/db_1/network/admin/listener.ora
Log messages written to /opt/oracle/10.2.0/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.16)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias???????????????????? LISTENER
Version?????????????????? TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date??????????????? 03-DEC-2010 15:26:27
Uptime??????????????????? 0 days 0 hr. 3 min. 9 sec
Trace Level?????????????? off
Security????????????????? ON: Local OS Authentication
SNMP????????????????????? OFF
Listener Parameter File?? /opt/oracle/10.2.0/db_1/network/admin/listener.ora
Listener Log File???????? /opt/oracle/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
? (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
? (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.16)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
? Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "kids21" has 1 instance(s).
? Instance "kids21", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
(二)
在命令模式下登录到sqlplus
#>sqlplus /nolog
(三)
转接到数据库,这个时候,数据库还没有启动,只启动了监听
sql>connect /as sysdba
?
这个地方,如果输入用户名和密码写成:
sql>connect sys/kids21这样的方式连接的话有可能出现这样的错误:
?
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
如果写成这样:
sql>connect sys/kids21@kids21这样的方式连接的话可能出来这样的错误:
ORA-12505: TNS: 监听程序当前无法识别连接描述符中所给出的SID
原因是listener.ora里面是这样配置的:
# listener.ora Network Configuration File: /opt/oracle/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 = /opt/oracle/10.2.0/db_1)
????? (PROGRAM = extproc)
??? )
? )
LISTENER =
? (DESCRIPTION_LIST =
??? (DESCRIPTION =
????? (ADDRESS = (PROTOC