-- 参考(https://blog.csdn.net/loongshawn/article/details/51162196)

1、启动oracle的步骤

Linux下启动oracle分为以下两步:

  • 1.1、启动lsnrctl监听。
  • 1.2、启动数据库实例。

2、启动oracle监听

首先登陆服务器,切换到oracle用户。

[admin@dataserver ~]$ su - oracle
密码:
[oracle@dataserver ~]$
  • 1
  • 2
  • 3

接下来,检查oracle监听器运行状态,通过lsnrctl status命令查看。

[oracle@dataserver ~]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 15-4月 -2016 14:39:39

Copyright (c) 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=30.85.227.24)(PORT=1521)))
TNS-12543: TNS:destination host unreachable
TNS-12560: TNS:protocol adapter error
TNS-00513: Destination host unreachable
Linux Error: 113: No route to host
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=30.85.227.23)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
[oracle@dataserver ~]$ exit
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23

上述反馈的结果即为oracle监听没有启动,下面执行启动监听,通过命令lsnrctl start,结果如下:

[oracle@dataserver ~]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 15-4月 -2016 14:51:06

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Starting /u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/dataserver/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=30.85.227.24)(PORT=1521)))
TNS-12545: Connect failed because target host or object does not exist
TNS-12560: TNS:protocol adapter error
TNS-00515: Connect failed because target host or object does not exist
Linux Error: 99: Cannot assign requested address Listener failed to start. See the error message(s) above... [oracle@dataserver ~]$
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21

 
上述反馈为监听启动失败,是因为其监听的IP30.85.227.24,并非服务器的IP,所以需要调整这个IP为服务器当前的IP。

在oracle用户下,进入目录/u01/app/oracle/product/11.2.0/dbhome_1/network/admin,修改listener.ora文件。注意这个目录因具体服务器而异。 

listener.ora文件打开,内容如下,调整其中的HOST IP即可。

# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools. SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = ORCL)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = ORCL)
)
) LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 30.85.227.28)(PORT = 1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 30.85.227.23)(PORT = 1521))
) ) ADR_BASE_LISTENER = /u01/app/oracle
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28

调整完监听IP后,重启监听器,执行lsnrctl start,

[oracle@dataserver admin]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 15-4月 -2016 15:09:15

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Starting /u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/dataserver/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=30.85.227.28)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=30.85.227.23)(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 15-4月 -2016 15:09:15
Uptime 0 days 0 hr. 0 min. 5 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/dataserver/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=30.85.227.28)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=30.85.227.23)(PORT=1521)))
Services Summary...
Service "ORCL" has 1 instance(s).
Instance "ORCL", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@dataserver admin]$
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37

至此,oracle监听器启动成功!

3、启动oracle实例

以system用户身份登陆oracle

[oracle@dataserver admin]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on 星期五 4月 15 15:23:04 2016

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

SQL> conn as sysdba
Enter user-name: system
Enter password:
Connected to an idle instance.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

然后启动实例,通过startup命令:

SQL> startup
ORACLE instance started. Total System Global Area 4.0620E+10 bytes
Fixed Size 2216024 bytes
Variable Size 2.3354E+10 bytes
Database Buffers 1.7180E+10 bytes
Redo Buffers 84054016 bytes
Database mounted.
Database opened.
SQL>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12

4、关闭oracle实例

通过shutdown命令关闭oracle实例。

SQL> shutdown
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>

