欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費電子書(shū)等14項超值服

開(kāi)通VIP
【Kill】?jì)蓷lLinux命令徹底殺死Oracle


這兩條命令的來(lái)由:
今天處理了三起Oracle數據庫無(wú)故無(wú)法登錄的問(wèn)題,無(wú)論你采取什么手段都無(wú)法登陸到Oracle的SQL*PLus中,更談不上故障排查了。
這種情況下有兩種選擇,第一種選擇是經(jīng)過(guò)一個(gè)較長(cháng)的時(shí)間來(lái)排查故障原因,另外一種方法是不惜一切代價(jià)啟動(dòng)數據庫以便盡快恢復生產(chǎn)。

如果是測試實(shí)驗環(huán)境可以使用第一種方法來(lái)完成,對于排查問(wèn)題的經(jīng)驗積累是有意的。
如果是生產(chǎn)環(huán)境,減少停機時(shí)間是最最至上的原則,所以我們只有不惜一切代價(jià)讓數據庫盡快恢復使用。

對于盡快恢復生產(chǎn)的方法主要也有兩種。
第一種不惜代價(jià)的方法是重啟服務(wù)器主機,徹底釋放一切資源,重新來(lái)過(guò),這種方法是有效的,不過(guò)停機時(shí)間還是有點(diǎn)長(cháng),而且技術(shù)含量比較低,所以不是很推薦使用這種超級“簡(jiǎn)單粗暴”的方法。
第二種方法就是我將要給大家展示的方法。

1.第一步:使用Linux的kill命令殺死所有與oracle有關(guān)的進(jìn)程。
1)查詢(xún)到與ORACLE_SID相關(guān)的oracle進(jìn)程
$ ps -ef |grep $ORACLE_SID
oracle    7776     1  0 22:51 ?        00:00:00 ora_pmon_ora10g
oracle    7778     1  0 22:51 ?        00:00:00 ora_psp0_ora10g
oracle    7780     1  0 22:51 ?        00:00:00 ora_mman_ora10g
oracle    7782     1  0 22:51 ?        00:00:00 ora_dbw0_ora10g
oracle    7784     1  0 22:51 ?        00:00:00 ora_dbw1_ora10g
oracle    7786     1  0 22:51 ?        00:00:00 ora_lgwr_ora10g
oracle    7788     1  0 22:51 ?        00:00:00 ora_ckpt_ora10g
oracle    7790     1  0 22:51 ?        00:00:00 ora_smon_ora10g
oracle    7792     1  0 22:51 ?        00:00:00 ora_reco_ora10g
oracle    7794     1  0 22:51 ?        00:00:00 ora_cjq0_ora10g
oracle    7796     1  0 22:51 ?        00:00:00 ora_mmon_ora10g
oracle    7798     1  0 22:51 ?        00:00:00 ora_mmnl_ora10g
oracle    7832     1  0 22:51 ?        00:00:00 ora_arc0_ora10g
oracle    7834     1  0 22:51 ?        00:00:00 ora_arc1_ora10g
oracle    7836     1  0 22:51 ?        00:00:00 ora_qmnc_ora10g
oracle    7842     1  0 22:51 ?        00:00:00 ora_q000_ora10g
oracle    7847     1  0 22:52 ?        00:00:00 ora_q001_ora10g
oracle    7951  7592  0 23:11 pts/2    00:00:00 grep ora10g

2)去除掉包含grep命令本身的記錄
$ ps -ef |grep $ORACLE_SID |grep -v grep
oracle    7776     1  0 22:51 ?        00:00:00 ora_pmon_ora10g
oracle    7778     1  0 22:51 ?        00:00:00 ora_psp0_ora10g
oracle    7780     1  0 22:51 ?        00:00:00 ora_mman_ora10g
oracle    7782     1  0 22:51 ?        00:00:00 ora_dbw0_ora10g
oracle    7784     1  0 22:51 ?        00:00:00 ora_dbw1_ora10g
oracle    7786     1  0 22:51 ?        00:00:00 ora_lgwr_ora10g
oracle    7788     1  0 22:51 ?        00:00:00 ora_ckpt_ora10g
oracle    7790     1  0 22:51 ?        00:00:00 ora_smon_ora10g
oracle    7792     1  0 22:51 ?        00:00:00 ora_reco_ora10g
oracle    7794     1  0 22:51 ?        00:00:00 ora_cjq0_ora10g
oracle    7796     1  0 22:51 ?        00:00:00 ora_mmon_ora10g
oracle    7798     1  0 22:51 ?        00:00:00 ora_mmnl_ora10g
oracle    7832     1  0 22:51 ?        00:00:00 ora_arc0_ora10g
oracle    7834     1  0 22:51 ?        00:00:00 ora_arc1_ora10g
oracle    7836     1  0 22:51 ?        00:00:00 ora_qmnc_ora10g
oracle    7842     1  0 22:51 ?        00:00:00 ora_q000_ora10g
oracle    7847     1  0 22:52 ?        00:00:00 ora_q001_ora10g

