Oracle入門教程:如何kill掉RMAN備份進程

來源:互聯網
上載者:User

題記:最近客戶的一套訂購資料庫經常會因為資料及業務壓力太大,在RMAN進行全備或是增備時,而此時業務有大量要處理時,系統資源就會被耗盡,會影響到業務的正常,所以常有時需要先終止掉RMAN備份,這裡提供了我在處理過程中的方法,希望大家喜歡!

本文的目的就是在緊急狀態下,需要立即終止進行中的RMAN備份進程。

(1)查看RMAN分配的各個通道的進程號
SQL> SELECT sid, spid, client_info 
     FROM v$process p, v$session s 
     WHERE p.addr = s.paddr 
     AND client_info LIKE '%rman%';
  
       SID SPID       CLIENT_INFO
---------- ------------------------ -------------------------
       525 26244      rman channel=t1
      1023 26245      rman channel=t2
       699 26246      rman channel=t3

 

(2)根據第(1)中得到的進程號,終止RMAN備份
註:這裡既要kill 掉RMAN備份指令碼的PID,www.bkjia.com 也要kill 掉RMAN中分配的各個通道的PID
subsdb1:~ # ps -ef | grep 26244
Oracle   26244 26224  7 17:12 ?        00:01:49 oraclesubsdb (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
root      9877  9603  0 17:34 pts/11   00:00:00 grep 26244
subsdb1:~ # kill -9 26244
subsdb1:~ # ps -ef | grep 26245
oracle   26245 26224  5 17:12 ?        00:01:13 oraclesubsdb (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
root      9968  9603  0 17:35 pts/11   00:00:00 grep 26245
subsdb1:~ # kill -9 26245
subsdb1:~ # ps -ef | grep 26246
oracle   26246 26224  4 17:12 ?        00:01:03 oraclesubsdb (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
root     10009  9603  0 17:35 pts/11   00:00:00 grep 26246
subsdb1:~ # kill -9 26246
subsdb1:~ # ps -ef | grep rman
oracle   26224 25962  0 17:11 pts/3    00:00:03 rman target / nocatalog
root     10061  9603  0 17:35 pts/11   00:00:00 grep rman
subsdb1:~ # kill -9 26224
subsdb1:~ # ps -ef | grep rman
root     10102  9603  0 17:36 pts/11   00:00:00 grep rman
subsdb1:~ # ps -ef | grep 26246
root     10213  9603  0 17:36 pts/11   00:00:00 grep 26246

此時RMAN備份操作已經被終止。查看(1)中的SQL語句時,結果為空白。

說明:如果單單kill掉RMAN的進程號,那麼RMAN備份並沒有停止,而是要連channel進程也一起掉才可以!

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.