Monday, July 24, 2023

Killing processes by process name

Killing processes by process name

In order to kill multiple processes by name template use the ps -ef|grep NAME_OF_PROCESS|grep -v grep| awk '{print $2}' | xargs kill

root[+ASM1]@yuzdc1-n-b00001 ~ # ps -ef|grep CDBAUX|grep -v grep
oracle 1325 1 0 May08 ? 00:00:08 ora_w00b_CDBAUX
oracle 12727 1 0 May07 ? 00:00:09 ora_w003_CDBAUX
oracle 13370 1 0 May08 ? 00:00:08 ora_w00a_CDBAUX
oracle 24014 1 0 May08 ? 00:00:08 ora_w007_CDBAUX
oracle 80734 1 0 May07 ? 00:00:33 ora_pmon_CDBAUXR1
oracle 80736 1 0 May07 ? 00:00:48 ora_psp0_CDBAUXR1
......
oracle 149625 1 0 May11 ? 00:02:32 ora_o001_CDBAUX
oracle 184346 1 0 May08 ? 00:00:09 ora_w008_CDBAUX
root[+ASM1]@yuzdc1-n-b00001 ~ # ps -ef|grep CDBAUX|grep -v grep| awk '{print $2}' | xargs kill
root[+ASM1]@yuzdc1-n-b00001 ~ # ps -ef|grep CDBAUX|grep -v grep

Saturday, February 18, 2023

Как быстро проверить лог и статус Oracle RMAN backup задач

Спасибо https://orahow.com/check-rman-log-file-and-status/

Steps to check the RMAN backup job details.

STEP 1:  To find the status of the jobs:

set lines 300
 col STATUS format a22
 col hrs format 999.99
 select
 SESSION_KEY, SESSION_RECID, SESSION_STAMP,INPUT_TYPE, STATUS,
 to_char(START_TIME,'mm/dd/yy hh24:mi') start_time,
 to_char(END_TIME,'mm/dd/yy hh24:mi')   end_time,
 elapsed_seconds/3600                   hrs
 from V$RMAN_BACKUP_JOB_DETAILS
 order by session_key;


STEP 2:  Check the % completed and more detailed information:

SELECT SID, SERIAL#, CONTEXT, SOFAR, TOTALWORK,
 ROUND (SOFAR/TOTALWORK*100, 2) "% COMPLETE"
 FROM V$SESSION_LONGOPS
 WHERE OPNAME LIKE 'RMAN%' AND OPNAME NOT LIKE '%aggregate%'
 AND TOTALWORK! = 0 AND SOFAR <> TOTALWORK;


 STEP 3: Check the logs or output of the running RMAN jobs 

set lines 200
 set pages 1000
 select output from GV$RMAN_OUTPUT
 where session_recid = &SESSION_RECID
 and session_stamp = &SESSION_STAMP
 order by recid;

NOTE: Please enter  SESSION_RECID  and  SESSION_STAMP  from the 1st query mentioned in step 1.