Oracle Session

When I created a record (use insert... statement), but before issue a COMMIT, I immediately went to issue a Select statement. I can see the new record is there. (Of course, the other user can not "see" it, yet).
I believe the newly entered record, prior to the committing, is first written to a Redo log file. Now if I issue a select statement, my question is: How does it work?
I mean before the committing, it wil retrieve from the redo log file, while after the committing, it will retrieve from the Hard Disk? Is this correct? -- If so, since the Redo log file is loaded to the SGA, and shared by many sessions (users), how could it know the record (newly entered by me) is belong to my session, not others?)
Thanks to help
Scott

Scott, allowing for a couple exceptions Oracle does not read the redo log files during normal operations. After you perform an insert but before you issue a commit Oracle is reading the actual data block to fetch the row data. Other sessions know not to read the row due to the transaction information contained in the ITL (interested transaction list) within the block that controls access to rows in conjuction with the undo (rollback) data. In the case of an insert the rollback data is pretty much just the rowid of the row to be rolled back.
I suggest you see the Concepts manual. The chapters on the relationship of a block to an extent to a segment and on the read consistency model should be helpful for you understanding of this.
HTH -- Mark D Powell --

Similar Messages

  • Unit Testing and Oracle Sessions

    We have an issue regarding Oracle session and SQL Developer Unit Testing.
    Every time we run a Unit Test in SQLDeveloper a new Oracle session is created. When closing that Unit Test, the session, however, is not disconnected.
    And the only way to close that "Unit Test" session is to close SQLDeveloper.
    This is causing problems with the no. of sessions available to developers.
    Any help would be much appreciated.
    Subboss

    The focus of this forum is report design. The actual testing of reports would be subject to your own internal policies and procedures.
    Jason

  • Question about BC4J data tags, Oracle sessions and Locking!

    Hi ,
    I have seen numerous examples of JSPs using data tags and in all the examples the data tag for the application module has the "username" and "password" harcoded in it.
    My questions are:
    1) For a stateful application should we be including the username and password in every JSP page. I personally believe that we should not.
    2) If we have a username and password in every JSP page will it not start a new ORACLE user session and if so will it not cause locking problems?
    3) If we don't hard code the username and password in every JSP page, will it reuse the same ORACLE session ?
    4) How do we avoid locking problems when we use data tags?
    5)I can understand the inclusion of username and password in every JSP page if it is a stateless application but again Is there a way we can avoid hardcoding the username and password in every single page?
    I would appreciate if some one can let me know if any of my assumptions are incorrect.
    JDeveloper Team/Juan any advice?

    The username and password are optional. They can be provided via the connections.properties file. The multple entries for username and password don't mean that separate connection are made. The first time the ApplicationModule tag is encountered, your application instance is created. If you are running in reserved mode (look at your releasePageResources tag) the application instance is kept until your Http session times out. If you are running in Stateful or Stateless mode, you application instance is returned to the application pool and retrieved the next time you need an instance. Please refer to the application pool documentation and to the source in oracle\jbo\common\ampool provided in jbohtmlsrc.zip.

  • Web.Show_document and oracle session

    Hi,
    I am uploading a file on to Oracle Portal through web util. After this, I am calling the web.showdocument to view the uploaded file. But I am seeing only a blank page. This is the sequence flow.
    1. Forms call a procedure which will create a dummy record of the document to be uploaded. This insert is happening as an autonomous transaction.
    2. The Forms call webutil and uploads the document
    3. Then I am calling web.show_document to view the document. The browser is opening an empty page. But once I did an explicit commit, I can open and view the document successfully in the same way.
    I am using '_blank' option.
    So, what I infer from this is that web.show_document opens the browser with a new oracle session by passing authentication details internally. Is there any way view the document without doing an explicit commit?
    Thank you.
    Warm Regards,
    Raja.
    Message was edited by:
    Raja M

    Check
    [b]Mozilla Firefox Options
    File Types
    The Download Actions dialog, which can be opened by clicking the
    Manage... button, contains file types that you have downloaded.
    You can choose what Firefox should do when clicking on a specific
    file type by selecting the file type you want to modify and clicking the
    Change Action... button.

  • Old Oracle Session with Tomcat is not kiiling automatically

    Hi,
    I am facing a problem of increasing inactive oracle sessions with tomcat, Old Oracle sessions with tomcat are visible with new one.
    if somebaody did not restarted tomcat gracefully, then does Oracle keep the session connected or is there any way that whenever any one restarted tomcat abnormally, Oracle session can be killed.
    I had restart the database to kill session.

    Could you please tell me that where do i set this parameter in parameter file or sql net file and what is the recommended value, do you have any document on this.
    Another thing tomcat is in other server machine and my database is in different server machine, killing process in tomcat server machine manually may not kill linux process on oracle database machine and therefore oracle sessions are still there.
    Is it possible?
    Edited by: user605066 on 28-Aug-2008 04:59

  • Desktop Intelligence XI 3.1 in 3-tier mode and a lot of Oracle sessions

    Hi All,
    I wanted to set BusinessObjects Enterprise XI 3.1 for our customers (they use BOE XI R2 now).
    But I met with some problem for Desktop Intelligence in 3-tier mode (ZABO formerly).
    Configuration:
    BO Server: BusinessObjects Enterprise XI 3.1
    BO Client: Desktop Intelligence version 12.1.0.882
    BOE Connection Server: version 12.1.0.882 (2.0.0.29)
    Product database (Data Warehouse): Oracle Server 10g
    Database client: Oracle Client 10.2.0.1
    Connection type: http (J2EE Portal) u2013 Tomcat
    Customer DI Documents contain 10 queries on average.
    Problem:
    ConnectionServer create a session in Oracle FOR EACH QUERY from Desktop Intelligence document and BY EACH REFRESH.
    e.g.:
    30 users loaded any reports simultaneously and refresh theirs:
    30 users * 10 queries (per 1 doc on average) = 301 Oracle sessions !!! (300 for queries and 1 for connection)
    second refresh: 301 + 300 = 601 Oracle sessions
    third refresh: 601 + 300 = 901 Oracle sessions
    etc. while Oracle server is not down.
    For DI doc in 2-tier mode (client-server) u2013 only 1 sessionu2026
    Thanks.

    Look at the XI3.0 migration guide on that site.
    From page 333 onward some good info on the subject of calc. engine changes.

  • Oracle session Hangs while calling one package function

    Hi all,
    We are a facing a interesting scenario in our code. Consider that you have 2 pakcages(A,B). Ecah packages is having more than 5 functions in it.
    1. A.function1() makes a call to B.function1() - is working fine
    2 .B.function1() calls B.function2() - is working fine
    3. B.function2() calls A.function2() - oracle session hangs in this call.
    If I copy the scropt code from A.function2() and inline (put) it in B.function1() , the execution gets completed without an issue.
    If i run the A.function2() seperatly it works fine. Only calling from B package it is failing.
    If anyone knows the rooot cause of the issue, please let me know.
    Thanks and regards,
    Vijayaraja

    Do you have/use global variables?
    Moving code from one package to another doesn’t necessarily result in logically equivalent programs. In the version of your program which “hangs” you may have crafted an infinite loop. Instrument your code and see if you really stall or just keep going on forever.
    With this kind of cross-dependencies in your libraries you almost ask for trouble.

  • Java hibernate oracle sessions never get closed

    Hi all,
    I'm opening some Oracle sessions from a java-hibernate app. When a shutdown my java-hibernate the oracle sessions remain opened, even if the java process is not seen as running with "ps -fea | grep java".
    The problem is that this oracle sessions never die, they remain there and the only way to kill them is to either manually kill oracle process, or to restart the oracle instance or to restart the unix box where oracle resides.
    My java/hibernate app always close the session with a final statement in the source code, no matter what.
    Thanks in advanced.

    Hi all,
    I'm opening some Oracle sessions from a java-hibernate app. When a shutdown my java-hibernate the oracle sessions remain opened, even if the java process is not seen as running with "ps -fea | grep java".
    The problem is that this oracle sessions never die, they remain there and the only way to kill them is to either manually kill oracle process, or to restart the oracle instance or to restart the unix box where oracle resides.
    My java/hibernate app always close the session with a final statement in the source code, no matter what.
    Thanks in advanced.

  • How to kill concurrent request oracle session which is terminated

    Dear,
    In our production environment Concurrent request "Gather Schema Stats" was running 2 days. Hence we cancelled the request.
    Request completed as terminated status. Unfortunately the oracle session of that concurrent request went to "Killed" status. Still utilizing CPU resource.
    If we try, "alter system kill session 'SID,serial#';"
    it gives below message,
    ERROR at line 1:
    ORA-00031: session marked for kill
    Could you please provide steps to kill this oracle session.
    Instance detail:
    Oracle Applications R12.1
    Oracle database 11.1.0.7
    Thanks,
    ...basha
    Edited by: 913932 on Jun 25, 2012 2:32 AM

    In our production environment Concurrent request "Gather Schema Stats" was running 2 days. Hence we cancelled the request.
    Request completed as terminated status. Unfortunately the oracle session of that concurrent request went to "Killed" status. Still utilizing CPU resource.
    If we try, "alter system kill session 'SID,serial#';"
    it gives below message,
    ERROR at line 1:
    ORA-00031: session marked for killTry "alter system kill session 'SID,serial#' immediate".
    Could you please provide steps to kill this oracle session.Concurrent Processing - How to Find Database Session & Process Associated with a Concurrent Program Which is Currently Running. [ID 735119.1]
    Thanks,
    Hussein

  • JDeveloper Team: How Do I minimize the number of Oracle Sessions using Data Tags?

    I am trying to create a stateful application thru my JSP pages. Everytime there is a reference to the application module using the data tag, it looks like it creates a new Oracle Session. But thats not what I want to do.
    I have a module in which my first JSP page allows viewing of the data and in subsequent pages I allow insert, update, delete, commit etc.
    My Questions:
    1) The problem that I am encountering is that every new page that I go to creates a new Oracle session even though I specify the "Stateful" release mode.
    How do I avoid this?
    It looks like , if one browser user can potentially create 10-20 oracle sessions thru one module, imagine what the impact will be when we have hundreds of users.
    2) The sample JSP pages I saw has the username and password hard coded in it every time. Why? For a stateful application can I not specify the username and password just once and have the other JSP pages use the same userid and password.
    What are the pros and cons? I thought if I don't use the username and password in all the JSP pages then it probably will not create additional Oracle sessions but that is not true!!
    3) If it creates several Oracle sessions , will it not cause locking problems? If so, How do I minimize locking problems in a stateful application.
    JDeveloper Team Please advise!!
    AM I missing something? I would appreciate if someone can help me out!
    null

    Thanks a lot for the information. That thread was indeed very helpful. But it still didn't answer all my questions:
    1) In the thread you mentioned, it mostly talks about Web beans. In a jsp page (using Web bean) we need to first invoke setReleaseApplicationResources(true) and then invoke releaseApplicationResources().
    Does this apply to data tags? I mean I have a tag <jbo:ReleasePageResources releasemode="Stateful" />. Is this enough to release the application module back to the pool or do I have to have something equivalent of setReleaseApplicationResources(true)?
    2. In a stateful application, the state of an application is maintained between requests via a browser cookie. For each browser, you can have one state per application module class. I was attempting to run "several browser sessions from the same machine" and the end result was that I got errors and unpredictable results ie it returned me far fewer rows then I saw originally. Should I be actually be running the browser session from different machines?
    3. In JDeveloper Documentation (section About Application Module pooling) there is a note section : "If the application module is not recycled the data stays the same. However if the application module was recycled and then activated through a failover, the activation logic re-executes the view objects, so it may bring in more or less rows then originally seen by the clients due to any database updates that have occured."
    This is exactly what is happening to me? How do I get rid of this problem? I want to be able to see all the original rows + any new rows That have been committed. Please advise!
    4. Are the JDBC connections tied to application module instances? Is it one JDBC connection per application module instance? So, in a stateful JSP, if I end up using a different application I also get a different JDBC connection. IS this true?
    5. Does the no of application module instances depend on the no of available JDBC connections? Because it looks like if you set the max no of connections to "5" and set the max no of application module instances to "10", It will be able to instantiate only "5" application module instances due to the limitation set by connection pool.
    6. At times I get errors which indicates that the row in view object does not exist. Is this something familiar? Or is it the same problem that John discussed in his thread.
    Thanks in advance!

  • Crystal Subreport Oracle Session Problem

    dear all <br /><br />We are using Oracle 9i,Crystal Report 9 and Visual Basic 6 as FrontEnd <br />in which we are using RDC. We have limited sessions in Oracle and we <br />can&#39;t increase them. When we connect a simple report through set data <br />source method it doesn&#39;t occupy any oracle session, but when we use a <br />report in which have subreports,WE get null password given error.If we set connection properties. It takes sessions we just want to open <br />subreports without any extra session. I tried connection properties in <br />code, but it doesn&#39;t work. <br /><br /><br />warrm regards <br />Nikunj

    When you use the setdatasource method to pass a dataset to a report you won't see any additional oracle connections being used because the connection used to create the original recordset will be used. This is called the 'data push' method. When you run a report with sub-reports and you let the report 'pull' the data it will connect to the database and use an oracle connection. In the case of sub-reports I believe it may make one connection per sub-report.
    The way to get around this is to use the setdatasource method on the subreports aswell. If you decide to do this then you will want to uncheck "Verify Stored Procs" in the report designer settings. Are the subs using the same connection/tables as the main? Apparently, calling LogoffServer() helps, even tho LogonServer is not used. It is the main rpt that does not use an Oracle session using a RecordSet? (Push model). If so, use the same for subs, then only the code will connect, and build a recordset and the report will not need to connect at all.
    Rob Horne
    http://diamond.businessobjects.com/blog/10

  • Total CPU time consumed by all Oracle sessions combined.

    Hello, I need to summarise total cpu time consumbed by all active Oracle sessions and below is the query thta I could come up with.
    However the problem: even if I execute query in a miliseconds duration, the value of total cpu time is always changing for a given session. Hence, is the query below right?
    SELECT SUM( c.value)
    FROM V$SESSION a,
    v$sesstat c,
    v$statname d
    WHERE a.sid = c.sid
    and c.statistic# = d.statistic#
    AND d.name = 'CPU used by this session'
    AND a.status = 'ACTIVE';
    Thanks,
    R

    Your findings are correct - the statistics is changing all the time. I don't see what is the problem here, you just have to add the time stamp and then you can measure the difference between them.
    If you are on 10g or 11g version then I would suggest you to look at V$SESS_TIME_MODEL which also gives interesting aggregated data for session level and for the database level the V$SYS_TIME_MODEL is probable the thing you are looking for.
    SQL> select stat_name,value from v$sys_time_model where stat_name='DB CPU';
    STAT_NAME                                                             VALUE
    DB CPU                                                           2125109375But I would like to warn you that there are some anomalies with time measurement in the database. Consider the following case:
    SQL> create or replace function f_cpu( p number) return number is
      2  m_date date;
      3  begin
      4    for a in 1..p loop
      5       m_date := sysdate;
      6    end loop;
      7    return 0;
      8  end;
      9  /
    Function created.
    SQL> alter session set events '10046 trace name context forever, level 8';
    Session altered.
    SQL> set arraysize 1
    SQL> select f_cpu(300000) from dual connect by level <= 10;
    F_CPU(300000)
                0
                0
                0
                0
                0
                0
                0
                0
                0
                0
    10 rows selected.
    SQL> alter session set events '10046 trace name context off';
    Session altered.From the other session you run your statement which just looks for the CPU usage in the first session. You will see that the CPU time is increased all the time, not just after every fetch call, but also between them.
    Now comes the funny thing - the SQL_TRACE shows the following ( I have removed all wait events to get more clear picture for my purpose):
    PARSING IN CURSOR #4 len=53 dep=0 uid=88 oct=3 lid=88 tim=347421772231 hv=2194474452 ad='230f2310' sqlid='2m7v6ua1cu1fn'
    select f_cpu(300000) from dual connect by level <= 10
    END OF STMT
    PARSE #4:c=0,e=124,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,tim=347421772223
    EXEC #4:c=0,e=103,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,tim=347421772446
    FETCH #4:c=671875,e=588199,p=0,cr=0,cu=0,mis=0,r=1,dep=0,og=1,tim=347422360764
    FETCH #4:c=1437500,e=1282871,p=0,cr=0,cu=0,mis=0,r=2,dep=0,og=1,tim=347423644892
    FETCH #4:c=1156250,e=1182013,p=0,cr=0,cu=0,mis=0,r=2,dep=0,og=1,tim=347424827769
    FETCH #4:c=1234375,e=1181276,p=0,cr=0,cu=0,mis=0,r=2,dep=0,og=1,tim=347426009910
    FETCH #4:c=1187500,e=1179318,p=0,cr=0,cu=0,mis=0,r=2,dep=0,og=1,tim=347427190068
    FETCH #4:c=593750,e=593217,p=0,cr=0,cu=0,mis=0,r=1,dep=0,og=1,tim=347427784188In this output "c=" is CPU time in 0.000001s (microseconds) and "e=" is elapsed time. There are many rows where CPU time > elapsed time, what is a well known problem of reporting for CPU timing. This was a single session so this result is unrealistic: how one can use 1.43s CPU time in only 1.28s time.
    FETCH #4:c=1437500,e=1282871,p=0,cr=0,cu=0,mis=0,r=2,dep=0,og=1,tim=347423644892The CPU time is bigger than elapsed time - and you can probably notice as well that CPU time is rounded to 00,25,50,75 .
    There are some interesting problems with time measuring in Oracle and one can easily be caught in this trap. I have written a post about this in my blog: http://joze-senegacnik.blogspot.com/2009/12/measurement-error-in-trace-file.html
    HTH, Joze
    Co-author of the forthcoming book "Expert Oracle Practices"
    http://www.apress.com/book/view/9781430226680
    Oracle related blog: http://joze-senegacnik.blogspot.com/
    Blog about flying: http://jsenegacnik.blogspot.com/
    Blog about Building Ovens, Baking and Cooking: http://senegacnik.blogspot.com

  • How to kill oracle session?

    hi there,
    Aside from using tool like TOAD is there a syntax on how to kill oracle session?
    pls help.
    tnx...

    First findout the SID, Serial No for the Particular Session ( syntax is as follows )
    SELECT sid, serial#,osuser, program FROM v$session;
    (Killing the session on SQL Prompt)
    ALTER SYSTEM KILL SESSION 'sid,serial#';
    force to kill the session by adding IMMEDIATE
    ALTER SYSTEM KILL SESSION 'sid,serial#' IMMEDIATE;
    OS Oracle Kill Session
    First findout the SID, SPID for the Particular Session ( SQL syntax is as follows )
    SELECT s.sid,p.spid, s.osuser ,s.program
    FROM v$process p, v$session s
    WHERE p.addr = s.paddr;
    Windows OS Command for kill Session
    orakill SID SPID
    Regs,
    Naresh

  • Direct mapping of Siebel OM context to Oracle session attributes

    Hello all,
    I wonder if it is possible to direct map of Siebel OM context to Oracle session attributes. Have anyone experience on this? If yes in which version of Siebel? And if this is applicable then what about in case of using connection pooling? Is there any documentation?
    For example it would be very useful if we could have information about Siebel tasks in the fields of V$SESSION.
    Module = “BUSCOMP NAME”
    Action = “VIEWNAME”
    Client Info = “TASKID”, “SERVERNAME”, “USERID”, “COMPONENT NAME”
    Thank you,
    Peter

    Hi,
    Our Siebel profiling Tools do exactly what you want. They work on versions 7.7, 7.8, 8.0 and 8.1.
    Also, in Siebel 8.1 and above there is now a bind variable :1 that provides this context information.
    R
    Robert Ponder
    Lead Architect and Director
    Ponder Pro Serve
    cell: 770.490.2767
    fax: 770.412.8259
    email: [email protected]
    web: www.ponderproserve.com

  • Automatic setup of Oracle session parameter nls_sort?

    Hi,
    Is there a way to automatically set up the Oracle session parameter when connecting to Oracle?
    Much like the .profile file does when logging into Linux.
    The session parameter in question is nls_sort. It seems the only way to set nls_sort to BINARY_CI
    is to invoke the command after connection:
    alter session set nls_sort = 'BINARY_CI'.
    But if I am using third party jdbc connection that does not allow the insertion of the alter session command,
    I am out of luck. I cannot run the sort using case insensitive mode.
    Is there any other alternative that would enable BINARY_CI.
    I tried to put it in initXXX.ora, but it did not work.
    I appreciate the replies and helps.
    Andrew K

    user643072 wrote:
    Is there any other alternative that would enable BINARY_CI.
    I tried to put it in initXXX.ora, but it did not work.That's maybe because NLS_SORT is derived from NLS_LANGUAGE which is itself derived from NLS_LANG, client setting env variable.
    That means, to avoid to use a trigger, and to take in account your init.ora setting, you may need to change the client local settings.
    What is the NLS_LANG value of the client ?
    Nicolas.
    PS: sorry, didn't know what Werner explained earlier : "...because JDBC ignores NLS_LANG settings."
    Edited by: N. Gasparotto on Jun 2, 2009 9:33 PM

  • VPN SA rekey drops oracle sessions

    Hello
    We have had this issue for sometime now.  We have solved it for numerous sites with dedicated L2 connections but for some outstanding sites with s2s VPN tunnels (asa to asa) we still run into it.
    Basically when the VPN rekey's the SA (sametime everyday) all Oracle sessions are dropped.  The tunnel stays up and the user stays connected but the oracle sessions ALWAYS drops.  I cant for the life of me find a way to stop this from happening and it only happens with Oracle.   It happens to both remote vpn clients and vpn tunnels.
    Does anyone have any idea what I can do to pinpoint or log the problem from the ASA's?

    Hello,
    I have something similar with ica/metaframe connection.
    Any help will be appreciated.
    Regards
    Sent from Cisco Technical Support iPad App

Maybe you are looking for