Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 4

===================================================================================

=============================
The process is still active. Please see details below.
#1 & #2 >> Current status of the process:
#3 >> Current SQL running by the process:
#6 >> Current elapsed time of the process:
#7 >> Run history of the process:
#4 & #5 >> There is no locking on the database.
OR There is locking occurring on the database.
===================================================================================
=============================
#1 sb11.sql (last portion) - CALOY

set lines 200


col PRCSNAME for a20
col RUNCNTLID for a35
col OPRID for a20
select prcsname, prcsinstance, runstatus, to_char(rundttm,'DD-MM-YY HH24:MI:SS') ,
runcntlid, OPRID
from psprcsrqst where prcsinstance in ('4813935')
and begindttm > sysdate-4;
===================================================================================
=============================
#2 v$session.sql - change "SID" or "ACTION" get on email

select SID, serial#, status, action from v$session where SID = 'SID'; -
TO GET PRCSINSTANCE
select SID, serial#, status, action from v$session where action = 'ACTION'; -
TO GET SID#

SELECT PID, SID, SERIAL#, CLIENT_INFO, STATUS, PRCSINSTANCE, PRCSNAME from


v$session where SID = '<SID>';

-- TO GET "SPID" of the process


set lines 200
col PRCSINSTANCE for a15
col client_info for a20
select p.spid PID,
s.sid,
s.serial#,
s.client_info,
s.status,
s.osuser,
substr(s.ACTION,1,20) prcsinstance,substr(module,1,12) prcsname
from v$session s, v$process p
where s.paddr = p.addr
and s.osuser is not null
and s.sid = &SID;
===================================================================================
=============================
#3 sqlsid.sql - enter "SID" to see SQL script running.

SELECT t.sql_text text


FROM v$session s, v$sqltext t
WHERE s.sql_hash_value = t.hash_value
AND s.sql_address = t.address
AND s.SID = &sql_sid
ORDER BY t.piece;
===================================================================================
=============================
#4
SQL> @view_locks.sql - must see "Not Blocking"
===================================================================================
=============================
#5
SQL> @lock_waits.sql - must see "No one
requesting locks held by others"
"PL/SQL
procedure successfully completed".
===================================================================================
=============================
#6 elapsed.sql - change prcsname & runctlid must see on the sb11.sql output

col BEGINDTTM for a30


col ENDDTTM for a30
set pages 999
col RUNCNTLID for a20
col PRCSNAME for a10
col PRCSTYPE for a20
set line 300
select begindttm,enddttm,prcsinstance,prcstype,prcsname,runstatus,runcntlid,
round((cast(nvl(enddttm,sysdate) as date) - cast(begindttm as date))*1440,2)
"elapsed_minutes"
from psprcsrqst where prcsname = '<PRCSNAME>'
--and enddttm > trunc(sysdate - 5)
and runcntlid='<RUNCNTLID>'
--and trunc(enddttm) = trunc(sysdate)
order by begindttm desc
/
===================================================================================
=============================
#7 run_history.sql - change prcsname & runctlid must see on the sb11.sql output

column "Elapsed Time (Min)" format a18


column "Run Control ID" format a25
column "Process Name" format a15
select prcsname "Process Name",
RUNCNTLID "Run Control ID",
decode(runstatus,1,'Cancel',
2,'Delete',
3,'Error',
4,'Hold',
5,'Queued',
6,'Initiated',
7,'Processing',
8,'Cancelled',
9,'Success',
10,'No Success',
11,'Posted',
12,'Not Posted',
13,'Resend',
14,'Posting',
15,'Generated') "Run Status",
to_char(begindttm,'MM-DD-YY HH24:MI:SS') "Begin Time",
to_char(enddttm,'MM-DD-YY HH24:MI:SS') "End Time",
nvl2(enddttm,to_char(((enddttm-begindttm)*24*60),'999,999,999.999'),'Running -'||
to_char(((sysdate-begindttm)*24*60),'9999.99')) "Elapsed Time (Min)",
PRCSINSTANCE
from psprcsrqst_archive
where begindttm>=sysdate-30
and prcsname='<PRCSNAME>'
and RUNCNTLID = '<RUNCNTLID>'
order by begindttm
/
===================================================================================
=============================
#8 sessio_io.sql - enter "SID" get it on email and {run 3 times to see running
changes}

select sess_io.sid,
sess_io.block_gets,
sess_io.consistent_gets,
sess_io.physical_reads,
sess_io.block_changes,
sess_io.consistent_changes
from v$sess_io sess_io, v$session sesion
where sesion.sid = sess_io.sid
and sesion.username is not null
and sess_io.sid = <SID>;
===================================================================================
=============================

Cancel ----------------------- 1

Not Successful --------------- 10

Posted ----------------------- 11

Unable to post --------------- 12

Resend ----------------------- 13

Posting ---------------------- 14

Content Generated ------------ 15

Pending ---------------------- 16

Success With Warning --------- 17

Blocked ---------------------- 18

Restart ---------------------- 19

Delete ----------------------- 2

Error ------------------------ 3

Hold ------------------------- 4

Queued ----------------------- 5

Initiated -------------------- 6

Processing ------------------- 7
Cancelled -------------------- 8

Success ---------------------- 9

===================================================================================
=============================

You might also like