你的Oracle没有开机自启?那是你没有这样操作!!
作者个人研发的在高并发场景下,提供的简单、稳定、可扩展的延迟消息队列框架,具有精准的定时任务和延迟队列处理功能。自开源半年多以来,已成功为十几家中小型企业提供了精准定时调度方案,经受住了生产环境的考验。为使更多童鞋受益,现给出开源框架地址:https://github.com/sunshinelyz/mykit-delay
重启Oracle数据库
重启Oracle数据库包括启动Oracle数据库服务进程和启动Oracle数据库两步,大家继续往下看。
按照《【Oracle】什么?作为DBA,你竟然不会安装Oracle??》安装Oracle数据库之后,当我们重启系统之后,使用Navicat连接Oracle数据库时,会出现如下的提示信息。
这是因为重启系统之后,Oracle数据库服务并没有自动重启。我们也可以使用netstat命令来查看是否有进程监听1521端口,如下所示。
[root@binghe121 ~]# netstat -nlp | grep 1521 [root@binghe121 ~]#可以看到,并没有进程监听1521端口,说明Oracle数据库进程并没有启动,
接下来,我们首先需要启动Oracle数据库进程。以oracle用户登录系统,输入如下命令启动Oracle服务进程。
lsnrctl start具体命令执行过程如下所示。
[oracle@binghe121 ~]$ lsnrctl start LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 24-MAY-2020 16:14:09 Copyright (c) 1991, 2009, Oracle. All rights reserved. Starting /home/oracle/tools/oracle11g/product/11.2.0/dbhome_1/bin/tnslsnr: please wait... TNSLSNR for Linux: Version 11.2.0.1.0 - Production System parameter file is /home/oracle/tools/oracle11g/product/11.2.0/dbhome_1/network/admin/listener.ora Log messages written to /home/oracle/tools/oracle11g/diag/tnslsnr/binghe121/listener/alert/log.xml Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=binghe121)(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 24-MAY-2020 16:14:10 Uptime 0 days 0 hr. 0 min. 0 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /home/oracle/tools/oracle11g/product/11.2.0/dbhome_1/network/admin/listener.ora Listener Log File /home/oracle/tools/oracle11g/diag/tnslsnr/binghe121/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=binghe121)(PORT=1521))) The listener supports no services The command completed successfully此时,再次使用netstat命令查看1521端口的占用情况,如下所示。
[root@binghe121 ~]# netstat -nlp | grep 1521 tcp6 0 0 :::1521 :::* LISTEN 2075/tnslsnr unix 2 [ ACC ] STREAM LISTENING 21089 2075/tnslsnr /var/tmp/.oracle/sEXTPROC1521可以看到,Oracle数据库服务进程已经开启。
再次使用Navicat连接Oracle数据库,如下所示。
可以看到,并没有成功连接Oracle数据库,这是因为启动Oracle服务进程后,需要我们启动数据库。
使用oracle用户登录系统,并依次执行如下命令启动Oracle数据库。
sqlplus /nolog conn / as sysdba startup命令执行效果如下所示。
[oracle@binghe121 ~]$ sqlplus /nolog SQL*Plus: Release 11.2.0.1.0 Production on Sun May 24 16:23:57 2020 Copyright (c) 1982, 2009, Oracle. All rights reserved. SQL> conn / as sysdba Connected to an idle instance. SQL> startup ORACLE instance started. Total System Global Area 1068937216 bytes Fixed Size 2220200 bytes Variable Size 641732440 bytes Database Buffers 419430400 bytes Redo Buffers 5554176 bytes Database mounted. Database opened.此时,再次使用Navicat连接Oracle数据库,如下所示。
此时Oracle数据库重启成功
关闭Oracle数据库
使用oracle用户登录系统,依次执行如下命令关闭Oracle数据库。
sqlplus /nolog conn /as sysdba shutdown immediate exit lsnrctl stop具体执行情况如下所示。
[oracle@binghe121 ~]$ sqlplus /nolog SQL*Plus: Release 11.2.0.1.0 Production on Sun May 24 16:31:21 2020 Copyright (c) 1982, 2009, Oracle. All rights reserved. SQL> conn /as sysdba Connected. SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. SQL> exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options [oracle@binghe121 ~]$ lsnrctl stop LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 24-MAY-2020 16:31:52 Copyright (c) 1991, 2009, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) The command completed successfully本文转载自微信公众号「 冰河技术」,可以通过以下二维码关注。转载本文请联系 冰河技术公众号。
扫一扫,关注我们