centos7 부팅시 자동으로 oracle 실행하는 방법



오라클 리스너 등록


# vi /usr/lib/systemd/system/oracle_listener.service


[Unit]
Description=oracle listener
After=network.target


[Service]
Type=forking
Environment=ORACLE_BASE=/app/oracle
Environment=ORACLE_HOME=/app/oracle/{경로수정}
Environment=ORACLE_SID=orcl
ExecStart=/app/oracle/{경로수정}/bin/lsnrctl start
ExecStop=/app/oracle/{경로수정}/bin/lsnrctl stop
User=oracle


[Install]
WantedBy=multi-user.target


오라클 인스턴스 등록

# vi /usr/lib/systemd/system/oracle_instance.service

 

[Unit]
Description=oracle instance
After=network.target syslog.target

 

[Service]
Type=forking
User=oracle
Group=database

Environment=ORACLE_BASE=/app/oracle
Environment=ORACLE_HOME=/app/oracle/{경로수정}
Environment=ORACLE_SID=orcl

ExecStart=/app/oracle/{경로수정}/bin/dbstart
ExecStop=/app/oracle/{경로수정}/bin/dbshut

 

[Install]
WantedBy=multi-user.target

 

 systemctl 등록

# systemctl daemon-reload

# systemctl start oracle_listener.service
# systemctl enable oracle_listener.service
# systemctl start oracle_instance.service
# systemctl enable oracle_instance.service



출처: https://wookoa.tistory.com/213 [Wookoa]

reboot 이후 접속확인

+ Recent posts