Oracle 机器宕机之后启动数据库
Oracle 机器宕机之后启动数据库
启动监听,登录数据库,启动数据库
检查监听
[oracle@oracle-db ~]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 24-JAN-2025 09:42:34
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
启动监听
[oracle@oracle-db ~]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 24-JAN-2025 09:44:17
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Starting /oracle/product/OraHome/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.4.0 - Production
System parameter file is /oracle/product/OraHome/network/admin/listener.ora
Log messages written to /oracle/diag/tnslsnr/oracle-db/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle-db)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 24-JAN-2025 09:44:21
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/product/OraHome/network/admin/listener.ora
Listener Log File /oracle/diag/tnslsnr/oracle-db/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle-db)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully
监听启动成功
登录数据库
[oracle@oracle-db ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Fri Jan 24 09:45:40 2025
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to an idle instance.
SQL>
说明已经登录成功
检查数据库
SQL> select status from v$instance;
select status from v$instance
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0
出现以上信息说明数据库没有启动;
启动数据库
SQL> startup;
ORACLE instance started.
Total System Global Area 1.3362E+10 bytes
Fixed Size 2265864 bytes
Variable Size 6912216312 bytes
Database Buffers 6442450944 bytes
Redo Buffers 4911104 bytes
Database mounted.
Database opened.
再次查看实例则可以看到数据库已经启动成功
SQL> select status from v$instance;
STATUS
------------
OPEN
期间使用到所有的命令
在oracle 用户下的命令
- 查看oracle监听状态:
lsnrctl status
- 启动oracle监听:
lsnrctl start
- 登录oralce数据库:
sqlplus / as sysdba
在sqlplus 中的命令
- 查询实例状态:
select status from v$instance;
- 启动数据库:
startup;
这样就可以启动数据库了