linux上重启oracle

linux启动oracle

  • 启动oracle的步骤

    Linux下启动oracle分为以下两步:
        1.1、启动lsnrctl监听。
        1.2、启动数据库实例。
    
  • 启动oracle监听

    首先登陆服务器,切换到oracle用户。
    [admin@dataserver ~]$ su - oracle
    密码:
    [oracle@dataserver ~]$
    
    
    接下来,检查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
    
    
    上述反馈的结果即为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 ~]$ 
    
    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
    
    
    [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]$ 
    
    
    31
    37
    至此,oracle监听器启动成功!
    

你可能感兴趣的:(oracle)