-
[Linux] Centos 6.8 - 서버 부팅 시에 Oracle 자동 실행운영체제 2019. 3. 4. 09:11반응형
1.임시파일 생성(Oracle 자동실행 스크립트)
# vi /etc/rc.d/init.d/oracle
2.파일내용 추가
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051#!/bin/bash#chkconfig: 2345 95 20#description: oracle service#processname: oracle# /etc/rc.d/init.d/oracle## Run-level Startup script for the Oracle Listener and Instances# It relies on the information on /etc/oratabexport ORACLE_BASE=/oracleexport ORACLE_HOME=$ORACLE_BASE/product/11gexport ORACLE_OWNR=oracleexport PATH=$PATH:$ORACLE_HOME/binif [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]thenecho "Oracle startup: cannot start"exit 1ficase "$1" instart)# Oracle listener and instance startupecho -n "Starting Oracle: "su $ORACLE_OWNR -c "$ORACLE_HOME/bin/lsnrctl start"su $ORACLE_OWNR -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"sudo touch /var/lock/oracleecho "OK";;stop)# Oracle listener and instance shutdownecho -n "Shutdown Oracle: "su $ORACLE_OWNR -c "$ORACLE_HOME/bin/lsnrctl stop"su $ORACLE_OWNR -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"sudo rm -f /var/lock/oracleecho "OK";;reload|restart)$0 stop$0 start;;*)echo "Usage: `basename $0` start|stop|restart|reload"exit 1\esacexit 0cs 3.Permission 설정
# chmod 750 /etc/init.d/oracle
4.Symbolic link 설정
# ln -s /etc/init.d/oracle /etc/rc5.d/S92oracle
# ln -s /etc/init.d/oracle /etc/rc5.d/K92oracle
반응형'운영체제' 카테고리의 다른 글
[Linux] grep 명령어 (0) 2019.03.06 [Linux] 문서 편집기 VI 명령어 (0) 2019.03.05 [Linux] Centos 6.8 - Oracle 11g R2 설치 (0) 2019.03.04 [Linux] Centos 6.8 - 고정 IP 설정 (0) 2019.03.01 [Linux] Centos 6.8 - FTP(vsftpd) 설치 및 설정 (0) 2019.02.28