刚刚安装好 Oracle9i 的 Linux 机器重启后,发现数据库无法连接了。原因是数据库并没有随系统自动启动,需要手工执行命令启动。
使用 oracle 用户登录到 Linux 系统中,然后执行“ sqlplus ”程序。
引用:[oracle@CentOS4 ~]$ sqlplus
SQL*Plus: Release 9.2.0 .4.0 - Production on Thu Jul 31 10:20:36 2008
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Enter user-name: sys/ypoonsww as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 236000356 bytes
Fixed Size 451684 bytes
Variable Size 201326592 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.
SQL>
SQL> quit
Disconnected from Oracle9i Release 9.2.0 .4.0 - Production
JServer Release 9.2.0 .4.0 - Production
此时,如何远程登录数据库还是不能成功,例如在 Windows 中执行“ SQL Plus ”会出现这样的错误提示:
引用:SQL*Plus: Release 9.2.0 .1.0 - Production on 星期四 7 月 31 10:55:40 2008
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
ERROR:
ORA-12541: TNS: 没有听器
原因是 Oracle 数据库的听程序还没有启动。启动的方法很简单,就是执行“ lsnrctl start ”命令。
引用:[oracle@CentOS4 ~]$ lsnrctl start
LSNRCTL for Linux: Version 9.2.0 .4.0 - Production on 31-JUL-2008 10:21:53
Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.
Starting /oracle/92/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 9.2.0 .4.0 - Production
System parameter file is /oracle/92/network/admin/listener.ora
Log messages written to /oracle/92/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=CentOS4)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 9.2.0 .4.0 - Production
Start Date 31-JUL-2008 10:21:53
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security OFF
SNMP OFF
Listener Parameter File /oracle/92/network/admin/listener.ora
Listener Log File /oracle/92/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=CentOS4)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "dev" has 1 instance(s).
Instance "lx92", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@CentOS4 ~]$
现在,数据库应该可以远程登录了。
shenhua_sjp 于 2008-08-06 17:17:24发表:
gentctl start 是来启动什么的???
目前oracle9i在红帽子企业版4上安装以后
使用以上方法进行启动
莫名其妙的时监听是启动了,但是客户端连接时,监听还是未启动。