描述:
linux7安裝oracle11G后,設(shè)置開機自啟動
問題:
當服務(wù)器重啟或使用systemctl start oracle.service以后,會把在start的腳本執(zhí)行,并把stop的腳本一起執(zhí)行。
配置文件和腳本:
[root@localhost ray]# vim /lib/systemd/system/oracle.service [Unit] Description=oracle Server After=network.target [Service] Type=forking ExecStart=/root/scripts/dbstart.sh ExecStop=/root/scripts/dbstop.sh ExecReload= PrivateTmp=true [Install] WantedBy=multi-user.target [root@localhost scripts]# vim dbstart.sh #!/bin/bash su - oracle -c "dbstart" [root@localhost scripts]# vim dbstop.sh #!/bin/bash su - oracle -c "dbshut"
解決:
不使用腳本調(diào)用oracle用戶的命令,而是直接指定服務(wù)的用戶和屬組。
[root@localhost ray]# vim /lib/systemd/system/oracle.service [Unit] Description=oracle Server After=network.target [Service] Type=forking User=oracle Group=oinstall ExecStart=/u01/oracle/product/11.2.0/db_1/bin/dbstart ExecStop=/u01/oracle/product/11.2.0/db_1/bin/dbshut ExecReload= PrivateTmp=true [Install] WantedBy=multi-user.target
網(wǎng)頁名稱:linux7開機自啟動oracle-創(chuàng)新互聯(lián)
當前URL:http://jinyejixie.com/article44/dshsee.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供標簽優(yōu)化、外貿(mào)建站、用戶體驗、網(wǎng)站設(shè)計、做網(wǎng)站、虛擬主機
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容