启动oracle 服务的更多相关文章

  1. linux下启动oracle服务命令

    以redflag(redhat /centos)linux下的 oracle 10g 为例: 如果oracle安装和配置都没有问题的话: 依次执行以下代码即可启动oracle服务. #su - ora ...

  2. Windows下命令行下启动ORACLE服务

    检查监听器状态:C:\>lsnrctl statusLSNRCTL for 32-bit Windows: Version 9.2.0.1.0 - Production on 30-6月 -20 ...

  3. 手动启动 oracle 服务

      手动启动 Oracle 服务 为了学习,我们常常会在个人PC上安装 Oracle 数据库,这大大影响了计算机的运行速度,尤其是计算机开机速度,如果 Oracle 使用频率并不是非常高,我们可以禁止 ...

  4. Linux下启动Oracle服务和监听程序步骤

    Linux下启动Oracle服务和监听程序启动和关闭步骤整理如下: 1.安装oracle: 2.创建oracle系统用户: 3./home/oracle下面的.bash_profile添加几个环境变量 ...

  5. Linux服务器重启后启动Oracle服务

    目录 1. 启动Oracle服务 2. 启动Oracle监听服务 © 版权声明:本文为博主原创文章,转载请注明出处 1. 启动Oracle服务 重启Linux服务器后,Oracle服务还需要手动启动. ...

  6. 快速启动Oracle服务

    快速启动Oracle服务的批处理命令步骤 新建记事本 粘贴如下内容: @echo off echo 确定要启动Oracle 11g服务吗? pause net start OracleOraDb11g ...

  7. Oracle学习.Windows 命令行 启动ORACLE服务与实例

    使用数据库前要先打开数据库的实例和监听器! --总结启动命令如下: lsnrctl  [start|stop|status]                  --启动监听器,停止监听器,查看监听器的 ...

  8. Linux下启动Oracle服务和监听程序

    $ su – oracle $ sqlplus / nolog sql> conn / as sysdba sql> startup                 #启动Oracle,需 ...

  9. 手动启动Oracle服务的.bat文件

    Oracle数据库的基本服务会占用很大的内存,有的程序员会在不用的时候Oracle服务关闭来减少对电脑内存资源的占用. 我在这准备了一个可以开启/关闭Oracle服务的bat文件,希望被采纳!!! 新 ...

  10. Linux下的启动oracle服务 启动监听 开放端口操作

    尝试登录oracle 使用root用户将没有sqlplus命令 [root@localhost ~]# sqlplus /nolog bash: sqlplus: 未找到命令...     [root ...

随机推荐

  1. 基于斜率-截距式参数方程的直线Hough变换

  2. 性能测试工具_nGrinder

    1. ngrinder-controller-3.4.3.war 放置到tomcat的webapps目录下:2. 启动tomcat;3. 访问地址: http://localhost:8080/ngr ...

  3. HBase介绍和工作原理

    HBase 1.HBase介绍和工作原理 HBase是一个分布式的.面向列的开源数据库,该技术来源于 Fay Chang 所撰写的Google论文"Bigtable:一个结构化数据的分布式存 ...

  4. 在linux系统通过OpenSSL工具自签https证书

    工具介绍 OpenSSL是SSL/TLS协议的实现工具 key是私钥文件,用于对发送给客户端的数据加密,以及对从客户端接收的数据进行解密. csr是证书签名请求文件,用于提交给证书颁发机构(CA)对证 ...

  5. AI编程:如何编写提示词

    这是小卷对AI编程工具学习的第2篇文章,今天讲讲如何编写AI编程的提示词,并结合实际功能需求案例来进行开发 1.编写提示词的技巧 好的提示词应该是:目标清晰明确,具有针对性,能引导模型理解问题 下面是 ...

  6. Git的一些基本用法

    本文分享自天翼云开发者社区<Git的一些基本用法>,作者:l****n 基本操作 git branch 查看当前分支 git branch -a 查看所有分支 git pull 更新当前分 ...

  7. Air实现Go程序的热重载(热加载)

    简介: air是Go的热加载工具,它可以监听文件或者目录的变化,自动编译,重启程序,提高开发的工作效率. 场景: 在代码修改后需要通过ctrl+c来停止项目,go run的方式来再次重启项目,在开发进 ...

  8. VS Code 开发工具的基本使用

    VS Code 开发工具的基本使用 VS Code(Visual Studio Code)是微软开发的一款免费.开源的代码编辑器,它支持多种操作系统,包括Windows.macOS和Linux.VS ...

  9. 『Python底层原理』--CPython如何运行Python代码

    Python作为一种广泛使用的编程语言,其简洁的语法和强大的功能深受开发者喜爱. 然而,对于许多Python用户来说,CPython(Python的官方实现)的内部工作机制仍然是一个神秘的黑盒. 今天 ...

  10. Java获取数据库的列名、列数、标题、类型等信息, ResultSetMetaData

    import java.sql.*; public class jdbcTest { public static void main(String[] args) throws ClassNotFou ...