3)使用awk命令得到我們關(guān)心的進(jìn)程號
$ ps -ef |grep $ORACLE_SID |grep -v grep|awk '{print $2}'
7776
7778
7780
7782
7784
7786
7788
7790
7792
7794
7796
7798
7832
7834
7836
7842
7847

4)萬(wàn)事俱備,我們最后使用kill命令將oracle的進(jìn)程殺死,因此得到了下面完整的命令
$ ps -ef |grep $ORACLE_SID |grep -v grep|awk '{print $2}' | xargs kill -9

2.第二步:使用Linux的ipcs和ipcsrm命令釋放oracle占用的共享內存。
1)使用ipcs命令查看系統中共享內存使用情況
$ ipcs -m

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x00000000 32768      root      644        72         2          dest
0x00000000 65537      root      644        16384      2          dest
0x00000000 98306      root      644        280        2          dest
0x00000000 131075     root      644        790528     2          dest
0x00000000 163844     root      644        790528     2          dest
0x00000000 196613     root      644        790528     2          dest
0x00000000 327689     oracle    644        790528     2          dest
0x00000000 360458     oracle    644        790528     2          dest
0x00000000 393227     oracle    644        790528     2          dest
0xecc5fba0 786447     oracle    640        5370806272 30

2)使用grep命令過(guò)濾后得到與oracle相關(guān)的內容
$ ipcs -m | grep oracle
0x00000000 327689     oracle    644        790528     2          dest
0x00000000 360458     oracle    644        790528     2          dest
0x00000000 393227     oracle    644        790528     2          dest
0xecc5fba0 786447     oracle    640        5370806272 31

2)使用awk命令獲得上面我們關(guān)心的shmid字段內容
$ $ ipcs -m | grep oracle | awk '{print $2}'
327689
360458
393227
786447

3)最后使用ipcsrm命令釋放共享內存
$ ipcs -m | grep oracle | awk '{print $2}' | xargs ipcrm shm
resource(s) deleted

再次查看一下,此時(shí)共享內存已經(jīng)被釋放。
$ ipcs -m | grep oracle
0x00000000 327689     oracle    644        790528     2          dest
0x00000000 360458     oracle    644        790528     2          dest
0x00000000 393227     oracle    644        790528     2          dest
0x00000000 786447     oracle    640        5370806272 31         dest

3.此時(shí),我們便可以登錄到數據庫,最后啟動(dòng)數據庫恢復生產(chǎn)。

4.小結
這種方法相對也是比較“粗暴”的。不過(guò)在危難之時(shí)還是可以派上用場(chǎng)。
重點(diǎn)強調:
手工殺掉oracle進(jìn)程和手工釋放共享內存是非常危險的,不到萬(wàn)不得已,千萬(wàn)不要使用;
這里我給出的兩條極具殺傷力的命令,請不要輕易嘗試。

Good luck.

-- The End --
本站僅提供存儲服務(wù),所有內容均由用戶(hù)發(fā)布,如發(fā)現有害或侵權內容,請點(diǎn)擊舉報。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
Linux 系統命令精通指南
Tuxedo雜記
Linux共享內存的查看和刪除
[20191115]oracle實(shí)例占用內存計算.txt
ps | grep app 命令不顯示grep app本身進(jìn)程的幾種方式
ipcs命令
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導長(cháng)圖 關(guān)注 下載文章
綁定賬號成功
后續可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服

欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久