oracle启动流程
1.切换为oracle用户:su - oracle,如:
$su - oracle
2..启动监听器:lsnrctl status,如:
[oracle@master ~]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 27-FEB-2018 02:56:32
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Starting /opt/oracle_11/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 /opt/oracle_11/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /opt/oracle_11/app/diag/tnslsnr/master/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=master)(PORT=1521)))
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 27-FEB-2018 02:57:34
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/oracle_11/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /opt/oracle_11/app/diag/tnslsnr/master/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=master)(PORT=1521)))
The listener supports no services
The command completed successfully
3..查看监听器状态:lsnrctl status,如:
[oracle@master ~]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 27-FEB-2018 02:58:15
Copyright (c) 1991, 2011, 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.3.0 - Production
Start Date 27-FEB-2018 02:57:34
Uptime 0 days 0 hr. 0 min. 40 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/oracle_11/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /opt/oracle_11/app/diag/tnslsnr/master/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=master)(PORT=1521)))
The listener supports no services
The command completed successfully
4.查询oracle进程
[oracle@www ~]$ ps -ef | grep oracle
5.启动数据库
$ sqlplus / as sysdba //as前有个空格
SQL> startup
或
$:su - oracle
$:sqlplus /nolog
sql>conn / as sysdba
6.切换数据库用户;
sql>conn demo/demo
7.查询当前用户
SQL> show user
8.显示当前的所有用户表
select * from user_tables
9..关闭数据库
SQL> shutdown 正常关闭
SQL>shutdown abort 强制关闭
10.退出sql控制台
SQL>exit;
11.停止监听器
[oracle@www ~]$ lsnrctl stop
12.重启监听器
[oracle@www ~]$ lsnrctl reload