Best way to update an OLTP table ?

Hi,
We have an OLTP table with huge data.
We need to update a status column from 'N' to 'Y' for almost 70% of rows based on some condition.
This table may be accessed by hundreds of sessions at a time.
So, what is the best way to do the same.
Rgds,
Rup

if someone is using the table, ddl cannot be done (or at least you would have to wait maybe a long time)
quick test...
SQL> create table bank
  2  (id number primary key
  3  ,acc number
  4  ,ind varchar2(1)
  5  )
  6  /
Table created.
SQL> insert into bank
  2  select rownum
  3       , rownum * 10
  4       , 'N'
  5    from all_objects
  6   where rownum <= 10
  7  /
10 rows created.
SQL> commit;
Commit complete.
SQL> update bank
  2     set acc = -10
  3   where id = 10
  4  /
1 row updated.new session
SQL> alter table bank
  2  add new_ind varchar2(1)
  3  /
alter table bank
ERROR at line 1:
ORA-00054: resource busy and acquire with NOWAIT specifiedwell, not a long time... but anyway you can't do ddl while someone is working on the table.

Similar Messages

  • Best way to update individual rows of a Table?

    I've taken a look at some examples, though haven't gotten any clarification on this.  I am looking to have something close to a listbox or table to where I can update just a single column of row values at a 1 time per second pace.  I am looking to display our data-acquisition values in a table or listbox.  The single listbox seemed to work good for this, but I was unable to use row headers to list the channel names next to the channel values.  I was thinking about connecting the cursor values of two list-boxes to do this, but didn't find any info on this for the single list-box.
    I have a few questions:
    1) I have a 1D array to where I want to use that array of data to constantly update the first column (with a multitude of rows) of a table.  I am looking for the best route so as not to take up too much processing time in doing this.
    What is the best way to update individual rows of a table?   Invoke Node "Set Cell Value" ... or is there another method?
    2) Why is it that after every other iteration the row values are erased? 
    Also, for adding additional strings to the original arrray ... is it best to use the "Array Subset" and then the "Build Array" function, or the "Array Subset" and "Insert Into Array" function?
    See the attached example.
    Thanks.
    Solved!
    Go to Solution.
    Attachments:
    Table Example.vi ‏19 KB

    Jeff·Þ·Bohrer wrote:
    2) Why is it that after every other iteration the row values are erased?
    Classic race condition.  dump the for loop and p-node and just wire the 2D array to the table terminal.!
    I'm not seeing the race condition.  What I am seeing is the table emptying after the last element was written to it on every other run.  I saw watched this with highlight execution on.
    But I'm in full agreement with just writing to the terminal.  It is a 1D array, so you will need to use a build array and transpose 2D array in order for it to write properly.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Best way to update RBSELBEST table for invoice

    what is the best way to update RBSELBEST table for PO invoice? Is there any BAPI or FM for this?

    Thanks. I tried this one also, but it does not update the table.
    in case if someone used this, what parameters i need to pass for this to work?

  • Best way to update custom table

    Hello experts,
    Iu2019m writing a report program and after pulling data from a custom table Iu2019m modifying certain fields within internal table and then eventually update custom table. The way Iu2019m updating custom table is working fine. However Iu2019m concern about performance issues because Iu2019m doing update on custom table within loop.
    Here is my code for reference.
    *&      Form  update_contracts
          text
    -->  p1        text
    <--  p2        text
    FORM update_contracts .
    Update record in an internal table first
      loop at izsc_compliance into wa_zsc_compliance..
        wa_zsc_compliance-zapproval = c_accepted.
        wa_zsc_compliance-CHANGED_DT = sy-datum.
        wa_zsc_compliance-CHANGED_TM = sy-uzeit.
        wa_zsc_compliance-CHANGED_BY = sy-uname.
        modify izsc_compliance from wa_zsc_compliance index sy-tabix.
        write:/ sy-tabix, wa_zsc_compliance-vbeln_new, wa_zsc_compliance-zapproval.
        if p_test is initial.
          move wa_zsc_compliance to zsc_compliance.
          update zsc_compliance.
        endif..
      endloop.
    Write records to database
      if p_test = 'X'.
        skip.
        write:/ 'Test mode'.
      endif.
    ENDFORM.                    " update_contracts
    Iu2019m not certain if there is any better way by not doing update within loop and update custom table outside this loop.
    Many thanks in advance.

    Hi,
    Yes, there is a better way to update the custom table. That will be more performance oriented and will be a much cleaner approach. As, I am not much aware of the custom table structure which you have in your program, the best way that I can suggest is to remove the update statement from that check. I guess you are checking against the mode - test or production. Once you have done the check, put the selected entries in an internal table which is same as database table. And then in a single command - a single array operation as it is commonly called, you can update the custom table.
    Have a look at the following link
    [Overwriting Several Lines Using an Internal Table|http://help.sap.com/saphelp_bw33/helpdata/en/fc/eb3a94358411d1829f0000e829fbfe/content.htm]
    [Inserting or Changing Lines|http://help.sap.com/saphelp_bw33/helpdata/en/fc/eb3ac8358411d1829f0000e829fbfe/content.htm]
    You can also scan the forum for multiple links and references and sample examples.
    Hope this will help. The above approach will be much more performance oriented and will help to optimize. Also, check where exactly you are providing the locking feature if at applicable in your business functionality.
    Regards,
    Samantak.

  • Best Way To Update Intersection Tables

    Hi,
    I'm surprised I haven't been able to find anything on this,
    but I was wondering if I could get some advice as to the most
    efficient way to update an intersection table, i.e. a M:N
    resolution table.
    My example...
    Say I have a M:N relationship between tables Cars and Colors.
    To resolve, I form table Cars_Colors with Car_ID and Color_ID as
    PFK's from their respective table.
    So on my form, say we're dealing with record "Ford Ranger,"
    I'll have a bunch of checkboxes with colors, in which multiple
    colors can be selected or de-selected. How should I handle this
    update?
    Currently, I just delete all the existing colors for the
    specific car, and then re-add the list of colors from the form...
    basically a delete then insert on the table... I don't use any
    update sql. But this is a nightmare when trying to keep audit
    history on data changes in the table.
    Any advice? Thanks in advance,
    Mark

    Thanks everyone for your help. Your code samples gave me the
    start to to get this working by using CF code that produced the
    following query in Oracle 8i:
    INSERT INTO Cars_Colors (Car_ID, Color_ID)
    SELECT 2, AA.iNewColorID
    FROM
    SELECT 1 AS iNewColorID FROM dual UNION
    SELECT 2 AS iNewColorID FROM dual UNION
    SELECT 4 AS iNewColorID FROM dual
    ) AA
    WHERE AA.iNewColorID not in (
    select color_id from cars_colors where car_id =2
    )

  • What is the best way to update an ALV tree?

    Hello all of you
    What is the best way to update an ALV tree?
    In my case, by double clicking on a branch, a table is updated and an icon should be updated in the alv tree.
    I use the class CL_SALV_TREE
    Thanks for your help

    Call method REFRESH!

  • Best way to deal with Mutating table exception with Row Level Triggers

    Hello,
    It seems to be that the best way to deal with Mutating Table exception(s) is to have to put all the trigger code in a package & use it in conjunction with a Statement level trigger .
    This sounds quite cumbersome to me . I wonder is there any alternative to dealing with Mutating table exceptions ?
    With Regards

    AskTom has a good article about this,
    http://asktom.oracle.com/tkyte/Mutate/index.html

  • Best way to update a solaris jumpstart OS image.

    Hi all,.
    Ive been recently building some v240's but have run into trouble with the rather out of date 02/02 instance of Solaris 8 (yes, i did say solaris 8 - it's a political thing..)
    Anyhow, I have cd images of Solaris 8 02/04 and have a copy of the Sun Blueprints Jumpstart book by "Howard and Noordergraph".
    On page 92, it says to use the "setup_install_server" script with the -b option for /jumpstart/OS/Solaris-xx-xx-xx.
    Ive done that without any probs, then it goes on to say if you want an install server do the same command again without the -b switch.
    Problem is that it spews out this message.
    733 root&#64;bbs00080 # ./setup_install_server -b /jumpstart/OS/Solaris_8_02-2004/
    Verifying target directory...
    setup_install_server:
    The target directory /jumpstart/OS/Solaris_8_02-2004/ is not empty. Please choose an empty
    directory or remove all files from the specified directory and run
    this program again.
    So i chose an empty directory and it goes and does it.
    Is this an errata?
    I already have /jumpstart/OS/Solaris_8_02-2002/ and I wanted to update the files so that I can boot the v240r.
    Except 02/02 doesnt let me do that as it doesnt support the v240r arch.
    Sun told me this, but I'm lost because my existing profile for this box, lists all the packages I want to install, but it whinges about not being able to find a .cdrom toc file.
    I already have three flash archives which i created from good builds from 02/02, in my rules file which work, but this pesky update for the 240r is getting to be a little tricky.
    So far, ive tried copying all the packages from 02/02/Products directory into 02/04/Products but some of them don't install despite being there.
    Can anyone suggest the best way to update my 02/02 with the 02/04 boot loader for the v240?
    Thanks in advance and sorry for any confusion.
    D.

    I'm sorry. I meant. Say my array of x positions is 3, 4, 9. I change 9 to 30. How can I make the polygon see that change?

  • Best way to outer join a table that is doing a sub query

    RDBMS : 11.1.0.7.0
    Hello,
    What is the best way to outer join a table that is doing a sub query? This is a common scenario in EBS for the date tracked tables.
    SELECT papf.full_name, fu.description
      FROM fnd_user fu
          ,per_all_people_f papf
    WHERE fu.user_id = 1772
       AND fu.employee_id = papf.person_id(+)
       AND papf.effective_start_date = (SELECT MAX( per1.effective_start_date )
                                          FROM per_all_people_f per1
                                         WHERE per1.person_id = papf.person_id)Output:
    No output produced because the outer join cannot be done on the sub queryIn this case I did a query in the FROM clause. Is this my best option?
    SELECT papf.full_name, fu.description
      FROM fnd_user fu
          ,(SELECT full_name, person_id
              FROM per_all_people_f papf
             WHERE papf.effective_start_date = (SELECT MAX( per1.effective_start_date )
                                                  FROM per_all_people_f per1
                                                 WHERE per1.person_id = papf.person_id)) papf
    WHERE fu.user_id = 1772
       AND fu.employee_id = papf.person_id(+)Output:
    FULL_NAME     DESCRIPTION
    {null}            John DoeThanks,
    --Johnnie                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Hi,
    BrendanP wrote:
    ... See the adjacent thread for the other with Row_Number().Do you mean {message:id=10564772} ? Which threads are adjacent is always changing. Post a link.
    I think RANK suits the requirements better than ROW_NUMBER:
    WITH    all_matches     AS
         SELECT  papf.full_name
         ,      fu.description
         ,     RANK () OVER ( PARTITION BY  papf.person_id
                               ORDER BY          papf.effective_start_date     DESC
                        )           AS r_num
         FROM             fnd_user             fu
         LEFT OUTER JOIN      per_all_people_f  papf  ON  fu.employee_id  = papf.person_id
         WHERE   fu.user_id  = 1772
    SELECT     full_name
    ,     description
    FROM     all_matches
    WHERE     r_num     = 1
    Johnnie: I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    See the forum FAQ {message:id=9360002}

  • Best way to update audio files in library

    I have quite a few audio files in the library for a Captivate project.  I just modifed a bunch of them, and I am wondering the best way to update the library.
    If I delete the files in the library, I lose all the links to which audio went with which slide.
    If I go into each slide and replace the audio, that is more time consuming, and still a problem when the old audio file is still in the library
    I don't see an option for directly replacing the audio in the library; if I put the new version (same name) it just adds it with a (2), i.e. audioclip and audioclip(2)
    The update option does not give me what I need, unless I am missing something.  First of all, I am using both a Windows computer at the client site, and my own Mac, so the paths are different.  To use the update I would have to update the path for each audio file, which is more trouble that updating every file manually.
    Any ideas?
    Thanks.

    Hi there,
    The recommended way is to go to that slide and import the slide audio again, new audio will replcae the old.
    Once you have replaced all the audios, the audio files that are not in use in the project will still show up in Library.
    You can get rid of all unused items from the library, by clicking on the icon for unused icon and then delete icon:
    Thanks.

  • Best way to update firmware?

    Hi everyone,
    I just wanted to ask you which is the best way to update the firmware for my phone?I mean with usb cable,FOTA etc.
    Thanks in advance!
    Regards 

    Nokia seems to be comitted to improve the user experience... Its really good to know that... They have to do it to survive... BTW Nokia N78 latest firm ware is a little better. The operations seems to be fast. 
    It has just been a day with the firmware.. So far no problem... I faced a few problems while updating the USB get disconnected when the update is about to begin... but the latest software update program has all required warning... It asked me to restart my pc and my cell phone... And try again ... I did it Alas it worked ... got it updated ...
    I found a few things new :
    The icons for videos (The one in old version was better) and search are all new.
    I am from india. I brought this phone seeing the FM transmitter option. But after i brought the phone i found it missing.
    But with this software update i got the option under the music menu :-) thanks a lot nokia.
    Few problems with the camera still remains... music volume has come down a bit... the gps seems to be working a little faster.

  • Best way to update DR database from PROD server automatic ?

    Hello Gurus,
    I want to decide best solution.
    Goal: Best way to update DR Database from PROD Server Database automatic.
    System: 32 bit Linux system with Oracle Database 10g Release 10.2.0.4.0 - Production (database version) Oracle version is standard.
    Please let me know how i can update my DR server with PROD data and this task should be automatic.
    Please ask me more information if required to solve this issue.
    Thanks- Priyank
    Edited by: Oracle DBA P on Nov 19, 2010 3:06 AM

    you mean to say data guard needs to implement ? i think that's one option but what you said is different ?
    tell me procedure how i can implement your idea ? steps i have to perform.
    Thanks
    Edited by: Oracle DBA P on Nov 19, 2010 3:38 AM

  • Best way to update drivers?????

    I'd like to get advice on the best way to update my MB drivers.
    If I update my NVIDIA nForce4 System Driver, does that update my AMD 64 4000+ CPU? or do I need to go to AMD's site and get that update??????
    I'm new to this building PC's so please bear with me.  Thanks==db

    No, it does not update the drivers for your CPU, you have to go to the AMD site to get the drivers for the CPU, and also get the drivers from nVidia.
    Be well....

  • Best way to update a polygons position?

    What is the best way to update a polygons position? I don't want to create a new one each time, and there is no setBounds method.

    I'm sorry. I meant. Say my array of x positions is 3, 4, 9. I change 9 to 30. How can I make the polygon see that change?

  • Best way to update AC97 audio drivers?

    Is the best way to update AC97 audio drivers = dl. from msi the latest drivers which are 5.10.00.5970 (A3.80) I currently have 5890. Then uninstalling old ones from add-remove programs then install newest ones. Since live update doesn't seem to get it done. Thanks
    Den

    I agree with the package that is in Dr Stu's link, I downloaded that complete package which includes NVMixer for speaker setup and fine tuning your sound system.
    Regards; Pop's

