Load To Technical Architect

[Linux] Oracle Service 등록 본문

DB/oracle

[Linux] Oracle Service 등록

고지식한청춘 2020. 6. 15. 18:17
728x90

1. Service 파일 생성

$ vi /etc/systemd/system/oracle.service

 

[Unit]
Description=Oracle Database service

[Service]
Type=forking

EnvironmentFile=/etc/sysconfig/db01.oracledb

ExecStart=/usr/oracle/app/product/12.2.0/dbhome_1/bin/dbstart $ORACLE_HOME
ExecStop=/usr/oracle/app/product/12.2.0/dbhome_1/bin/dbshut $ORACLE_HOME

User=oracle

[Install]
WantedBy=multi-user.target

 

 

2. 원하는 위치에 환경변수 파일 생성

$ vi /etc/sysconfig/db01.oracledb

 

ORACLE_BASE=/usr/oracle
ORACLE_HOME=/usr/oracle/product/12.2.0/dbhome_1
ORACLE_SID=orcl
ORACLE_HOME_LISTNER=/usr/oracle/product/12.2.0/dbhome_1/bin/lsnrctl

 

 

3. systemctl daemon 재시작

$ systemctl daemon-reload

 

 

◎ 정상적으로 Service가 등록되었는지 확인

$ systemctl status oracle

728x90
Comments