About pessimistick lock in Oracle

Hello,
I have some questions about pessimistick lock in Oracle:
I know if i do a SELECT..FOR UPDATE statement, those records are locked, and just me can opperate on them.. but me - WHO? How i'm identified in Oracle? If i do a SELECT..FOR UPDATE select in an A procedure, then i call the update procedure B, how can i know that both calls belongs to the same user? If someone tries to update the same records, how the server knows if that person is allowed to make those updates or not? because everyone uses the same connection string.. isn't it?
Probably it works if i make a SELECT..FOR UPDATE and i make the effective update in that procedure, but this means that the Business Logic is in that procedure..
Please correct me if i'm wrong somewhere and clarify me.
Thanks!

By default the other session has to wait (no error message):
From SQL Reference SELECT section: http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_10002.htm#SQLRF01702
>
NOWAIT | WAIT
The NOWAIT and WAIT clauses let you tell the database how to proceed if the SELECT statement attempts to lock a row that is locked by another user.
Specify NOWAIT to return control to you immediately if a lock exists.
Specify WAIT to instruct the database to wait integer seconds for the row to become available and then return control to you.
If you specify neither WAIT nor NOWAIT, then the database waits until the row is available and then returns the results of the SELECT statement.
>
Edited by: P. Forstmann on 7 janv. 2010 09:00
Edited by: P. Forstmann on 7 janv. 2010 09:01