Maybe you are looking for

  • Exported JPEGs colour different in Flickr

    I've noticed the topic of colour difference in images come up a lot but after a cursory search, I couldn't find anything on my particular problem. I shoot in RAW, colour correct and then export to JPEG. The changes show up fine in my mac's standard a

  • I bought the new iphone6 plus at m1 got to "black gap" inside the screen,and apple said cannot be repair  ***,

    I bought the new iphone6 plus at m1 got to "black gap" inside the screen,and apple said cannot be repair  ***, ***,,,It's really assembly mistakes......why apple become like that... and i chat online with apple support,she said let me call customer s

  • Can a Flexconnect (h-reap) survive reload while in standalone mode

    I have searched and asked round for this the last weeks. Can't find the answer. When a flexconnect is in standalone mode (WAN down) what happens if the AP is reloaded? Is it possible to make a setup with i.e. WPA/PSK where the AP keeps working after

  • How do I delete a trail ver of iWork completly

    I recently downloaded a trail version of iWork and then bought a dvd of it of it on ebay and it will not open without a serial number. I tried deleting all iWork files and reloading it. Still does not work. Where does the trail version hide on this c

  • Changes in Labview.lib between 6.0.2 and 6.1 ?

    I recently installed 6.1 and tried to run out test system. The error DSPtrAndHand occured in Labview.lib and lv was shut down. I looked at the labview.lib files both in 6.0.2 and 6.1 and the lib file was twice as big in 6.0.2. I am not an expert on t