• Weblogic+Oracle11g设置开机自启动


    一、Oracle设置开机自启动

    1、编辑/etc/oratab文件

    如果/etc/oratab文件不存在,则需要使用root用户进入ORACLE_HOME目录执行root.sh

    [root@localhost ~ ]# cd $ORACLE_HOME
    [root@localhost dbhome_1]# sh root.sh 
    Performing root user operation for Oracle 11g 
    
    The following environment variables are set as:
        ORACLE_OWNER= oracle
        ORACLE_HOME=  /home/oracle/app/oracle/product/11.2.0/dbhome_1
    
    Enter the full pathname of the local bin directory: [/usr/local/bin]: 
       Copying dbhome to /usr/local/bin ...
       Copying oraenv to /usr/local/bin ...
       Copying coraenv to /usr/local/bin ...
    
    
    Creating /etc/oratab file...
    Entries will be added to the /etc/oratab file as needed by
    Database Configuration Assistant when a database is created
    Finished running generic part of root script.
    Now product-specific root actions will be performed.
    Finished product-specific root actions.
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20

    编辑/etc/oratab文件,添加bxdb:/home/oracle/app/oracle/product/11.2.0/dbhome_1:Y

    # This file is used by ORACLE utilities.  It is created by root.sh
    # and updated by either Database Configuration Assistant while creating
    # a database or ASM Configuration Assistant while creating ASM instance.
    
    # A colon, ':', is used as the field terminator.  A new line terminates
    # the entry.  Lines beginning with a pound sign, '#', are comments.
    #
    # Entries are of the form:
    #   $ORACLE_SID:$ORACLE_HOME::
    #
    # The first and second fields are the system identifier and home
    # directory of the database respectively.  The third filed indicates
    # to the dbstart utility that the database should , "Y", or should not,
    # "N", be brought up at system boot time.
    #
    # Multiple entries with the same $ORACLE_SID are not allowed.
    #
    #
    
    bxdb:/home/oracle/app/oracle/product/11.2.0/dbhome_1:Y
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20

    2、执行dbstart数据库自带启动脚本

    执行dbstart

    [oracle@localhost ~]$ cd $ORACLE_HOME
    [oracle@localhost dbhome_1]$ cd bin
    [oracle@localhost bin]$ dbstart
    ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener
    Usage: ./dbstart ORACLE_HOME
    Processing Database instance "bxdb": log file /home/oracle/app/oracle/product/11.2.0/dbhome_1/startup.log
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    编辑dbstart,将ORACLE_HOME_LISTNER= 将 O R A C L E H O M E L I S T N E R = 将ORACLE_HOME_LISTNER= ORACLEHOMELISTNER=ORACLE_HOME

    [oracle@localhost bin]$ vi dbstart
    ORACLE_HOME_LISTNER=$ORACLE_HOME
    
    • 1
    • 2

    3、编辑/etc/rc.d/rc.local文件,添加oracle启动脚本

    [root@localhost dbhome_1]# cd /etc/rc.d/
    
    [root@localhost rc.d]# vi rc.local
    
    #!/bin/bash
    # THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
    #
    # It is highly advisable to create own systemd services or udev rules
    # to run scripts during boot instead of using this file.
    #
    # In contrast to previous versions due to parallel execution during boot
    # this script will NOT be run after all other services.
    #
    # Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
    # that this script will be executed during boot.
    
    touch /var/lock/subsys/local
    
    su oracle -lc "/home/oracle/app/oracle/product/11.2.0/dbhome_1/bin/lsnrctl start"
    su oracle -lc /home/oracle/app/oracle/product/11.2.0/dbhome_1/bin/dbstart
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20

    二、WebLogic设置开机自启动

    1、编写启动主控脚本

    # vi startAdmin.sh
    nohup ./home/weblogic/Oracle/Middleware/user_projects/domains/base_domain/startWebLogic.sh > /dev/null 2>&1 &
    
    • 1
    • 2

    2、编写启动受管服务脚本

    # vi startManagedServer_hmfms.sh
    nohup ./home/weblogic/Oracle/Middleware/user_projects/domains/base_domain/bin/startManagedWebLogic.sh hmfms > /dev/null 2>&1 &
    
    • 1
    • 2

    3、编辑/etc/rc.d/rc.local文件,添加weblogic启动脚本

    [root@localhost dbhome_1]# cd /etc/rc.d/
    
    [root@localhost rc.d]# vi rc.local
    
    #!/bin/bash
    # THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
    #
    # It is highly advisable to create own systemd services or udev rules
    # to run scripts during boot instead of using this file.
    #
    # In contrast to previous versions due to parallel execution during boot
    # this script will NOT be run after all other services.
    #
    # Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
    # that this script will be executed during boot.
    
    touch /var/lock/subsys/local
    
    su weblogic -lc /home/weblogic/Oracle/Middleware/user_projects/domains/base_domain/startAdmin.sh
    su weblogic -lc /home/weblogic/Oracle/Middleware/user_projects/domains/base_domain/startManagedServer_hmfms.sh
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
  • 相关阅读:
    ubuntu20.04 ROS 环境下使用 Flir Blackfly S 工业相机
    【GPT-SOVITS-04】SOVITS 模块-鉴别模型解析
    Qt for Android实现开机自启动
    人员定位在安全生产管理中的应用
    网络安全(黑客)自学
    Springboot旅游餐饮服务平台r1n3j计算机毕业设计-课程设计-期末作业-毕设程序代做
    微服务实战系列之Nacos
    金仓数据库KingbaseES数据库管理员指南--16管理数据库自动维护任务
    Navicat平替工具,一款免费开源的通用数据库工具
    学习pytorch10 神经网络-最大池化的作用
  • 原文地址:https://blog.csdn.net/lhy030320999/article/details/126302048