Skip to main content

Session Killer

I've been noticing lately that the database does not seem to be cleaning up after itself and the processes just keep climbing and climbing. Some sessions are more than two weeks old. I thought this was a bit weird and when our monitoring system started alerting to the number of sessions I realised there was a lot of dead session that are inactive but not being cleaned up. This is probably due to pooling and the way the DB is trying to save resources but in the EBS once a user closes a form they will not be using that session again. This sql give me the code to kill the session both in the DB as well as on the server itself:

select vp.SPID,vs.username, UPPER(vs.program) program, logon_time, 
       floor(vs.last_call_et / 60 ) min_inactive
       ,floor(vs.last_call_et / 60 /60 ) hr_inactive, vs.status, vs.status
       ,'alter system kill session '''||vs.sid||','||vs.serial#||''';'
       ,'kill -9 '||vp.SPID
from v$session vs, v$process vp
where vp.addr = vs.paddr
and floor(last_call_et / 60 / 60) > 8
and UPPER(vs.program) not LIKE 'ORACLE%'
order by last_call_et desc ;


Popular posts from this blog

Cancel or abort adop session

ADOP is in my opinion still pretty half baked. This is a critical tool that just isn't as intuitive as the old adpatch was. However we move with the times and get the hang of the new way of doing things. Along the way you might want to abort or cancel a patching cycling. With the two file systems and db editioning this can be a bit more to manage. I have learnt the hard way so you need to use the full cleanup after aborting a session.
adop phase=abort
adop phase=cleanup cleanup_mode=full

Creating new WLS domain ends with exit code 255

Cloning the instance I ran into this weird error. Was not sure what to do but after learning my lesson I dug through the error logs after seeing this in the adcfgclone log file.
START: Creating new WLS domain.
Running /u03/APPLYES/YES/fs2/FMW_Home/oracle_common/bin/ -javaHome /u03/APPLYES/YES/fs2/EBSapps/comn/util/jdk64 -al /u03/APPLYES/YES/fs2/EBSapps/comn/clone/FMW/WLS/EBSdomain.jar -tdl /u03/APPLYES/YES/fs2/FMW_Home/user_projects/domains/EBS_domain_YES -tmw /u03/APPLYES/YES/fs2/FMW_Home -mpl /u03/APPLYES/YES/fs2/EBSapps/comn/clone/FMW/WLS/plan/moveplan.xml -ldl /u03/APPLYES/YES/fs2/inst/apps/YES_erpapyes/admin/log/clone/wlsT2PApply -silent true -debug true -domainAdminPassword /u03/APPLYES/YES/fs2/EBSapps/comn/clone/FMW/tempinfo.txt
Script Executed in 1903 milliseconds, returning status 255
ERROR: Script failed, exit code 255

Dig a bit deeper into the log files
cd /u03/APPLYES/YES/fs2/inst/apps/YES_erpapyes/admin/log/clone/wlsT2PApply
cat CLONE2016-01-10_04-37-11PM.log

Failed to initialize the application 'EBSDataSource' due to error weblogic.application.ModuleException after FNDCPASS apps change

Started testing password changes in our clone environments. Weblogic seems to love throwing you curve balls and when I changes the apps password with the below:
I was not able to start the weblogic managed servers. A look in the log an I found this:

        at weblogic.jdbc.module.JDBCModule.prepare(
        at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(
        at weblogic.application.internal.flow.DeploymentCallbackFlow$
        at weblogic.application.utils.StateMachineDriver.nextState(
        at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(
        at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(
        at weblogic.application.internal.BaseDep…