Friday, August 18, 2017

auto dbstart stop in centos 7 (systemd)

a nice article, followed and works perfectly.

tested on 12.2c on centos 7.3 

Only place to replaced is the ORACLE_BASE AND ORACLE_HOME according to my env.



[root@hmc-P55A-UD3 system]# ps -ef |grep tns
root        28     2  0 06:53 ?        00:00:00 [netns]
root      5336  4752  0 07:20 pts/0    00:00:00 grep --color=auto tns
[root@hmc-P55A-UD3 system]# ps -ef |grep pmon
root      5435  4752  0 07:20 pts/0    00:00:00 grep --color=auto pmon

[root@hmc-P55A-UD3 system]# systemctl start oracle_network.service
[root@hmc-P55A-UD3 system]# ps -ef |grep tns
root        28     2  0 06:53 ?        00:00:00 [netns]
oracle    5449     1  0 07:20 ?        00:00:00 /app/oracle/product/12.2.0/dbhome_1/bin/tnslsnr LISTENER -inherit
root      5456  4752  0 07:20 pts/0    00:00:00 grep --color=auto tns

[root@hmc-P55A-UD3 system]# systemctl start oracledb

[root@hmc-P55A-UD3 system]# systemctl status oracledb
● oracledb.service - Oracle databases service
   Loaded: loaded (/usr/lib/systemd/system/oracledb.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2017-08-18 07:20:49 EDT; 16s ago
  Process: 5463 ExecStart=/app/oracle/product/12.2.0/dbhome_1/bin/dbstart /app/oracle/product/12.2.0/dbhome_1 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/oracledb.service
           ├─5564 ora_pmon_orcl
           ├─5566 ora_clmn_orcl
           ├─5568 ora_psp0_orcl
           ├─5570 ora_vktm_orcl
           ├─5574 ora_gen0_orcl
           ├─5576 ora_mman_orcl
           ├─5580 ora_gen1_orcl
           ├─5584 ora_diag_orcl
           ├─5586 ora_ofsd_orcl
           ├─5590 ora_dbrm_orcl
           ├─5592 ora_vkrm_orcl
           ├─5594 ora_svcb_orcl
           ├─5596 ora_pman_orcl
           ├─5598 ora_dia0_orcl
           ├─5600 ora_dbw0_orcl
           ├─5602 ora_lgwr_orcl
           ├─5604 ora_ckpt_orcl
           ├─5606 ora_lg00_orcl
           ├─5608 ora_smon_orcl
           ├─5610 ora_lg01_orcl
           ├─5612 ora_smco_orcl
           ├─5615 ora_reco_orcl
           ├─5617 ora_w000_orcl
           ├─5619 ora_lreg_orcl
           ├─5621 ora_w001_orcl
           ├─5623 ora_pxmn_orcl
           ├─5627 ora_mmon_orcl
           ├─5629 ora_mmnl_orcl
           ├─5631 ora_d000_orcl
           ├─5633 ora_s000_orcl
           ├─5635 ora_tmon_orcl
           ├─5645 ora_tt00_orcl
           ├─5647 ora_tt01_orcl
           ├─5649 ora_tt02_orcl
           ├─5653 ora_aqpc_orcl
           ├─5657 ora_p000_orcl
           ├─5659 ora_p001_orcl
           ├─5661 ora_p002_orcl
           ├─5663 ora_p003_orcl
           ├─5665 ora_p004_orcl
           ├─5667 ora_p005_orcl
           ├─5669 ora_p006_orcl
           ├─5671 ora_p007_orcl
           ├─5673 ora_p008_orcl
           ├─5675 ora_p009_orcl
           ├─5677 ora_p00a_orcl
           ├─5679 ora_p00b_orcl
           ├─5681 ora_p00c_orcl
           ├─5683 ora_p00d_orcl
           ├─5685 ora_p00e_orcl
           ├─5687 ora_p00f_orcl
           ├─5841 ora_cjq0_orcl
           ├─5962 ora_j000_orcl
           ├─5964 ora_j001_orcl
           ├─5966 ora_s001_orcl
           ├─5968 ora_qm02_orcl
           ├─5970 ora_qm03_orcl
           ├─5972 ora_q002_orcl
           ├─5974 ora_q003_orcl
           └─5976 ora_q004_orcl

Aug 18 07:20:38 hmc-P55A-UD3 systemd[1]: Starting Oracle databases service...
Aug 18 07:20:38 hmc-P55A-UD3 dbstart[5463]: Processing Database instance "orcl": log file /app/oracle/product/12.2.0/dbhome_1/startup.log
Aug 18 07:20:49 hmc-P55A-UD3 systemd[1]: Started Oracle databases service.
[root@hmc-P55A-UD3 system]# systemctl stop oracledb

[oracle@hmc-P55A-UD3 bin]$ ps -ef |grep pmon
oracle    6147  4949  0 07:22 pts/1    00:00:00 grep --color=auto pmon
[oracle@hmc-P55A-UD3 bin]$ ps -ef |grep tns
root        28     2  0 06:53 ?        00:00:00 [netns]
oracle    6152  4949  0 07:22 pts/1    00:00:00 grep --color=auto tns