• linux下Oracle数据库实例开机自启动设置


    linux下数据库实例开机自启动设置

    1、改动/oratab

    [root@org54 ~]# vi/etc/oratab     --N改为Y,例如以下提示

    # This file is used by ORACLEutilities.  It is created by root.sh

    # and updated by the Database ConfigurationAssistant when creating

    # a database.

     

    # A colon, ':', is used as the fieldterminator.  A new line terminates

    # the entry.  Lines beginning with a pound sign, '#', arecomments.

    #

    # Entries are of the form:

    #  $ORACLE_SID:$ORACLE_HOME:<N|Y>:

    #

    # The first and second fields are thesystem identifier and home

    # directory of the databaserespectively.  The third filed indicates

    # to the dbstart utility that the databaseshould , "Y", or should not,

    # "N", be brought up at systemboot time.

    #

    # Multiple entries with the same$ORACLE_SID are not allowed.

    #

    #

    #game:/u01/app/oracle/product/10.2.0/db_1:N   --dbca创建库时注冊的默认信息

    --格式:$ORACLE_SID:$ORACLE_HOME:<N|Y>   

    --<N|Y>选项代表开机是否自启动

    game:/u01/app/oracle/product/10.2.0/db_1:Y

    ~

    ~

    ~

    ~

    2、编辑/dbstart

    [oracle@org54 bin]$ cd$ORACLE_HOME/bin

    [oracle@org54 bin]$ ls-ll |grep dbstart

    -rwxr-xr-x 1 oracle oinstall    10415 Jan 1  2000 dbstart

    [oracle@org54 bin]$ vidbstart

    --dbstart为开机自启动脚本,让系统开机就去运行dbstart脚本文件,它会去读oratab文件。读到Y就会把相应的实例开机自启动

    --调整或确认监听路径。如ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracleORACLE_HOME_LISTNER=$ORACLE_HOME依据设置的监听调整路径

     

     

    3、编辑/rc.local

    [root@org54 ~]# vi/etc/rc.d/rc.local  --加入例如以下两行信息,启动实例、启动监听

    #!/bin/sh

    #

    # This script will be executed *after* allthe other init scripts.

    # You can put your own initialization stuffin here if you don't

    # want to do the full Sys V style initstuff.

    touch /var/lock/subsys/local

    modprobe hangcheck-timer hangcheck_tick=30hangcheck_margin=180

    su - oracle -c"/u01/app/oracle/product/10.2.0/db_1/bin/dbstart"

    su - oracle -c"/u01/app/oracle/product/10.2.0/db_1/bin/lsnrctl start"

    --命令中-c代表运行脚本。脚本dbstart中指定启动的实例,脚本lsnrctl中启动配置的监听

     

    4、重新启动验证

    # reboot

    [oracle@org54 ~]$ sqlplus'/as sysdba'

     

    SQL*Plus: Release 10.2.0.1.0 - Productionon Fri Jul 4 10:40:57 2014

     

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

     

     

    Connected to:

    Oracle Database 10g Enterprise EditionRelease 10.2.0.1.0 - Production

    With the Partitioning, OLAP and Data Miningoptions

     

    SQL> selectstatus,instance_name from v$instance;

     

    STATUS      INSTANCE_NAME

    ------------ ----------------

    OPEN        game

     

     

    小结:

    linux下设置实例自启动有关脚本:

    oratab:实例是否自启动的注冊信息

    dbstart:开机启动脚本文件会读取oratab信息

    rc.local:开机后马上要做的文件



    ***********************************************声明************************************************

     原创作品,出自 “深蓝的blog” 博客,欢迎转载。转载时请务必注明出处(http://blog.csdn.net/huangyanlong)。

    表述有错误之处,请您留言,不胜感激。

    *****************************************************************************************************



  • 相关阅读:
    axis2依赖的其他jar, 版本不是最新的
    mysql: 安装后的目录结构
    视图的使用
    索引
    递归查询 start with connect by prior
    oracle创建表
    C#中 ??、 ?、 ?: 、?.、?[ ] 和$
    C#关键字static、virtual和abstract笔记
    js调用后台,后台调用前台等方法总结
    java基础序列化
  • 原文地址:https://www.cnblogs.com/slgkaifa/p/7273381.html
Copyright © 2020-2023  润新知