linux 杀掉 oracle进程有什么影响

2025-01-20 18:27:38
推荐回答(1个)
回答1:

1.第一步:使用Linux的kill命令杀死所有与oracle有关的进程。
1)查询到与ORACLE_SID相关的oracle进程
$ 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命令得到我们关心的进程号
$ 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)万事俱备,我们最后使用kill命令将oracle的进程杀死,因此得到了下面完整的命令
$ ps -ef |grep $ORACLE_SID |grep -v grep|awk '{print $2}' | xargs kill -9

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