Need past sessions information

Hi,
One of our db server is high on CPU usage on every day mid night, as per the AWR reports I found a couple of queries which are consuming high cpu during that time, if I look for the sessions as per the sql_id there are many sessions are there, I am not sure these are the sessions which were running these queries.
can we get the session information from AWR?( I dont think so)
Is sql_id is unique or will it changes time to time? if it is unique then am I getting the correct sessions?
Application team asking that from which user these are running, they are looking for the details like username, osusername, logontime,etc.
can somebody please help me that how can I get the past session information as per sql id?
we are on oracle 10G.
Regards,
Ramesh

Hi,
You can start looking out using dba_hist_active_sess_history view where you can provide the snap_id or the sample_time for the period you want to check. For an example you can check
http://aprakash.wordpress.com/2011/09/20/single-task-message-and-cursorpin-s-wait-on-x/
Anand

Similar Messages

  • Getting session information in servlet?

    In Apache SOAP, org.apache.soap.rpc.SOAPContext can be used as a parameter to get at session data in your servlet. The JDeveloper web services publishing wizard won't expose a method with this parameter, saying that the XML Schema mapping and/or serializer is not specified. Is there an OC4J equivalent to get at session information?

    Hi.
    Most definitely possible. A few months ago I coded something very similar - jsp
    form, submit to a servlet. I needed to get and set session info in both the
    servlet and jsp. The code was very basic (ie no tricks involved) and worked
    well. FWIW both my servlet and jsp were in the same webapp.
    Good luck,
    Michael
    PeterH wrote:
    Howdy.
    re meant something else
    That's what I'm trying to figure out. :>
    re what do I mean by...
    I have one jsp page, that has a an html form on it with elements that get
    passed to a servlet through a submit button on the form. I would like to be
    able to get information about the session from within the servlet. Is that
    possible?
    Let me know if I'm not explaining myself properly and you need more info.
    I'm relatively new to this stuff. But I'm learning! :>>>>
    Thanks for your reply.
    <[email protected]> wrote in message news:[email protected]..
    Hrm. Whoever told you this probably meant something else. What do you mean
    by a 'servlet being called from a jsp' ?
    PeterH <!REMOVEBeforeSending![email protected]> wrote:
    I was told today when using a servlet within a web app (being called
    from a
    jsp), you do not have access to the session object. Is that true?Short of
    passing session attributes via the servlet call, how can you access the
    session information?
    Thanks for any ideas.--
    Dimitri
    Michael Young
    Developer Relations Engineer
    BEA Support

  • Want to see session information through coherence console

    I use coherence*web to push the http session information in,and I changed the coherence.cmd to let the configuration point to session-cache-config.xml
    which is like:
    set java_opts=-Xms%memory% -Xmx%memory% -Dtangosol.coherence.distributed.localstorage=%storage_enabled% -Dtangosol.coherence.cacheconfig=session-cache-config.xml %jmxproperties%
    %java_exec% -server -showversion %java_opts% -cp "%coherence_home%\lib\coherence.jar;E:\coherence-java-3.7.1.0b27797\coherence\lib\coherence-web.jar;E:\wls12c\oepe_12.1.1.0.0\plugins\javax.servlet_2.5.0.v201103041518.jar" com.tangosol.net.CacheFactory %1
    when I start coherence.cmd and change to session-storage, I want to list the data,but get the nullpoint exception:
    Map (session-storage): list
    2012-06-08 13:34:38.675/11.309 Oracle Coherence GE 3.7.1.0 <Error> (thread=main,
    member=5):
    java.lang.NullPointerException
    at com.tangosol.coherence.servlet.AbstractHttpSessionModel.readAttribute
    s(AbstractHttpSessionModel.java:1809)
    at com.tangosol.coherence.servlet.AbstractHttpSessionModel.readExternal(
    AbstractHttpSessionModel.java:1735)
    at com.tangosol.util.ExternalizableHelper.readExternalizableLite(Externa
    lizableHelper.java:2041)
    at com.tangosol.util.ExternalizableHelper.readObjectInternal(Externaliza
    bleHelper.java:2345)
    at com.tangosol.util.ExternalizableHelper.deserializeInternal(Externaliz
    ableHelper.java:2746)
    at com.tangosol.util.ExternalizableHelper.fromBinary(ExternalizableHelpe
    r.java:262)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.g
    rid.partitionedService.PartitionedCache$ConverterFromBinary.convert(PartitionedC
    ache.CDB:4)
    at com.tangosol.util.ConverterCollections$AbstractConverterEntry.getValu
    e(ConverterCollections.java:3548)
    at com.tangosol.coherence.component.application.console.Coherence.doList
    (Coherence.CDB:83)
    at com.tangosol.coherence.component.application.console.Coherence.proces
    sCommand(Coherence.CDB:450)
    at com.tangosol.coherence.component.application.console.Coherence.run(Co
    herence.CDB:37)
    at com.tangosol.coherence.component.application.console.Coherence.main(C
    oherence.CDB:3)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.tangosol.net.CacheFactory.main(CacheFactory.java:827)
    Map (session-storage):
    Anyone have some experiences and can give me some suggestion?
    I do not want to use the httpsession language in jsp, and I just want to use API to access the hpptsession information.
    Thanks a lot!

    Sharing the information directly by accessing the caches will be a bit difficult, because the data format for the session is highly optimized. For example, large attributes are often split out separate from the bulk of the "core" session data, to make moving the session around the network more efficient. What may be the simplest solution (depending on the application's needs) is to use a "back channel" from the ASP.NET application to the Java EE application, for example over REST. This would be a reasonable approach if there are a few items that you want to access and/or update in the session.
    On the Java side, you can "get" a session using the HttpSessionContext interface, but you have to explicitly enable that feature (because it was deprecated in Servlet 2.1):
    public HttpSession getSession(String sId)To enable the feature, you have to set the coherence-enable-sessioncontext property to true. This property is in the XML configuration file that is added to the WAR by Coherence*Web install (WebPluginInstaller) step. I'm not sure how this gets set up in WebLogic (since there is no separate "install" step), but it should still be supported.
    Is this what you were looking for?
    Peace,
    Cameron.

  • Accessing client session information in ejb

    Hi!
    My prblem is the following. We want to access ejb from a servlet. We need some client session information in ejb (e.g. client username, client terminal name, client ip address) for several reason. Could anybody suggest a solution other than passing all the data through the parameter list of every method?
    Thanks for any help.
    Zoltan

    If you use stateful session bean, you can pass this information, when you create it.

  • I need send session between web1 to web2

    I have "web1(http:// localhost /web1)" and "web2(http:// localhost /web2)" but I need send session from web1 to web2.
    I try to use "sessionstate" in "web.config" with "mode=SQLServer" and "mode=StateServer" that not complete. because I get
    error is "Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode".
    So I need to any method for send session from "web1" to "web2" and then I necesary remain original value in session.
    My environment. C#.net 4.0, SQL Server 2008, IIS 7.5
    Thank you everybody for interest.

    You can send session objects  between Web forms and that's it. TestSimpleObject  in the below link could be a session object that could be passed around in session to other forms.
    http://msdn.microsoft.com/en-us/library/system.serializableattribute(v=vs.110).aspx
    I try to use "sessionstate" in "web.config" with "mode=SQLServer" and "mode=StateServer" that not complete. because I get error is "Unable to serialize the session state. In 'StateServer' and 'SQLServer'
    mode".
    I kind of doubt that you have obtained the knlowledge/information needed on how to make a ASP.NET state server database  on MS SQL Server for ASP.NET solutions running on IIS that are using MS SQL Server as session state server.
    If you did know how to do that, then any object that you were keeping in session state would have to be marked with the [Serializable] attribute like you see it being done with TestSimpleObject  in the above link to that ASP.NET by itself would serialize
    the object and send it to State Server database on MS SQL Server. ASP.NET would deserializ the object and retrive it when its needed.
    The  mode should be mode=InProc, and you need to forget about using MS SQL Server as an ASP.NET session state server.

  • My session has timed out and i need the session always active

    Hi all.
    I need a session whit never becomes timout but when I set de MaxInactiveInterval with
    a negative value (session.setMaxInactiveInterval(-1) ) the session becomes timeout in
    about 30 minutes or less, anybody can tell me why or the possible cuases of this
    I am working in IBM WebSphere Aplication Server.
    Thanks, for your time
    Outis.
    P.D. sorry for my english

    Note that the timeout is maintained on the server and is not the same as the cookie expiration date which is sent to the client. set the Session Timeout in IBM Websphere to 0.

  • Single Sign-On and session information

    I have an Oracle Portal application with many Java Web Applications. I wish to
    provide Single Sign-On to this applications. I know how to configure Single
    Sign-On and how to get the user login in Java. I want to store session
    information such as: User First and Last Name, User Social Security Number. I
    want to get this information from the database after authentication, store it
    in session and then access this information from all my applications.

    Are you familiarized with sys_context function?
    Hope this is useful help.
    BR,
    Marcos

  • Since switching to Yosemite, I am unable to paste any information into calendar events, instead having to type out all info such as location, notes, etc.  This is true both in daily view and weekly/monthly views as well.  Help?

    Since switching to Yosemite, I am unable to paste any information into calendar events, instead having to type out all info such as location, notes, etc.  This is true both in daily view and weekly/monthly views as well.  Help?

    You welcome

  • TIPS(16) : PROVIDING USERS WITH SESSION INFORMATION

    제품 : SQL*PLUS
    작성날짜 : 1996-11-12
    TIPS(16) : Providing Users with Session Information
    ===================================================
    rem
    rem orasessn.sql
    rem
    rem
    rem This script is used to provide users with information regarding their
    rem oracle sessions.
    rem The USER_SESSION view provides information related only to the
    rem current session for a user; while the ALL_SESSIONS relates to all
    rem sessions within the database for a user.
    rem The DBA_SESSION can only be viewed by the
    rem Oracle sys id (and anyone granted select on this view).
    rem The DBA_SESSION lists all oracle sessions excluding the Oracle
    rem generic processes (dbwr, pmon, smon, etc.).
    rem The SID and SERIAL# can be used with killing sessions.
    This script must be run from the Oracle sys id.
    rem --------------------------------------------------------------------------
    rem
    set echo on;
    spool orasessn;
    rem
    drop public synonym ALL_SESSIONS;
    create or replace view ALL_SESSIONS
    (USERNAME, OS_USER, SID, SERIAL#, STATUS, SERVICE, DATABASE,
    CURSORS, MACHINE, TERMINAL, PROGRAM)
    as
    select substr(v1.username,1,20), substr(v1.osuser,1,12),
    to_char(v1.sid,'999'), to_char(v1.serial#,'999999'),
    v1.status, v1.server, substr(v3.value,1,10), v2.value,
    substr(v1.machine,1,15), v1.terminal, v1.program
    from v$session v1, v$sesstat v2, v$parameter v3
    where v1.username = user
    and v2.sid = v1.sid
    and v2.statistic# = 3
    and v3.name = 'db_name' ;
    grant select on ALL_SESSIONS to PUBLIC;
    create public synonym ALL_SESSIONS for ALL_SESSIONS;
    rem
    drop public synonym USER_SESSIONS;
    create or replace view USER_SESSIONS
    (USERNAME, OS_USER, SID, SERIAL#, STATUS, SERVICE, DATABASE,
    CURSORS, MACHINE, TERMINAL, PROGRAM)
    as
    select substr(v1.username,1,20), substr(v1.osuser,1,12),
    to_char(v1.sid,'999'), to_char(v1.serial#,'999999'),
    v1.status, v1.server, substr(v3.value,1,10), v2.value,
    substr(v1.machine,1,15), v1.terminal, v1.program
    from v$session v1, v$sesstat v2, v$parameter v3
    where v1.audsid = userenv('SESSIONID')
    and v2.sid = v1.sid
    and v2.statistic# = 3
    and v3.name = 'db_name' ;
    grant select on USER_SESSIONS to PUBLIC;
    create public synonym USER_SESSIONS for USER_SESSIONS;
    rem
    create or replace view DBA_SESSIONS
    (USERNAME, OS_USER, SID, SERIAL#, STATUS, SERVICE, DATABASE,
    CURSORS, MACHINE, TERMINAL, PROGRAM)
    as
    select substr(v1.username,1,20), substr(v1.osuser,1,12),
    to_char(v1.sid,'999'), to_char(v1.serial#,'999999'),
    v1.status, v1.server, substr(v3.value,1,10), v2.value,
    substr(v1.machine,1,15), v1.terminal, v1.program
    from v$session v1, v$sesstat v2, v$parameter v3
    where v1.username is not null
    and v2.sid = v1.sid
    and v2.statistic# = 3
    and v3.name = 'db_name' ;
    rem -------------------------------------------------------------------
    spool off;

    제품 : SQL*PLUS
    작성날짜 : 1996-11-12
    TIPS(16) : Providing Users with Session Information
    ===================================================
    rem
    rem orasessn.sql
    rem
    rem
    rem This script is used to provide users with information regarding their
    rem oracle sessions.
    rem The USER_SESSION view provides information related only to the
    rem current session for a user; while the ALL_SESSIONS relates to all
    rem sessions within the database for a user.
    rem The DBA_SESSION can only be viewed by the
    rem Oracle sys id (and anyone granted select on this view).
    rem The DBA_SESSION lists all oracle sessions excluding the Oracle
    rem generic processes (dbwr, pmon, smon, etc.).
    rem The SID and SERIAL# can be used with killing sessions.
    This script must be run from the Oracle sys id.
    rem --------------------------------------------------------------------------
    rem
    set echo on;
    spool orasessn;
    rem
    drop public synonym ALL_SESSIONS;
    create or replace view ALL_SESSIONS
    (USERNAME, OS_USER, SID, SERIAL#, STATUS, SERVICE, DATABASE,
    CURSORS, MACHINE, TERMINAL, PROGRAM)
    as
    select substr(v1.username,1,20), substr(v1.osuser,1,12),
    to_char(v1.sid,'999'), to_char(v1.serial#,'999999'),
    v1.status, v1.server, substr(v3.value,1,10), v2.value,
    substr(v1.machine,1,15), v1.terminal, v1.program
    from v$session v1, v$sesstat v2, v$parameter v3
    where v1.username = user
    and v2.sid = v1.sid
    and v2.statistic# = 3
    and v3.name = 'db_name' ;
    grant select on ALL_SESSIONS to PUBLIC;
    create public synonym ALL_SESSIONS for ALL_SESSIONS;
    rem
    drop public synonym USER_SESSIONS;
    create or replace view USER_SESSIONS
    (USERNAME, OS_USER, SID, SERIAL#, STATUS, SERVICE, DATABASE,
    CURSORS, MACHINE, TERMINAL, PROGRAM)
    as
    select substr(v1.username,1,20), substr(v1.osuser,1,12),
    to_char(v1.sid,'999'), to_char(v1.serial#,'999999'),
    v1.status, v1.server, substr(v3.value,1,10), v2.value,
    substr(v1.machine,1,15), v1.terminal, v1.program
    from v$session v1, v$sesstat v2, v$parameter v3
    where v1.audsid = userenv('SESSIONID')
    and v2.sid = v1.sid
    and v2.statistic# = 3
    and v3.name = 'db_name' ;
    grant select on USER_SESSIONS to PUBLIC;
    create public synonym USER_SESSIONS for USER_SESSIONS;
    rem
    create or replace view DBA_SESSIONS
    (USERNAME, OS_USER, SID, SERIAL#, STATUS, SERVICE, DATABASE,
    CURSORS, MACHINE, TERMINAL, PROGRAM)
    as
    select substr(v1.username,1,20), substr(v1.osuser,1,12),
    to_char(v1.sid,'999'), to_char(v1.serial#,'999999'),
    v1.status, v1.server, substr(v3.value,1,10), v2.value,
    substr(v1.machine,1,15), v1.terminal, v1.program
    from v$session v1, v$sesstat v2, v$parameter v3
    where v1.username is not null
    and v2.sid = v1.sid
    and v2.statistic# = 3
    and v3.name = 'db_name' ;
    rem -------------------------------------------------------------------
    spool off;

  • How to get the complete sessions information ?

    Dear All,
    Can any one post a script to get complete sessions information.
    Thanks in advance

    Hi,
    The following script may help u on finding the active sessions on your Oracle database .
    SELECT SID,
    serial#,
    username,
    (SELECT holding_session
    FROM dba_waiters
    WHERE waiting_session = s.SID
    AND ROWNUM = 1
    AND holding_session NOT IN (SELECT waiting_session
    FROM dba_waiters))
    holding_session,
    DECODE (s.status,
    'ACTIVE', ROUND (last_call_et / 60),
    0
    ) time_min,
    DECODE (s.status,
    'ACTIVE', last_call_et,
    0
    ) time_sec,
    (SELECT used_urec
    FROM v$transaction t
    WHERE t.addr = s.taddr) undo_records,
    (SELECT ROUND (sl.sofar / sl.totalwork * 100, 2)
    FROM v$session_longops sl
    WHERE s.SID = sl.SID
    AND s.serial# = sl.serial#
    AND s.status = 'ACTIVE'
    AND sl.time_remaining > 0) progress,
    (SELECT event
    FROM v$session_wait w
    WHERE w.SID = s.SID) wait_event,
    (SELECT ROUND (VALUE / 1024 / 1024, 2) || 'M'
    FROM v$sesstat
    WHERE SID = s.SID
    AND statistic# = 20) pga_size,
    (SELECT ROUND (VALUE / 1024 / 1024, 2) || 'M'
    FROM v$sesstat
    WHERE SID = s.SID
    AND statistic# = 15) uga_size,
    (SELECT VALUE
    FROM v$sesstat
    WHERE SID = s.SID
    AND statistic# = 4) commits,
    (SELECT sql_text
    FROM v$sql t
    WHERE s.sql_address = t.address
    AND s.sql_hash_value = t.hash_value
    AND ROWNUM = 1) sql_used,
    (SELECT MESSAGE
    FROM v$session_longops sl
    WHERE s.SID = sl.SID
    AND s.serial# = sl.serial#
    AND s.status = 'ACTIVE'
    AND sl.time_remaining > 0) long_ops,
    (SELECT LOWER (ins.instance_name)
    || '_ora_'
    || LTRIM (TO_CHAR (a.spid))
    || '.trc' filename
    FROM v$process a
    WHERE a.addr = s.paddr) trace_file_name,
    resource_consumer_group,
    s.status,
    server,
    osuser,
    program,
    module,
    action,
    NVL (LOWER (s.machine), ins.host_name) machine
    FROM v$session s,
    v$instance ins
    WHERE username IS NOT NULL
    AND s.status = 'ACTIVE'
    AND s.audsid <> USERENV ('sessionid')
    ORDER BY DECODE (s.status,
    'ACTIVE', ROUND (last_call_et),
    0
    ) DESC
    Regards,
    Kumar
    [www.idatamax.com]

  • Passing session information to multiple JVM's

    Is it possible to pass session information to another JVM running on another server?
    Example:
    Server A calls a servlet on Server B. Will the session object (and values stored in it) created on Server A be accessible to Server B.

    DrClap wrote:
    No.This is not exactly true. If you're talking about a clustered app server implementation (for example, Weblogic supports clustering), where 'machine A' and 'machine B' are both part of the same cluster, then, generally speaking, yes, you're HttpSessions are distributed across those machines.
    God bless,
    -Toby Reyelts

  • OC4J session information with App Server Console

    Hello
    I have installed BI&Forms 10.1.2.0.2.
    I have an application deployed to that app server.
    I would like to see session information against that app, and to be able to clear sessions down.
    Can this be done with App server Console and how?
    Thanks
    Andy

    Fixed this. The ServerName param in httpd.conf was incorrect.

  • How can we share session information between browser and WebView

    Hi
    I have a web application which launches a instance of JavaFX web view on a click of a button. My issue is that when i launch this web view it creates a  new session of its own ,how can you transfer the session information of the parent (browser) to the web view.
    One of the solution i found was to add the JSESSION_ID cookie into the default(System-wide) cookie handler so it would override the existing cookie within the WebView cookiehandler.
    http headers - Setting a cookie using JavaFX&amp;#39;s WebEngine/WebView - Stack Overflow
    Are there any other solution for sharing session information between the web view instance and browser that launches it ?

    O.K. then, is it at least possible to access a wwsto_api_session
    from Java in the following way?
    Calling PL/SQL from Java
    JDBC and SQLJ allow you to call PL/SQL stored functions and
    procedures. For example, suppose you want to call the following
    stored function, which returns
    the balance of a specified bank account:
    FUNCTION balance (acct_id NUMBER) RETURN NUMBER IS
    acct_bal NUMBER;
    BEGIN
    SELECT bal INTO acct_bal FROM accts
    WHERE acct_no = acct_id;
    RETURN acct_bal;
    END;
    From a JDBC program, your call to the function balance might look
    like this:
    CallableStatement cstmt = conn.prepareCall("{? = CALL balance(?)}");
    cstmt.registerOutParameter(1, Types.FLOAT);
    cstmt.setInt(2, acctNo);
    cstmt.executeUpdate();
    float acctBal = cstmt.getFloat(1);

  • Historical Session information in Oracle 9i

    Hi All,
    I currently using Oracle 9i for one of my datawarehouse database. I would like to know how can I see historical session information like SID, Username, Program, Consumer CPU Time etc. My main aim is to get Consumed CPU Time for a particular user in a day. Please let me know how can I get this information.
    It is a bit important and urgent too.
    Thanks,
    Kalyan

    Oracle version 9i and earlier by default do not track session history information. The information you want for consumed CPU for a particual user for a specific day does not exist.
    You can capture some of the mentioned information via the supplied audit command and you could find some sample information in statspack snapshots if statspack has been configured.
    HTH -- Mark D Powell --

  • Just bought a new macbook pro. i need to transfer information from my old mac. help please?

    just bought a new macbook pro. i need to transfer information from my old mac. help please?

    Hi,
    See Here
    Transfer from Old  to New
    http://web.me.com/pondini/AppleTips/Setup.html

Maybe you are looking for

  • Screen ipad doesn't respond during video viewing home sharing with multiple iOS devices simultaneously

    A have a problem with the videos app and iTunes home sharing on multiple iOS devices. This is my setup. On my iMac 2006 with Snow Leopard I have: - 100+ dvd's ripped in my iTunes movie section - 600+ episodes ripped in iTunes TV-section in 35 TV-show

  • Illustrator CS5 - removing empty text boxes

    I've always found it difficult to select the type I want when I'm using the type tool to edit some text. I can click directly over the type but I guess I'm a zillionth of a pixel off because about half the time it assumes I want to make a new text bo

  • No new rows or columns because the axis is not input-ready

    Hi Gurus, I have a problem when I am modelling the Order and Revenue Planning. In my model I have Base Unit and Currency as Unit characterstics. When I take Currency as INR and Base Unit Multiple Values then I can create a new row in my planning layo

  • Java error when loading ZEN

    We were updating our 6.5.4 server to sp5. When it would lock up on the install every time. We called Novell the had us delete the dir "JAVA" and "JAVASAVE" The rerun the SP5. SP5 installed fine. How ever now we are having loading errors with ZEN. Her

  • HT201386 Why is iphoto not supporte by ios8 anymore??

    Why is iphoto not supported from ios8 anymore?! I put alot of work in slideshows and now i cant use them anymore?! That really makes me angry, why are u keep making it worse and more complicated than it already is with every new update!