- 切换到oracle用户:
su - oracle
- 进入sqlplus控制台:
sqlplus /nolog;
- 以系统管理员登录:
connect / as sysdba;
- 启动数据库:
startup
- exit退出sqlplus控制台,然后进入监听控制器:
lsnrctl
- 启动监听:
start
- exit退出监听控制器
演示示例:
[root@pppCentos ~]# su - oracle
[oracle@pppCentos ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 26 08:27:49 2018
Copyright (c) 1982, 2011, Oracle. All rights reserved.
SQL> connect / as sysdba;
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 3023110144 bytes
Fixed Size 2232192 bytes
Variable Size 2197815424 bytes
Database Buffers 805306368 bytes
Redo Buffers 17756160 bytes
Database mounted.
Database opened.
SQL> lsnrctl
SP2-0042: unknown command "lsnrctl" - rest of line ignored.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@pppCentos ~]$ lsnrctl
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 26-JUL-2018 08:29:34
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Welcome to LSNRCTL, type "help" for information.
LSNRCTL> start
Starting /home/oracle/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.3.0 - Production
System parameter file is /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /home/oracle/app/diag/tnslsnr/pppCentos/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=pppCentos)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=pppCentos)(PORT=1521)))
TNS-12535: TNS:operation timed out
TNS-12560: TNS:protocol adapter error
TNS-00505: Operation timed out
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 26-JUL-2018 08:30:41
Uptime 0 days 0 hr. 1 min. 3 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /home/oracle/app/diag/tnslsnr/pppCentos/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=pppCentos)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "orcl" has 1 instance(s).
Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
LSNRCTL> exit
[oracle@pppCentos ~]$ exit
logout
[root@pppCentos ~]#