Find in this Blog

Sunday, November 1, 2015

ORACLE ACTIVE SESSION IN SAP BG JOBS!!! KILL SESSIONS

AVTIVEV$SESSOINS:
===================


SELECT s.sid,s.serial#,
       s.osuser,
       s.program,
       s.status,
       S.CLIENT_IDENTIFIER,
       S.CLIENT_INFO,
       S.MODULE,
       S.MACHINE,
       S.LOGON_TIME,
       S.STATE
FROM   v$session s
   WHERE TYPE = 'USER'
   AND AUDSID != USERENV('SESSIONID')
   and s.status='ACTIVE'
order by  s.osuser



OUTPUT:


SIDSERIAL#OSUSERPROGRAMSTATUSCLIENT_IDENTIFIERCLIENT_INFOMODULEMACHINELOGON_TIMESTATE
56657711PRODUCTION\SAPServiceGEPJDBC Thin ClientACTIVE  JDBC Thin ClientGEEPASAPL301-NOV-15WAITING


SQL> ALTER SYSTEM KILL SESSION '566,57711';


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


UPD-PROCESS-IN DATABASE:
============================


SELECT
   LAST_UPDATE_TIME, to_char(start_time,'hh24:mi:ss') stimeopname,message,( sofar/totalwork)* 100 percent, sofar,
   totalwork,
   time_remaining,
    units,sid,USERNAME
FROM
   v$session_longops
   order by 1, 4


OUTPUT:


LAST_UPDATE_TIMESTIMEOPNAMEMESSAGEPERCENTSOFARTOTALWORKTIME_REMAININGUNITSSIDUSERNAME
31-OCT-1517:56:23Table Scan:  SAPSR3.TBTCO: 115284 out of 115284 Blocks done1001152841152840Blocks134SAPSR3




ORACLE DATA FILE ALLOCATION( FOR SAP)
=======================================


SELECT SUBSTR (df.NAME, 1, 40) file_name, df.bytes / 1024 / 1024 allocated_mb,
((df.bytes / 1024 / 1024) - NVL (SUM (dfs.bytes) / 1024 / 1024, 0))
used_mb,
NVL (SUM (dfs.bytes) / 1024 / 1024, 0) free_space_mb
FROM v$datafile df, dba_free_space dfs
WHERE df.file# = dfs.file_id(+)
GROUP BY dfs.file_id, df.NAME, df.file#, df.bytes
ORDER BY file_name




TOP 10 ORACLE TABLE DETAILS:
====================================


SELECT * FROM(select SEGMENT_NAME,
    SEGMENT_TYPE,
    BYTES/1024/1024/1024 GB,
    TABLESPACE_NAME
from
    dba_segments
order by 3 desc
) WHERE
ROWNUM <= 10






Thanks
Yoonus