Similar Messages

  • What is dead locks with oracle and wht is race condition wrt oracle

    what is dead locks with oracle and wht is race condition wrt oracle

    > And do you know what a race condition is all about?
    It is a term used to indicate several processes attempting to use the same resource that is not capable of servicing all these at the same time. This could be due to the resource not being thread safe or implemented as a serialised resource.
    It is often easy to look up definitions on Google. In the Google search field, type "define:race condition".
    The following [url http://www.google.co.za/search?hl=en&q=define%3Arace+condition&btnG=Google+Search&meta=]web definitions page is displayed.

  • What's the best approach for handeling about 1300 connections in Oracle.

    What's the best approach for handling about 1300 connections in Oracle 9i/10g through a Java application?
    1.Using separate schema s for various type users(We can store only relevant data with a particular schema.     Then No. of records per table can be reduced by replicating tables but we have to maintain all data with a another schema     Then we need update two schema s for a given session.Because we maintain separate scheama for a one user and another schema for all data and then there may be Updating problems)
    OR
    2. Using single schema for all users.
    Note: All users may access the same tables and there may be lot of records than previous case.
    What is the Best case.
    Please give Your valuable ideas

    It is a true but i want a solution from you all.I want you to tell me how to fix my friends car.

  • How to identify the locks in oracle db objects? i dont have access to check

    How to identify the locks in oracle db objects? i dont have access to check the v$lock or v$ objects. i dont have dba access. what are the symptoms for table, row or objects lock? how v guess it would be lock?
    Thanks in advance friends..

    I believe you will have to call your DBA on the phone in that case.
    You can query something with a select ... for update nowait.
    If it raises an exception you can handle it within a when section.
    -- Running in one session
    SQL> create table t1 as select 1 col1 from dual;
    Table created
    SQL> select * from t1 for update nowait;
          COL1
             1
    SQL>
    -- now running in a different session
    SQL> select * from t1 for update nowait;
    select * from t1 for update nowait
    ORA-00054: resource busy and acquire with NOWAIT specified
    SQL> set serveroutput on
    SQL>
    SQL> DECLARE
      2    CURSOR cur1 IS
      3      SELECT col1 FROM t1 FOR UPDATE NOWAIT;
      4    v_col1 NUMBER;
      5    locking_error EXCEPTION;
      6    PRAGMA EXCEPTION_INIT(locking_error, -00054);
      7  BEGIN
      8    OPEN cur1;
      9  EXCEPTION
    10    WHEN locking_error THEN
    11      dbms_output.put_line('Busted locking my rows!');
    12  END;
    13  /
    Busted locking my rows!
    PL/SQL procedure successfully completed
    SQL> Now, surely you won't be able to tell anything else other than there was something locked there.
    But none of the details you would find in the views.

  • Locked the oracle User account

    How to know who(os Name/ User/ Locked Time) locked the oracle User account

    1) You didn't mention an Oracle version. If you're on 10.2, perhaps this discussion
    http://www.pythian.com/blogs/284/oracle-102-migrations-%E2%80%93-account-lockedtimed-and-failed_login_attempts
    would be interesting.
    2) DBA_USERS isn't going to tell you who caused the account to be locked. Just that it is locked and when it was locked.
    Justin

  • SAPR3 is keep on locking in Oracle

    Hi SAP gurus,
    we have just change our hostname. I already changed all necessary parameters. Now Im facing new problem.
    SAPR3 user is keep on locking in ORACLE every time I started MMC "ORA-28000: the account is locked".
    Please let me know what to do?
    Thanks in advance

    Hi,
    Delete OPS$ user from oracle  level,
         >Sql :  drop user "OPS$hostname\SIDADM" cascade;
         >Sql :  drop user "OPS$hostname\SAPSERVICESID" cascade;
    Then run oradbusr.sql from location where file available.
    After that , change password for SAPSR3 user. your problem will get resolve.
    Reply...
    Regards
    MLN

  • Documents about General ledger in oracle

    where i can find documentation about General ledger in oracle ?

    user649223 wrote:
    where i can find documentation about General ledger in oracle ?Applications Releases 11i and 12
    http://www.oracle.com/technology/documentation/applications.html

  • Is this producer-consumer scenario safe about dead-lock?

    Hi friends!
    I'm developing an application with a producer-consumer scenario. It produces a dead-lock 10% of times approx I execute it . I think the real reason of the crashing resides on the concurrency, because executing only the following code it gets the "main" waiting blocked during its execution after looping the do{...}while(true) sometimes. I've developed this code:
    public class CubbyHole
        private int nFinishedThreads;
        private int nTotalThreads;
        public CubbyHole(int TotalThreads)
            this.nTotalThreads = nTotalThreads;
            this.nFinishedThreads = 0;
        public synchronized void put()
            this.nFinishedThreads++;
        public synchronized void get()
            while(nFinishedThreads < nTotalThreads)
                try
                    wait();
                catch(InterruptedException ie){}
            notifyAll();
    //import java.util.Random;
    public class Producer implements Runnable
        private CubbyHole container;
        public Producer(CubbyHole container)
            this.container = container;
        public void run()
            System.out.println(Thread.currentThread().getName() + " has begun");
            try{
                Random rand = new Random();
                Thread.sleep(Math.abs(rand.nextInt()*10));
            catch(InterruptedException ie){}
            System.out.println(Thread.currentThread().getName() + " has finished");
            container.put();
    public class Consumer implements Runnable
        private CubbyHole container;
        public Consumer(CubbyHole container)
            this.container = container;      
        public void run()
            System.out.println(Thread.currentThread().getName() + "is waiting for all threads to be finished");
            container.get();
            System.out.println(Thread.currentThread().getName() + "says all threads have finished");
    public class Application
        public static void main(String Args[])
            do{
                int nThreads = 2;
                CubbyHole container = new CubbyHole(nThreads);
                Thread[] ProducersArray = new Thread[nThreads];
                for(int i=0; i<nThreads; i++)
                    ProducersArray=
    new Thread(
    new Producer(container));
    ProducersArray[i].start();
    Thread finalWait = new Thread( new Consumer(container));
    finalWait.start();
    try
    finalWait.join();
    catch(InterruptedException ie){}
    System.out.println("Application has finished correctly");
    while(true);
    Please, execute it and give me your results: is the "main" waiting blocked to you?
    Is this producer-consumer code safe about dead-lock?
    If the answer is no... Why is it waiting blocked?
    Thank you in advance.
    P.D. I'm spanish, so my english is horrible! I'm sorry!

    Thanks ejp:
    Moreover, I suppose nothing happens if I write notifyAll() in both methods, put() and get(). In fact this matters only if the producer overwrites the memory space where data is stored, which is not my case.
    Is this so?

  • Two basic questions about locks in Oracle.

    Hello,
    This is about 9i and onwards.
    I need to develop a comprehensive analysis of locks and waits and while doing so, following questions popped up.
    1) What is the difference between locks and waits?
    2) There is a DBA view called DBA_BLOCKERS. The standard Oracle documentation has only one line comment about this view i.e. "DBA_BLOCKER – Shows non-waiting sessions holding locks being waited-on by other sessions.
    My question is : Why would a non waiting session hold locks after all? I guess that automatically repeats the question #1 from above, What is the difference between "being waited on" v/s "holding locks with wait" and "holding locks without waits"?
    Thanks,
    R

    1) What is the difference between locks and waits? Lock - something you queue up to get and simply wait until it is available
    Waits - Waiting for a Specific event to happen before it can proceed.
    Re: Difference between a latch and a lock
    2) There is a DBA view called DBA_BLOCKERS. The standard Oracle documentation has only one line comment about this view i.e. "DBA_BLOCKER – Shows non->waiting sessions holding locks being waited-on by other sessions.DBA_BLOCKERS displays a session if it is not waiting for a locked object but is holding a lock on an object for which another session is waiting.
    HTH
    -Anantha

  • 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.

  • Security - Locking Down Oracle 9i

    Anyone,
    I have been asked by our auditors to lock down my Oracle environment by disabling the default accounts that are not needed.
    What User Accounts can I disable (Lock) and not break my Oracle environment?
    I am looking at the following:
    DBSNMP
    OUTLN
    WMSYS
    Will I break anything if I disable these accounts?
    Thanks in advance,
    Miller

    Hi
    DBSNMP User:
    For database event monitoring, it is recommended you use the pre-existing DBSNMP user account.The DBSNMP user is automatically created with each new database and is already used for basic monitoring such as checking database availability. When setting up the EM Event owner’s preferences for Preferred Credentials, specify DBSNMP as database credentials for all monitored databases. This account will be used by the agent for monitoring and historical data collection as well as by the OMS/Console for database browsing. The DBSNMP user has already been granted some basic privileges. However, if it is to be used for all database event monitoring, you will also need to grant:
    SELECT_CATALOG_ROLE role.
    OUTLN User:
    This user is used while using TKPROF utility
    select user# from sys.user$ where name = 'OUTLN'
    WMSYS: Don't know about this user.
    I suggest to remove only SCOTT user account, as this is a demo user account.
    Hope this was useful.
    Thank You

  • Question about Table Locks

    Hi All,
    Is there any Oracle defined table/place from where we can know the details about Tables that have been locked in the current session?
    Thank you.

    Hi ,
    To know which all objects are locked, you can use the below query :-
    COLUMN owner FORMAT A20
    COLUMN username FORMAT A20
    COLUMN object_owner FORMAT A20
    COLUMN object_name FORMAT A30
    COLUMN locked_mode FORMAT A15
    SELECT b.session_id AS sid,
           NVL(b.oracle_username, '(oracle)') AS username,
           a.owner AS object_owner,
           a.object_name,
           Decode(b.locked_mode, 0, 'None',
                                 1, 'Null (NULL)',
                                 2, 'Row-S (SS)',
                                 3, 'Row-X (SX)',
                                 4, 'Share (S)',
                                 5, 'S/Row-X (SSX)',
                                 6, 'Exclusive (X)',
                                 b.locked_mode) locked_mode,
           b.os_user_name
    FROM   dba_objects a,
           v$locked_object b
    WHERE  a.object_id = b.object_id
    ORDER BY 1, 2, 3, 4;Anand

  • Locking in oracle

    Here I inserted a single row in USA table. I know It will acquire a TX
    lock in LMODE 6 & TM lock on LMODE 3.
    And it would acquire all the child tables in TM LMODE 2.
    But I see a few tables acquired on TM LMODE 3, other than USA ?
    Why are few child tables inn LMODE 2 & few other in LMODE 3.
    I really appreciate all your help into this issue.
    Thanks
    Satish
    SQL>insert into COUNTRY values ( 'USA','XXX','XXX','XXX');
    SQL> select object_name,object_id from dba_objects where object_id=54808;
    object_name object_id
    USA 54808
    SQL> select * from v$lock where sid=797;
    ADDR KADDR SID TY ID1 ID2 LMODE REQUEST CTIME BLOCK
    76A65058 76A6516C 797 TX 327697 1053730 6 0 1053 0
    76930D20 76930D38 797 TM 42183 0 3 0 1053 0
    76930C7C 76930C94 797 TM 54595 0 3 0 1053 0
    76930BE8 76930C00 797 TM 94880 0 3 0 1053 0
    76930B54 76930B6C 797 TM 87295 0 2 0 1053 0
    76930AC0 76930AD8 797 TM 86821 0 2 0 1053 0
    76930A2C 76930A44 797 TM 82679 0 2 0 1053 0
    76930998 769309B0 797 TM 82662 0 2 0 1053 0
    76930904 7693091C 797 TM 81118 0 2 0 1053 0
    76930870 76930888 797 TM 66195 0 2 0 1053 0
    769307DC 769307F4 797 TM 64474 0 2 0 1053 0
    76930748 76930760 797 TM 60364 0 3 0 1053 0
    769306B4 769306CC 797 TM 58038 0 2 0 1053 0
    76930620 76930638 797 TM 57939 0 2 0 1053 0
    7693058C 769305A4 797 TM 54933 0 2 0 1053 0
    769304F8 76930510 797 TM 54913 0 2 0 1053 0
    76930464 7693047C 797 TM 54906 0 2 0 1053 0
    769303D0 769303E8 797 TM 54898 0 2 0 1053 0
    7693032C 76930344 797 TM 54890 0 2 0 1053 0
    76930298 769302B0 797 TM 54877 0 2 0 1053 0
    76930204 7693021C 797 TM 54869 0 2 0 1053 0
    76930170 76930188 797 TM 54831 0 2 0 1053 0
    769300DC 769300F4 797 TM 54822 0 2 0 1053 0
    76930048 76930060 797 TM 54820 0 2 0 1053 0
    7692FFB4 7692FFCC 797 TM 54818 0 2 0 1053 0
    7692FF20 7692FF38 797 TM 54808 0 3 0 1053 0
    7692FE8C 7692FEA4 797 TM 54799 0 2 0 1053 0
    7692FDF8 7692FE10 797 TM 54787 0 2 0 1053 0
    7692FD64 7692FD7C 797 TM 54783 0 2 0 1053 0
    7692FCD0 7692FCE8 797 TM 54774 0 2 0 1053 0
    7692FC3C 7692FC54 797 TM 54767 0 2 0 1053 0
    7692FBA8 7692FBC0 797 TM 54757 0 2 0 1053 0
    7692FB14 7692FB2C 797 TM 54751 0 2 0 1053 0
    7692FA80 7692FA98 797 TM 54594 0 2 0 1053 0
    34 rows selected.

    Hi,
    Up to the extent I know about locks, there are senarios where other than the liked tables will get the locks. it is the behavior of oracle that it will fetch the data in terms of blocks rather than a particular table, as the chunk has been moved to buffer it is obvious that it must be marked as to indicate it is in buffer. so these tables will get that lock status.

  • Questions About Chapter 2 in Oracle DB 10g: SQL Fundamentals II

    Hello,
    first of all i'm glad to be a member of your forum. I have joined a beginner Oracle Course: Intro to SQL. I'm facing some problems understanding some concepts in Chapter 2 of Oracle Database 10g: SQL Fundamentals II text book. I got about 15 questions. However, i will only ask two questions at first. Since i'm a newbie, please answer it in a simplistic form. Excuse me if you see grammatical mistakes.
    Dropping a column can take a while if the column has a large number of values. In this case it may be better to set it to be unused and drop it when the number of users on the system are fewer to avoid extended locks.
    Questions:
    "when the number of users on the system are fewer to avoid extended locks."
    1. Can you explain this to me please?! fewer than before? fewer than? What if users kept increasing during the years! then this "fewer" may not happen until the company collapse!
    2. Why do we need to use unused columns? When should we use unused columns?

    Great! .... I got more questions, i just do not want to open a new same thread. Thus, i will just post the questions in here and i hope i will get help from experts...Please bare with me guys...The questions are numbered, unnumbered parts are information that helps you understand my question.
    Note: just answer what you are willing to, one question or whatever you want. I'm not expecting to get all the answers from one member :)
    Thanks for understanding
    Page 2-7:
    Certain columns can never be dropped such as columns that form part of the partitioning
    key for a partitioned table or columns that form part of the primary key of an index- organized table.
    Questions:
    "columns that form part of the partitioning key for a partitioned table"
    *1. Do they mean one table can be split into two different storage? What is the thing that*
    link these both tables to make Oracle Server realize these two tables are actually one  table? Is is tablespace_name?
    "columns that form part of the primary key of an index-organized table."
    *2. Can you clarify the above sentence please*
    *3. If i have set of columns that has large amount of data, i rather set them unused then*
    drop them because the response time is going to be faster! I do not get it, can you
    explain please? What i know is drop drops the column and release the disk space whilst
    unused column make the columns useless and does not release disk space yet until we drop them, so
    drop column does it in one step unlike taking the unused column process. In brief, i would like to know
    why dropping unused columns that has large set of data is faster then dropping the column
    directly...
    Page 2-12
    4. ALTER TABLE emp2 ADD CONSTRAINT emp_dt_fk
    FOREIGN KEY (Department_id)
    REFERENCES departments ON DELETE CASCADE);
    The above query is written in text book. I think it should be written as
    ALTER TABLE emp2 ADD CONSTRAINT emp_dt_fk
    FOREIGN KEY (Department_id)
    REFERENCES departments(dept_id) ON DELETE CASCADE;
    Am i correct?
    *5. Can you tell me what deferring constraints is in one sentence please? Why do we need it? When do we need it in real-life?*
    *7. You can defer checking constraints for validity until the end of the transaction. A*
    constraint is deferred if the system checks that it is satisfied only on commit. If a
    deferred constraint is violated, then commit causes the transaction to roll back.
    I do not understand the above paragraph, please explain. What i know is "end of
    transaction" ends with ; or commit
    Page 2-18
    create table test1 (
    pk NUMBER PRIMARY KEY,
    fk NUMBER,
    col1 NUMBER,
    col2 NUMBER,
    CONSTRAINT fk_constraint FOREIGN KEY (fk) REFERENCES test1,
    CONSTRAINT ck1 CHECK (pk > 0 and col1 > 0),
    CONSTRAINT ck2 CHECK (col2 > 0) );
    -- "CONSTRAINT fk_constraint FOREIGN KEY (fk) REFERENCES test1"
    *8. This is wrong isn't it? It references to test1 but no column specified.*
    An error is returned for the following statements:
    ALTER TABLE test1 DROP (pk); -- pk is a parent key.
    *9. We can not drop it because we did not mention ON DELETE CASCADE. Am i right?*
    ALTER TABLE test1 DROP (col1) -- col1 is referenced by multicolumn constraint ck1.
    *10. I do not get it, can you explain please. col1 is not referenced, i see CHECK constraint is applied*
    but no references made. Secondly, is ck1 considered multicolumn because it check two columns?
    Or multicolumn here represents something else?
    ALTER TABLE emp2
    DROP COLUMN employee_id CASCADE CONSTRAINTS;
    *11. This drop employee_id column and all its child. Correct?*
    ALTER TABLE test1
    DROP (pk, fk, col1) CASCADE CONSTRAINTS;
    *12. This drops three columns and all its child if there are any. Correct?*
    *13. Then what's the difference between ON DELETE CASCADE and CASCADE CONSTRAINTS?*
    For example, What if employee_id in emp2 table definition does not have ON DELETE CASCADE,
    will CASCADE CONSTRAINTS work? Please explain...
    Page 2-22
    When you are expecting a large data load and want to speed the operation. You may want
    to disable the constraints while performing the load and then enable them, in which case
    having a unique index on the primary key will still cause the data to be verified during
    the load. So you can first create a nonunique index on the column designated as PRIMARY
    KEY, and then create the PRIMARY KEY column and specify that it should use the existing
    index.
    Example:
    1. create the table
    create table new_emp
    (employee_id number(6),
    first_name varchar2(10)
    2. create the index
    create index emp_id_idx2 on new_emp(employee_id);
    "You may want to disable the constraints while performing the load and then enable them"
    so i suggest to load all data i want into new_emp.
    3. create the primary key
    alter table new_emp ADD primary key (employee_id) USING index emp_id_idx2;
    What i understand is the following:
    If we want to load large data into the new_emp, its better to create the table without any
    constraints - in our case the constraint is primary key. After that, we create nonunique
    index points to employee_id and then load data into new_emp. Finally, specify employee_id
    as primary key using the nonunique index.
    *14. Is my explanation correct?*
    "in which case having a unique index on the primary key will still cause the data to be
    verified during the load."
    *15. Data to be verified against what? Is it to be verified whether its NULL or NOT NULL? I*
    know primary key does not take NULL and every value must be unique.
    After loading all data we want, what if i did
    "alter table new_emp ADD primary key (employee_id);"
    *16. Will i face any problems or inefficient process?*
    I do not think we need step two, we could do the following:
    1. create the table
    create table new_emp
    (employee_id number(6),
    first_name varchar2(10)
    "You may want to disable the constraints while performing the load and then enable them"
    so i suggest to load all data i want itno new_emp.
    2. create the primary key
    alter table new_emp ADD primary key (employee_id);
    *17. The above steps are as efficient as the three steps i mentioned above. The only difference*
    is we let index be created implicitly. Right? If no, why?
    Page 2-23
    CREATE INDEX upper_dept_name_idx ON dept2(UPPER(department_name));
    The following statement may use the index, but without the WHERE clause the
    Oracle server may perform a full table scan:
    select *
    from employees
    where UPPER(last_name) IS NOT NULL
    ORDER BY UPPER (last_name);
    "but without the WHERE clause the Oracle server may perform a full table scan"
    *18. The above query let oracle server perform full table scan anyway! Right? It has to go*
    through every field and check is it not null or not. I know we are using function-based
    index but there are alot of not null last_name! so oracle server must scan one by one. If
    we only had one not null field, then i would say Oracle server can point to that field
    immediately by the aid of function-based index we created above. Can you clarify please...
    Another related topic statement that i do not get it yet:
    "The oracle server treats indexes with columns marked DESC as function-based indexes."
    *19. The bove statements is so general. What if we have a column ordered by DESC order and we*
    did not create any function-based indexes, will statement be true?!
    Lets go back the above query:
    ORDER BY UPPER (last_name);
    *20. Its not DESC. To me, the above query does not flow with this statement "The oracle server treats*
    *indexes with columns marked DESC as function-based indexes."?*
    Page 2-27
    Regarding FLASHBACK TABLE, you can invoke a flashback table operation on one or more
    tables, even on tables in different schema. You specify the point in time to which you
    want to revert by providing a valid timestamp. By default, database triggers are disabled
    for all tables involved. You can override this default behavior by specifying the ENABLE
    TRIGGERS clause.
    "By default, database triggers are disabled for all tables involved. You can override this
    default behavior by specifying the ENABLE TRIGGERS clause."
    *21. What are database triggers?*
    *22. About External Tables. What are external tables? When is it used in real-life? Why do*
    we want External Tables?
    Page 2-30
    Oracle server provides two major access drivers for external tables. They are
    ORACLE_LOADER access driver and ORACLE_DATAPUMP access driver. ORACLE_DATAPUMP used to
    both import and export data using a platform-independent format.
    "platform-independent format."
    *23. What is the format? Is it .dat?*
    Page 2-35
    CREATE TABLE oldemp ( fname char(25), lname char(25) )
    ORGANIZATION EXTERNAL
    (TYPE ORACLE_LOADER
    DEFAULT DIRECTORY emp_dir
    ACCESS PARAMETERS
    (RECORDS DELIMINATED BT NEWLINE
    NOBADFILE
    NOLOGFILE
    FIELDS TERMINATED BY ',' (fname POSITION (1:20) CHAR, lname POSITION (22:41) CHAR)
    LOCATION ('emp.dat') )
    PARALLEL 5
    REJECT LIMIT 200;
    *24. Can you please explain the below part:*
    ACCESS PARAMETERS
    (RECORDS DELIMINATED BT NEWLINE
    NOBADFILE
    NOLOGFILE
    FIELDS TERMINATED BY ',' (fname POSITION (1:20) CHAR, lname POSITION (22:41) CHAR)
    *25. Can you please explain what is PARALLEL 5? and Why do we need it?*
    Again, any help is appreciated...
    Edited by: user11164565 on Jul 21, 2009 4:41 AM

  • Using OleDbDataAdapter Update with InsertCommands and getting blocking locks on Oracle table

    The following code snippet shows the use of OleDbDataAdapter with InsertCommands.  This code is producing many inserts on the Oracle table and is now suffering from contention... all on the same table.  How does the OleDbDataAdapter produce
    inserts from a dataset... what characteristics do these inserts inherent in terms of batch behavior... or do they naturally contend for the same resource. 
    oc.Open();
    for (int i = 0; i < xImageId.Count; i++)
    // Create the oracle adapter using a SQL which will not return any actual rows just the structure
    OleDbDataAdapter da =
       new OleDbDataAdapter("SELECT BUSINESS_UNIT, INVOICE, ASSIGNMENT_ID, END_DT, RI_TIMECARD_ID, IMAGE_ID, FILENAME, BARCODE_LABEL_ID, " +
       "DIRECT_INVOICING, EXCLUDE_FLG, DTTM_CREATED, DTTM_MODIFIED, IMAGE_DATA, PROCESS_INSTANCE FROM sysadm.PS_RI_INV_PDF_MERG WHERE 1 = 2", oc);
    // Create a data set
    DataSet ds = new DataSet("documents");
    da.Fill(ds, "documents");
    // Loop through invoices and write to oracle
    string[] sInvoices = invoiceNumber.Split(',');
    foreach (string sInvoice in sInvoices)
        // Create a data set row
        DataRow dr = ds.Tables["documents"].NewRow();
        ... map the data
        // Populate the dataset
        ds.Tables["documents"].Rows.Add(dr);
    // Create the insert command
    string insertCommandText =
        "INSERT /*+ append */ INTO PS_table " +
        "(SEQ_NBR, BUSINESS_UNIT, INVOICE, ASSIGNMENT_ID, END_DT, RI_TIMECARD_ID, IMAGE_ID, FILENAME, BARCODE_LABEL_ID, DIRECT_INVOICING, " +
        "EXCLUDE_FLG, DTTM_CREATED, DTTM_MODIFIED, IMAGE_DATA, PROCESS_INSTANCE) " +
        "VALUES (INV.nextval, :BUSINESS_UNIT, :INVOICE, :ASSIGNMENT_ID, :END_DT, :RI_TIMECARD_ID, :IMAGE_ID, :FILENAME,  " +
        ":BARCODE_LABEL_ID, :DIRECT_INVOICING, :EXCLUDE_FLG, :DTTM_CREATED, :DTTM_MODIFIED, :IMAGE_DATA, :PROCESS_INSTANCE)";
    // Add the insert command to the data adapter
    da.InsertCommand = new OleDbCommand(insertCommandText);
    da.InsertCommand.Connection = oc;
    // Add the params to the insert
    da.InsertCommand.Parameters.Add(":BUSINESS_UNIT", OleDbType.VarChar, 5, "BUSINESS_UNIT");
    da.InsertCommand.Parameters.Add(":INVOICE", OleDbType.VarChar, 22, "INVOICE");
    da.InsertCommand.Parameters.Add(":ASSIGNMENT_ID", OleDbType.VarChar, 15, "ASSIGNMENT_ID");
    da.InsertCommand.Parameters.Add(":END_DT", OleDbType.Date, 0, "END_DT");
    da.InsertCommand.Parameters.Add(":RI_TIMECARD_ID", OleDbType.VarChar, 10, "RI_TIMECARD_ID");
    da.InsertCommand.Parameters.Add(":IMAGE_ID", OleDbType.VarChar, 8, "IMAGE_ID");
    da.InsertCommand.Parameters.Add(":FILENAME", OleDbType.VarChar, 80, "FILENAME");
    da.InsertCommand.Parameters.Add(":BARCODE_LABEL_ID", OleDbType.VarChar, 18, "BARCODE_LABEL_ID");
    da.InsertCommand.Parameters.Add(":DIRECT_INVOICING", OleDbType.VarChar, 1, "DIRECT_INVOICING");
    da.InsertCommand.Parameters.Add(":EXCLUDE_FLG", OleDbType.VarChar, 1, "EXCLUDE_FLG");
    da.InsertCommand.Parameters.Add(":DTTM_CREATED", OleDbType.Date, 0, "DTTM_CREATED");
    da.InsertCommand.Parameters.Add(":DTTM_MODIFIED", OleDbType.Date, 0, "DTTM_MODIFIED");
    da.InsertCommand.Parameters.Add(":IMAGE_DATA", OleDbType.Binary, System.Convert.ToInt32(filedata.Length), "IMAGE_DATA");
    da.InsertCommand.Parameters.Add(":PROCESS_INSTANCE", OleDbType.VarChar, 10, "PROCESS_INSTANCE");
    // Update the table
    da.Update(ds, "documents");

    Here is what Oracle is showing as blocking locks and the SQL that has been identified with each of the SIDS.  Not sure why there is contention.  There are no triggers or joined tables in this piece of code.
    Here is the SQL all of the SIDs below are running:
    INSERT INTO sysadm.PS_RI_INV_PDF_MERG (SEQ_NBR, BUSINESS_UNIT, INVOICE, ASSIGNMENT_ID, END_DT, RI_TIMECARD_ID, IMAGE_ID, FILENAME, BARCODE_LABEL_ID, DIRECT_INVOICING, EXCLUDE_FLG, DTTM_CREATED, DTTM_MODIFIED, IMAGE_DATA, PROCESS_INSTANCE) VALUES (SYSADM.INV_PDF_MERG.nextval,
    :BUSINESS_UNIT, :INVOICE, :ASSIGNMENT_ID, :END_DT, :RI_TIMECARD_ID, :IMAGE_ID, :FILENAME, :BARCODE_LABEL_ID, :DIRECT_INVOICING, :EXCLUDE_FLG, :DTTM_CREATED, :DTTM_MODIFIED, :IMAGE_DATA, :PROCESS_INSTANCE)
    SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1 is blocking SID 1150 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1
    SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1 is blocking SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1
    SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1 is blocking SID 1156 (BTSUSER,biztprdi,BTSNTSvc64.exe) in instance FSLX3
    SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1 is blocking SID 6 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX2
    SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1 is blocking SID 1726 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX2
    SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1 is blocking SID 2016 (BTSUSER,biztprdi,BTSNTSvc64.exe) in instance FSLX2

Maybe you are looking for

  • How to save the pdf file or word doc into sap table

    Hi Expertu2019s    I have a pfd file in my presentation server .Now I want to save the pdf file into sap table using module pool program. Whenever i need, I want to open that file from the table and show it in the Screen. Please any one tell me how I

  • Different colored keyboards...

    I have a first gen MBP and I'm not a fan of the silver keyboard and was wondering if there was anywhere I could get a different colored keyboard. I know there are silcone covers and those stupid stick-on covers, I'm looking for the actual keyboard or

  • What is the best format for HDV video for a computer playback

    Hello guys, I have made a very nice HDV video and after the frustration and awful results with compression for SD DVD, I have decided just to export that video as a file, put that file on DVD, so people can just pop that DVD into their computers, cop

  • A Paticularly Bad iPod Connection Problem

    My ipod will not connect to my PC it shows up in windows explorer but when you click on it or rightclick it freezes the "explorer.exe" and i have to end its task..the ipod updater is the same way it freezes as soon as i plug in my ipod..or open it wi

  • IWeb generated MobileMe hosted site - Can I customize the URL?

    I hope that my question is worded properly. I am not at all a pro. The site was created using iWeb, but the URL http://web.me.com/[YourMemberName]/[SiteName] is not desirable as the member name has nothing to do with the content. Is it at all possibl