oracle定時任務執行報錯並自動導致資料庫關閉

2021-08-20 10:12:01 字數 1158 閱讀 8352

問題描述:

編寫shell指令碼在linux伺服器中通過cron服務定時執行自動備份,每次備份完成後在結尾操作中資料庫報錯,服務被關閉。shell指令碼單獨執行備份沒有問題。檢視alert日誌發現以下錯誤資訊:

ora-27157: os post/wait facility removed

ora-27300: os system dependent operation:semop failed with status: 43

ora-27301: os failure message: identifier removed

ora-27302: failure occurred at: sskgpwwait1

原因定位:

在rhel7在rhel7.2中,systemd-logind服務引入了乙個新特性:在乙個user完全退出os後會remove掉所有的ipc物件。

該特性由/etc/systemd/logind.conf引數檔案中removeipc選項來控制。詳細請看man logind.conf(5)。

在rhel7.2中,removeipc的預設值是yes

因此,當最後乙個oracle或者grid使用者退出時,作業系統會remove掉這個user的shared memory segments和semaphores

而oracle asm和database的sga需要使用 shared memory segments,因此remove shared memory segments將會crash掉oracle asm和database instances。

請參考redhat bug 1264533 -

這個問題會影響使用shared memory segments和semaphores的所有應用,因此,oracle asm 例項和oracle database 例項均受到影響。

oel7.2為了避免這個問題,在/etc/systemd/logind.conf配置檔案中明確設定removeipc為no。

1).設定/etc/systemd/logind.conf中removeipc=no

2).重啟伺服器或者重啟systemd-logind

重啟systemd-logind:

# systemctl daemon-reload

# systemctl restart systemd-logind

ORACLE執行定時任務

這pl sql中,進入command介面,執行如下語句即可 var job num number begin dbms job.submit job num,sp test sysdate,sysdate 1 24 60 60 true end 貌似時間間隔最少是5秒。引數說明 job num 返回...

ORACLE建立定時任務及定時任務不執行的原因

1 首先建立一張表 該錶用來執行插入資料。create table getsysdate test date 2 建立儲存過程以插入資料。create or replace procedure insertsysdate as begin insert into getsysdate values ...

ORACLE 定時任務沒有執行 解決

查詢 select value from v parameter where name like job queue processes 看看值是多少?下面是11g reference的描述 job queue processes 指定可以為執行dbms job作業和oracle scheduler...