Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Centos oracle 11g self-starting service

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Foreword:

Oracle 11G is installed in the company's test environment, but the system service is not configured. Now we need to configure oracle as a system service, and with the system startup, we have not contacted a bunch of oracle Baidu. It is best to think that this method is the easiest.

Text:

Find the bin/dbstart and bin/dbshut files, switch to the oracle user, and make changes to the two files

About 80 lines of the dbstart file

Vim / oracle/app/oracle/product/11.2.0/dbhome_1/bin/dbstart # ORACLE_HOME_LISTNER=$1 # before change ORACLE_HOME_LISTNER=$ORACLE_HOME # after change

The dbshut file has about 50 lines

Vim / oracle/app/oracle/product/11.2.0/dbhome_1/bin/dbshut#ORACLE_HOME_LISTNER=$1 # before change ORACLE_HOME_LISTNER=$ORACLE_HOME # after change

Create an oracle service

Vim / etc/init.d/oracle#! / bin/sh# chkconfig: 35 90 90# description: Oracle 11gR2# / etc/init.d/oracle## Run-level Stratup script for the Oracle Instance, Listener And Web Interface export LANG=zh_CN.GBKexport ORACLE_BASE=/oracle/app/oracleexport ORACLE_HOME=/oracle/app/oracle/product/11.2.0/dbhome_1/export PATH=$PATH:$ORACLE_HOME/bin ORA_OWNR= "oracle" case "$1" in start) su-$ORA_OWNR-lc $ORACLE_HOME/bin/dbstart # su-$ORA_OWER-lc "$ORACLE_HOME/bin/lsnrctl start" echo "Oracle Start Successful!" ; stop) su-$ORA_OWNR-lc $ORACLE_HOME/bin/dbshut # su-$ORA_OWER-lc "$ORACLE_HOME/bin/lsnrctl start" echo "Oracle Stop Successful!"; reload | restart) $0 stop $0 start;; *) echo $"Usage: `basename $0` {start | stop | reload | restart}" exit 1 esac exit 0

Give oracle execution permission

Chmod 755 / etc/init.d/oracle

Add to the system service and enable

Chkconfig oracle on

In this way, you can use the service to start and stop oracle, while also adding the service to the system startup queue

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report