监听的相关命令:
启动监听:lsnrctl start
停止监听:lsnrctl stop
查看监听状态:lsnrctl status
第一步:启动数据库监听。
C:\Users\admin>lsnrctl start
LSNRCTL for 64-bit Windows: Version 11.2.0.1.0 - Production on 25-AUG-2015 08:57
:06
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Starting tnslsnr: please wait...
TNSLSNR for 64-bit Windows: Version 11.2.0.1.0 - Production
System parameter file is D:\app\admin\product\11.2.0\dbhome_1\network\admin\list
ener.ora
Log messages written to d:\app\admin\diag\tnslsnr\pfzhang3_PC\listener\alert\log
.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521
ipc)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 64-bit Windows: Version 11.2.0.1.0 - Produ
ction
Start Date 25-AUG-2015 08:57:12
Uptime 0 days 0 hr. 0 min. 5 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File D:\app\admin\product\11.2.0\dbhome_1\network\admin\lis
tener.ora
Listener Log File d:\app\admin\diag\tnslsnr\pfzhang3_PC\listener\alert\l
og.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521ipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "orcl" has 1 instance(s).
Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
2.启动数据库实例
第二步:在命令提示符中输入sqlplus /nolog,表示不登陆任何数据库系统。
C:\Users\admin>sqlplus /nolog
SQL*Plus: Release 11.2.0.1.0 Production on Tue Aug 25 08:43:24 2015
Copyright (c) 1982, 2010, Oracle. All rights reserved.
SQL>
SQL> connect / as sysdba
Connected to an idle instance.
第四步:启动数据库实例。
SQL> startup
ORACLE instance started.
Total System Global Area 3240239104 bytes
Fixed Size 2180104 bytes
Variable Size 2097155064 bytes
Database Buffers 1124073472 bytes
Redo Buffers 16830464 bytes
Database mounted.
Database opened.
至此:通过标题1和2中的第一步到第四步,数据库已经启动完毕。
3. 关闭监听
第一步:关闭监听
C:\Users\admin>lsnrctl stop
LSNRCTL for 64-bit Windows: Version 11.2.0.1.0 - Production on 25-AUG-2015 09:05:00
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
The command completed successfully