Linux服务器下oracle数据库启动服务操作步骤

一、在Linux下启动Oracle
1.登录到Linux服务器,切换到oracle用户权限(命令是:# su - oracle)

2.进入sqlplus界面(命令是:$ sqlplus /nolog 或 sqlplus / as sysdba)

原本的画面会变为
SQL>
接着请输入
SQL>conn / as sysdba ;
输入
SQL> startup (作用:启动数据库实例)
另外停止数据库的指令如下:
SQL> shutdown immediate

复制代码
1 [oracle@localhost ~]$ sqlplus / as sysdba --进入sqlplus界面
2
3 SQL*Plus: Release 11.2.0.1.0 Production on Thu Mar 17 10:48:08 2022
4
5 Copyright © 1982, 2009, Oracle. All rights reserved.
6
7 Connected to an idle instance.
8
9 SQL> quit
10 Disconnected

11 [oracle@localhost ~]$ sqlplus /nolog --进入sqlplus界面
12
13 SQL*Plus: Release 11.2.0.1.0 Production on Thu Mar 17 10:48:42 2022
14
15 Copyright © 1982, 2009, Oracle. All rights reserved.
16
17 SQL> conn / as sysdba --sysdba登录
18 Connected to an idle instance.
19 SQL> startup --启动数据库实例
20 ORACLE instance started.
21
22 Total System Global Area 1068937216 bytes
23 Fixed Size 2220200 bytes
24 Variable Size 281022296 bytes
25 Database Buffers 780140544 bytes
26 Redo Buffers 5554176 bytes
27 Database mounted.
28 Database opened.
29 SQL> shutdown immediate --关闭数据库实例
30
31 Database closed.
32 Database dismounted.
33
34
35 ORACLE instance shut down.
36 SQL>quit --退出
复制代码
二、检查Oracle 数据库是否启动

回到终端机模式,输入:ps -ef|grep ora_ (作用是:查看是否有Oracle的进程,如果有,大多数情况说明启动了。)

复制代码
[oracle@localhost ~]$ ps -ef|grep ora_
oracle 12193 1 0 11:00 ? 00:00:00 ora_pmon_orcl
oracle 12195 1 0 11:00 ? 00:00:00 ora_vktm_orcl
oracle 12199 1 0 11:00 ? 00:00:00 ora_gen0_orcl
oracle 12201 1 0 11:00 ? 00:00:00 ora_diag_orcl
oracle 12203 1 0 11:00 ? 00:00:00 ora_dbrm_orcl
oracle 12205 1 0 11:00 ? 00:00:00 ora_psp0_orcl
oracle 12207 1 0 11:00 ? 00:00:00 ora_dia0_orcl
oracle 12209 1 0 11:00 ? 00:00:00 ora_mman_orcl
oracle 12211 1 0 11:00 ? 00:00:00 ora_dbw0_orcl
oracle 12213 1 0 11:00 ? 00:00:00 ora_lgwr_orcl
oracle 12215 1 0 11:00 ? 00:00:00 ora_ckpt_orcl
oracle 12217 1 0 11:00 ? 00:00:00 ora_smon_orcl
oracle 12219 1 0 11:00 ? 00:00:00 ora_reco_orcl
oracle 12221 1 0 11:00 ? 00:00:00 ora_mmon_orcl
oracle 12223 1 0 11:00 ? 00:00:00 ora_mmnl_orcl
oracle 12225 1 0 11:00 ? 00:00:00 ora_d000_orcl
oracle 12227 1 0 11:00 ? 00:00:00 ora_s000_orcl
oracle 12239 1 0 11:00 ? 00:00:00 ora_qmnc_orcl
oracle 12257 1 0 11:00 ? 00:00:00 ora_cjq0_orcl
oracle 12277 1 0 11:00 ? 00:00:00 ora_q000_orcl
oracle 12279 1 0 11:00 ? 00:00:00 ora_q001_orcl
oracle 12389 10058 0 11:01 pts/0 00:00:00 grep --color=auto ora_
[oracle@localhost ~]$
复制代码
三、检查Oracle DB监听器是否正常

输入:$ lsnrctl status (作用是:检查监听是否启动。) 以下为没有启动。

复制代码
[oracle@localhost ~]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 17-MAR-2022 11:03:33

Copyright © 1991, 2009, Oracle. All rights reserved.

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: 2: No such file or directory
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
[oracle@localhost ~]$ ^C
[oracle@localhost ~]$
复制代码
如果没有启动,可以输入:$ lsnrctl start (作用是:启动监听器)

复制代码
[oracle@localhost ~]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 17-MAR-2022 11:04:48

Copyright © 1991, 2009, Oracle. All rights reserved.

Starting /data/oracle/product/11.2.0/bin/tnslsnr: please wait…

TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /data/oracle/product/11.2.0/network/admin/listener.ora
Log messages written to /data/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(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 17-MAR-2022 11:04:48
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /data/oracle/product/11.2.0/network/admin/listener.ora
Listener Log File /data/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
The listener supports no services
The command completed successfully
[oracle@localhost ~]$
复制代码
另外停止监听的指令如下:

$ lsnrctl stop
————————————————
版权声明:本文为CSDN博主「格格巫 MMQ!!」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_43214644/article/details/123847340

  • 5
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值