ORACLE数据库关闭与启动

1、查看监听状态

[oracle@oracledb ~]# lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 20-DEC-2020 20:46:53

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                20-SEP-2020 21:42:43
Uptime                    90 days 23 hr. 4 min. 10 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /data/app/oracle/product/11.2.0/network/admin/listener.ora
Listener Log File         /data/app/oracle/diag/tnslsnr/oracledb/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracledb)(PORT=1521)))
Services Summary...
Service "ORCL" has 1 instance(s).
  Instance "ORCL", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
  Instance "ORCL", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@oracledb ~]# 

2、关闭监听器

[oracle@oracledb ~]# lsnrctl stop

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 20-DEC-2020 20:48:43

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
The command completed successfully
[oracle@oracledb ~]#

3、关闭数据库

[oracle@oracledb root]$ 
[oracle@oracledb root]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 20 20:50:25 2020

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options

SQL> 
SQL> 
SQL> 
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> 
SQL> 
SQL> 
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options
[oracle@oracledb root]$

4、启动监听器

[oracle@oracledb ~]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 20-DEC-2020 20:54:43

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Starting /data/app/oracle/product/11.2.0/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /data/app/oracle/product/11.2.0/network/admin/listener.ora
Log messages written to /data/app/oracle/diag/tnslsnr/oracledb/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracledb)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                20-DEC-2020 20:54:43
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /data/app/oracle/product/11.2.0/network/admin/listener.ora
Listener Log File         /data/app/oracle/diag/tnslsnr/oracledb/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracledb)(PORT=1521)))
The listener supports no services
The command completed successfully
[oracle@oracledb ~]$ 
[oracle@oracledb ~]$ 
[oracle@oracledb ~]$ 
[oracle@oracledb ~]$ 
[oracle@oracledb ~]$ lsnrctl status     

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 20-DEC-2020 20:55:53

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                20-DEC-2020 20:54:43
Uptime                    0 days 0 hr. 1 min. 10 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /data/app/oracle/product/11.2.0/network/admin/listener.ora
Listener Log File         /data/app/oracle/diag/tnslsnr/oracledb/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracledb)(PORT=1521)))
The listener supports no services
The command completed successfully
[oracle@oracledb ~]$

5、启动数据库

[oracle@oracledb ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 20 20:56:34 2020

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> CL (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
SP2-0735: unknown CLEAR option beginning "(DESCRIPTI..."
SQL> oracle   32753 20146  0 20:56 pts/1    00:00:00 ps -ef^C^C^C

SQL> 
SQL> startup
ORACLE instance started.

Total System Global Area 1286066176 bytes
Fixed Size                  2213016 bytes
Variable Size             352324456 bytes
Database Buffers          922746880 bytes
Redo Buffers                8781824 bytes
Database mounted.
Database opened.
SQL> 
SQL> 
SQL> 
SQL> 
SQL> 
SQL> select status from v$instance;

STATUS
------------------------
OPEN

SQL>  exit

详细解读可参考:https://blog.csdn.net/lling_shan/article/details/106085875

posted on 2020-12-20 22:06  wangzhch  阅读(271)  评论(0编辑  收藏  举报

导航