Skip to main content

To kill the inactive forms and sessions

SELECT p.spid,s.process,s.status,s.machine,
to_char(s.logon_time,'mm-dd-yy hh24:mi:ss') Logon_Time,
s.last_call_et/3600 Last_Call_ET,
s.action,s.module,s.sid,s.serial#
FROM
V$SESSION s, V$PROCESS p
WHERE
s.paddr = p.addr
AND s.username IS NOT NULL
AND s.username = 'APPS'
AND s.osuser = 'applprod'
AND s.last_call_et/3600 > 1
and s.action like 'FRM%'
and s.status='INACTIVE' order by logon_time;


          database


Select
'alter system kill session '''||s.sid||','||s.serial#||''';',s.action
FROM
V$SESSION s, V$PROCESS p
WHERE
s.paddr = p.addr
AND s.username IS NOT NULL
AND s.username = 'APPS'
AND s.osuser = 'applprod'
AND s.last_call_et/3600 > 1
and s.action like 'FRM%'
and s.status='INACTIVE';

          Forms

             
SELECT
' '||s.machine||' kill -9 '||s.process, s.action
FROM
V$SESSION s, V$PROCESS p
WHERE
s.paddr = p.addr
AND s.username IS NOT NULL
AND s.username = 'APPS'
AND s.osuser = 'applprod'
AND s.last_call_et/3600 > 1
and s.action like 'FRM%'
and s.status='INACTIVE';

Comments

Popular posts from this blog

Changing National Character Set AL16UTF16 to UTF8

Changing National Character Set AL16UTF16 to UTF8 The national character set is used for data that is stored in table columns of the types NCHAR, NVARCHAR2, and NCLOB.  In contrast, the database character set is used for data stored in table columns of the types CHAR, VARCHAR2 and CLOB. Like the database character set, the national character set is defined when the database is initially created and can usually no longer be changed, at least not easily or without involving quite a lot of work (export, recreate database, import). Except when creating the database, where the national character set is defined explicitly, it can change implicitly even when upgrading the database from Oracle8i to Oracle9i (or Oracle10g). You require SYSDBA authorization to change the national character set. Changing the national character set means changing an Oracle Dictionary entry, but no data is changed.  $sqlplus /nolog SQL> CONNECT / AS SYSDBA SQL> Select property_...

RMAN Different errors and their Solution

RMAN Different errors and their Solution Backup Fails with Invalid RECID Error: RMAN-20035, RMAN-6038 When you attempt a backup and receive the following error messages: RMAN-3014: Implicit resync of recovery catalog failed RMAN-6038: Recovery catalog package detected an error RMAN-20035: Invalid high RECID error It indicates the control file and the recovery catalog is not synchronized. RMAN detects that the control file currently in use is older than the control file previously used to resynchronize. Cause: This due to any of the scenario you are restore a backup controlfile through a non-oracle mechanism and then open the database through Resetlogs option or making a copy of control file through operating system utility and trying the restore on new system through RNAN. You do not use catalog so RMAN does not get any information regarding this process.  The recovery catalog indicates that the highest RECID is 100, but the control file indicates that the highe...

How to Monitor RMAN Backup through SQL Query

To Monitor RMAN you can use OEM or any other tools such as "Quest Backup Report for Oracle". You can also used following Views in oracle 9i to check the RMAN backup status: v$rman_configuration v$backup_set v$backup_piece v$backup_spfile v$session_longops Script to check RMAN Configuration: SELECT  name "PARAMETERS", value "RMAN CONFIGURATION" FROM  v$rman_configuration ORDER BY name; PARAMETERS RMAN CONFIGURATION BACKUP OPTIMIZATION ON CHANNEL DEVICE TYPE DISK FORMAT   'H:\ORABACK\%U' CONTROLFILE AUTOBACKUP ON CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'H:\ORABACK\%F' DEFAULT DEVICE TYPE TO DISK RETENTION POLICY TO RECOVERY WINDOW OF 30 DAYS Script to List RMAN Backup Piece: SELECT bs.recid, DECODE(   bp.status, 'A', 'Available', 'D', 'De...