全部博文(10)
分类: Oracle
2008-07-31 15:41:49
Oracle数据库的手工启动
AllenYao
刚刚安装好Oracle9i的Linux机器重启后,发现数据库无法连接了。原因是数据库并没有随系统自动启动,需要手工执行命令启动。
使用oracle用户登录到Linux系统中,然后执行“sqlplus”程序。
[oracle@CentOS4 ~]$ sqlplus SQL*Plus: Release 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 JServer Release |
此时,如何远程登录数据库还是不能成功,例如在Windows中执行“SQL Plus”会出现这样的错误提示:
SQL*Plus: Release Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. ERROR: ORA-12541: TNS: 没有监听器 |
原因是Oracle数据库的监听程序还没有启动。启动的方法很简单,就是执行“lsnrctl start”命令。
[oracle@CentOS4 ~]$ lsnrctl start LSNRCTL for Linux: Version Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved. Starting /oracle/92/bin/tnslsnr: please wait... TNSLSNR for Linux: Version 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 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 ~]$ |
现在,数据库应该可以远程登录了。