19c 隨系統systemctl啟動資料庫
19c 隨系統systemctl啟動資料庫
參考:
一、 修改oratab檔案
[root@adg19c ~]# grep woo /etc/oratab woo:/DBSoft/oracle/product/19.3/dbhome_1:N [root@adg19c ~]# sed -i 's/:N/:Y/' /etc/oratab [root@adg19c ~]# grep woo /etc/oratab woo:/DBSoft/oracle/product/19.3/dbhome_1:Y
二、 編輯ora19c呼叫檔案
[root@adg19c ~]# cat /usr/local/ora19c.sh #! /bin/bash echo ################################ echo # script For orac19c.service # echo ################################ /DBSoft/oracle/product/19.3/dbhome_1/lsnrctl start /DBSoft/oracle/product/19.3/dbhome_1/bin/dbstart /DBSoft/oracle/product/19.3/dbhome_1/ ~ [root@adg19c ~]# chmod +x /usr/local/ora19c.sh
三、 編輯ora19c服務配置檔案
[root@adg19c ~]# cat /etc/systemd/system/ora19c.service [Unit] Description=Oracle19c After=syslog.target network.target [Service] LimitMEMLOCK=infinity LimitNOFILE=65535 Type=oneshot RemainAfterExit=yes User=oracle Environment="ORACLE_HOME=/DBSoft/oracle/product/19.3/dbhome_1" ExecStart=/usr/local/ora19c.sh [Install] WantedBy=multi-user.target
四、 啟動資料庫
[root@adg19c ~]# systemctl enable ora19c.service [root@adg19c ~]# systemctl start ora19c.service [root@adg19c ~]# systemctl status ora19c.service * ora19c.service - Oracle19c Loaded: loaded (/etc/systemd/system/ora19c.service; enabled; vendor preset: disabled) Active: active (exited) since Thu 2020-03-12 18:26:26 CST; 11s ago Process: 4607 ExecStart=/usr/local/ora19c.sh (code=exited, status=0/SUCCESS) Main PID: 4607 (code=exited, status=0/SUCCESS) CGroup: /system.slice/ora19c.service `-4611 /DBSoft/oracle/product/19.3/dbhome_1/bin/tnslsnr LISTENER -inherit Mar 12 18:26:25 adg19c ora19c.sh[4607]: SNMP OFF Mar 12 18:26:25 adg19c ora19c.sh[4607]: Listener Parameter File /DBSoft/oracle/product/19.3/dbhome_1/network/admin/listener.ora Mar 12 18:26:25 adg19c ora19c.sh[4607]: Listener Log File /DBSoft/oracle/diag/tnslsnr/adg19c/listener/alert/log.xml Mar 12 18:26:25 adg19c ora19c.sh[4607]: Listening Endpoints Summary... Mar 12 18:26:25 adg19c ora19c.sh[4607]: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=adg19c)(PORT=1521))) Mar 12 18:26:25 adg19c ora19c.sh[4607]: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) Mar 12 18:26:25 adg19c ora19c.sh[4607]: The listener supports no services Mar 12 18:26:25 adg19c ora19c.sh[4607]: The command completed successfully Mar 12 18:26:25 adg19c ora19c.sh[4607]: Processing Database instance "woo": log file /DBSoft/oracle/product/19.3/dbhome_1/rd...tup.log Mar 12 18:26:26 adg19c systemd[1]: Started Oracle19c. Hint: Some lines were ellipsized, use -l to show in full.
五、 完全啟動之後狀態:
[root@adg19c ~]# systemctl status ora19c.service * ora19c.service - Oracle19c Loaded: loaded (/etc/systemd/system/ora19c.service; enabled; vendor preset: disabled) Active: active (exited) since Thu 2020-03-12 18:30:01 CST; 57min ago Process: 1177 ExecStart=/usr/local/ora19c.sh (code=exited, status=0/SUCCESS) Main PID: 1177 (code=exited, status=0/SUCCESS) CGroup: /system.slice/ora19c.service |-1350 /DBSoft/oracle/product/19.3/dbhome_1/bin/tnslsnr LISTENER -inherit |-1481 ora_pmon_woo |-1483 ora_clmn_woo |-1485 ora_psp0_woo |-1490 ora_vktm_woo |-1494 ora_gen0_woo |-1496 ora_mman_woo |-1500 ora_gen1_woo |-1503 ora_diag_woo |-1505 ora_ofsd_woo |-1508 ora_dbrm_woo |-1510 ora_vkrm_woo |-1512 ora_svcb_woo |-1514 ora_pman_woo |-1516 ora_dia0_woo |-1518 ora_dbw0_woo |-1520 ora_lgwr_woo |-1522 ora_ckpt_woo |-1524 ora_lg00_woo |-1526 ora_smon_woo |-1528 ora_lg01_woo |-1530 ora_smco_woo |-1532 ora_reco_woo |-1534 ora_w000_woo |-1536 ora_lreg_woo |-1538 ora_w001_woo |-1540 ora_pxmn_woo |-1544 ora_mmon_woo |-1546 ora_mmnl_woo |-1548 ora_d000_woo |-1550 ora_s000_woo |-1552 ora_tmon_woo |-1575 ora_m000_woo |-1579 ora_p000_woo |-1581 ora_p001_woo |-1583 ora_p002_woo |-1585 ora_tt00_woo |-1588 ora_tt01_woo |-1590 ora_tt02_woo |-1594 ora_aqpc_woo |-1598 ora_p003_woo |-1600 ora_p004_woo |-1602 ora_p005_woo |-1604 ora_p006_woo |-1606 ora_p007_woo |-1609 ora_cjq0_woo |-1611 ora_w002_woo |-1858 ora_m001_woo |-1860 ora_m002_woo |-1862 ora_m003_woo |-1890 ora_w003_woo |-1898 ora_w004_woo |-1900 ora_qm02_woo |-1906 ora_q003_woo |-1947 ora_q00f_woo |-2456 ora_w005_woo |-2460 ora_w006_woo `-2469 ora_w007_woo Mar 12 18:29:48 adg19c ora19c.sh[1177]: SNMP OFF Mar 12 18:29:48 adg19c ora19c.sh[1177]: Listener Parameter File /DBSoft/oracle/product/19.3/dbhome_1/network/admin/listener.ora Mar 12 18:29:48 adg19c ora19c.sh[1177]: Listener Log File /DBSoft/oracle/diag/tnslsnr/adg19c/listener/alert/log.xml Mar 12 18:29:48 adg19c ora19c.sh[1177]: Listening Endpoints Summary... Mar 12 18:29:48 adg19c ora19c.sh[1177]: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=adg19c)(PORT=1521))) Mar 12 18:29:48 adg19c ora19c.sh[1177]: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) Mar 12 18:29:48 adg19c ora19c.sh[1177]: The listener supports no services Mar 12 18:29:48 adg19c ora19c.sh[1177]: The command completed successfully Mar 12 18:29:48 adg19c ora19c.sh[1177]: Processing Database instance "woo": log file /DBSoft/oracle/product/19.3/dbhome_1/rd...tup.log Mar 12 18:30:01 adg19c systemd[1]: Started Oracle19c. Hint: Some lines were ellipsized, use -l to show in full.
六、 登入資料庫驗證
[root@adg19c ~]# su - oracle [oracle@adg19c ~]$ sqlplus / as sysdba SQL*Plus: Release 19.0.0.0.0 - Production on Thu Mar 12 18:30:42 2020 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle. All rights reserved. Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0 SQL> select instance_name,status from gv$instance; INSTANCE_NAME STATUS ---------------- ------------ woo OPEN SQL>
七、 方法二,時候老版本Linux
7.1 編輯/etc/oratab
[root@adg19c ~]# grep woo /etc/oratab woo:/DBSoft/oracle/product/19.3/dbhome_1:N [root@adg19c ~]# sed -i 's/:N/:Y/' /etc/oratab [root@adg19c ~]# grep woo /etc/oratab woo:/DBSoft/oracle/product/19.3/dbhome_1:Y
7.2 編輯dbora服務檔案
[root@adg19c ~]# vi /etc/init.d/dbora #! /bin/sh # description: Oracle auto start-stop script. # # Set ORA_HOME to be equivalent to the $ORACLE_HOME # from which you wish to execute dbstart and dbshut; # # Set ORA_OWNER to the user id of the owner of the # Oracle database in ORACLE_HOME. ORA_HOME=/DBSoft/oracle/product/19.3/dbhome_1 ORA_OWNER=oracle case "$1" in 'start') # Start the Oracle databases: # The following command assumes that the oracle login # will not prompt the user for any values # Remove "&" if you don't want startup as a background process. su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart $ORA_HOME" & touch /var/lock/subsys/dbora ;; 'stop') # Stop the Oracle databases: # The following command assumes that the oracle login # will not prompt the user for any values su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut $ORA_HOME" & rm -f /var/lock/subsys/dbora ;; Esac
7.3 修改檔案許可權
[root@adg19c ~]# chgrp dba /etc/init.d/dbora [root@adg19c ~]# chmod 750 /etc/init.d/dbora
7.4 新增到啟動檔案中
[root@adg19c init.d]# ln -s /etc/init.d/dbora /etc/rc.d/rc0.d/K01dbora [root@adg19c init.d]# ln -s /etc/init.d/dbora /etc/rc.d/rc3.d/S99dbora [root@adg19c init.d]# ln -s /etc/init.d/dbora /etc/rc.d/rc5.d/S99dbora
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/20674423/viewspace-2679763/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 3.1.5.8 隨系統啟動自動啟動資料庫資料庫
- centos 讓 mysql 隨系統啟動CentOSMySql
- Oracle 19c 利用觸發器在資料庫啟動後自動開啟 PDBOracle觸發器資料庫
- CentOS下jar包隨系統啟動CentOSJAR
- 3.1 啟動資料庫資料庫
- 啟動MySql資料庫MySql資料庫
- Oracle 19c資料庫體系結構-2Oracle資料庫
- Oracle 19c資料庫體系結構-1Oracle資料庫
- centos 設定 laravel 佇列隨系統啟動CentOSLaravel佇列
- 啟動資料庫監聽資料庫
- MySQL資料庫如何啟動?MySql資料庫
- 資料庫-隨記資料庫
- uefi啟動隨身碟如何安裝系統_uefi啟動u盤安裝系統的方法
- Linux系統命令之systemctl命令。Linux
- 資料庫與資料庫管理系統概述資料庫
- 資料庫系統概述資料庫
- 【資料庫系統】資料庫系統概論====第十三章 資料庫技術發展資料庫
- windows10系統設定快速啟動隨身碟啟動項的方法Windows
- 3.1.1.4 使用 SRVCTL 啟動資料庫資料庫
- 3.1.1.2 使用RMAN啟動資料庫資料庫
- Oracle資料庫啟動步驟Oracle資料庫
- systemctl 命令在 Linux 中啟動、停止和重新啟動服務Linux
- 製作macOS 11 Big Sur 啟動隨身碟系統Mac
- 資料庫系統概述之國產資料庫資料庫
- 4 配置Oracle資料庫自動啟動Oracle資料庫
- linux系統服務(systemctl)的使用Linux
- 資料庫系統概述之資料庫最佳化資料庫
- 19c rac資料庫如何新增mgmt資料庫
- win10系統BIOS如何設定隨身碟啟動Win10iOS
- 3.1.1.3 使用Cloud Control 啟動資料庫Cloud資料庫
- 3.1.1.1 使用 SQL*Plus 啟動資料庫SQL資料庫
- [重慶思莊每日技術分享]-ORACLE 19C資料庫啟動後,無監聽服務Oracle資料庫
- redis 資料庫隨筆 (一)Redis資料庫
- 使用Systemctl命令來管理系統服務
- MyCat 啟蒙:分散式系統的資料庫架構演變分散式資料庫架構
- httpd使用systemctl啟動超時解決過程httpd
- systemctl 命令設定開機自啟動失敗
- Greenplum資料庫系統架構資料庫架構