How this procedure works internally?

HI Experts

I created the procedure (it is updated 50 million records in decent time) below, but I have some doubts.
(1) I'm not engage until the end. It will take the place of CANCELLATION. How can I ensure that this procedure is running until the end.
(2) if I increase the space UNDO how shall I increase whereas 50 million lines.
(3) should I take into account factors other than UNDO space when running this procedure if yes then wat are.
(4) suggest some links where I can find how sql and pl/sql objects queries internally.

CREATE OR REPLACE PROCEDURE ACCOUNTS_MIGRATION
IS
TYPE num_new_typ IS TABLE OF accounts.acc_no_new%TYPE ;
TYPE num_old_typ IS TABLE OF accounts.acc_no_old%TYPE ;
TYPE mat_records_typ IS TABLE OF mbk_audittrail.account1%TYPE;
TYPE mat_records_typ_1 IS TABLE OF mbk_audittrail.account2%TYPE;
TYPE mr_records_typ IS TABLE OF mbk_requests.account_no%TYPE;
TYPE mpgn_records_typ IS TABLE OF Mtx_payment_gateway_txn.PAYMENT_METHOD_NUMBER%TYPE;
TYPE mti_records_typ IS TABLE OF Mtx_transaction_items.ACCOUNT_ID%TYPE;


all_num_new num_new_typ:= num_new_typ();
all_num_old num_old_typ:= num_old_typ();
mat_records mat_records_typ:= mat_records_typ();
mat_records_1 mat_records_typ_1:= mat_records_typ_1();
mr_records mr_records_typ:= mr_records_typ();
mpgn_records mpgn_records_typ:= mpgn_records_typ();
mti_records mti_records_typ:= mti_records_typ();

BEGIN

   SELECT ACC_NO_OLD, ACC_NO_NEW bulk collect into all_num_old,all_num_new FROM ACCOUNTS;
   SELECT distinct ACCOUNT1 bulk collect INTO mat_records FROM MBK_AUDITTRAIL where account1 <> ' ';
   SELECT distinct ACCOUNT2 bulk collect INTO mat_records_1 FROM MBK_AUDITTRAIL where account2 <> ' ';
   SELECT distinct account_no bulk collect INTO mr_records FROM Mbk_requests where account_no <> ' ';
   SELECT distinct PAYMENT_METHOD_NUMBER bulk collect INTO mpgn_records FROM Mtx_payment_gateway_txn where PAYMENT_METHOD_NUMBER <> ' ';
   SELECT distinct ACCOUNT_ID bulk collect INTO mti_records FROM Mtx_transaction_items where ACCOUNT_ID <> ' ';

    FORALL i IN 1..mat_records.count
    UPDATE MBK_AUDITTRAIL SET ACCOUNT1=(SELECT ACC_NO_NEW FROM ACCOUNTS WHERE ACC_NO_OLD=mat_records(i) AND ROWNUM=1) WHERE ACCOUNT1=mat_records(i);
    DBMS_OUTPUT.PUT_LINE(TO_CHAR(SQL%ROWCOUNT) || ' rows updated for MBK_AUDITTRAIL->ACCOUNT1');

    FORALL j IN 1..mat_records_1.count
    UPDATE MBK_AUDITTRAIL SET ACCOUNT2=(SELECT ACC_NO_NEW FROM ACCOUNTS WHERE ACC_NO_OLD=mat_records_1(j) AND ROWNUM=1) WHERE ACCOUNT2=mat_records(j);
    DBMS_OUTPUT.PUT_LINE(TO_CHAR(SQL%ROWCOUNT) || ' rows updated for MBK_AUDITTRAIL->ACCOUNT2');

    FORALL k IN 1..all_num_old.count
    UPDATE MBK_BANK SET ACCOUNT_NO=all_num_new(k) WHERE ACCOUNT_NO=all_num_old(k);
    DBMS_OUTPUT.PUT_LINE(TO_CHAR(SQL%ROWCOUNT) || ' rows updated for MBK_BANK->ACCOUNT_NO');

    FORALL l IN 1..all_num_old.count
    UPDATE MBK_CUST_ACCOUNTS SET ACCOUNT_NO=all_num_new(l) WHERE ACCOUNT_NO=all_num_old(l);
    DBMS_OUTPUT.PUT_LINE(TO_CHAR(SQL%ROWCOUNT) || ' rows updated for MBK_CUST_ACCOUNTS->ACCOUNT_NO');

    FORALL m IN 1..all_num_old.count
    UPDATE Mtx_Payment_methods SET PAYMENT_METHOD_NUMBER=all_num_new(m) WHERE PAYMENT_METHOD_NUMBER=all_num_old(m);
    DBMS_OUTPUT.PUT_LINE(TO_CHAR(SQL%ROWCOUNT) || ' rows updated for Mtx_Payment_methods->PAYMENT_METHOD_NUMBER');

    FORALL n IN 1..mr_records.count
    UPDATE Mbk_requests SET ACCOUNT_NO=(SELECT ACC_NO_NEW FROM ACCOUNTS WHERE ACC_NO_OLD=mr_records(n) AND ROWNUM=1) WHERE ACCOUNT_NO=mr_records(n);
    DBMS_OUTPUT.PUT_LINE(TO_CHAR(SQL%ROWCOUNT) || ' rows updated for Mbk_requests->ACCOUNT_NO');

    FORALL o IN 1..mpgn_records.count
    UPDATE Mtx_payment_gateway_txn SET PAYMENT_METHOD_NUMBER=(SELECT ACC_NO_NEW FROM ACCOUNTS WHERE ACC_NO_OLD=mpgn_records(o) AND ROWNUM=1) WHERE PAYMENT_METHOD_NUMBER=mpgn_records(o);
    DBMS_OUTPUT.PUT_LINE(TO_CHAR(SQL%ROWCOUNT) || ' rows updated for Mtx_payment_gateway_txn->PAYMENT_METHOD_NUMBER');

    FORALL p IN 1..mti_records.count
    UPDATE Mtx_transaction_items SET ACCOUNT_ID=(SELECT ACC_NO_NEW FROM ACCOUNTS WHERE ACC_NO_OLD=mti_records(p) AND ROWNUM=1) WHERE ACCOUNT_ID=mti_records(p);
    DBMS_OUTPUT.PUT_LINE(TO_CHAR(SQL%ROWCOUNT) || ' rows updated for Mtx_transaction_items->ACCOUNT_ID');

    FORALL q IN 1..all_num_old.count
    UPDATE Temp_customer_mgmt SET ACCOUNT_NO=all_num_new(q) WHERE ACCOUNT_NO=all_num_old(q);
    DBMS_OUTPUT.PUT_LINE(TO_CHAR(SQL%ROWCOUNT) || ' rows updated for Temp_customer_mgmt->ACCOUNT_NO');

    FORALL r IN 1..all_num_old.count
    UPDATE MTX_HIST_PIN_REGENERATION SET ACCOUNT_NO=all_num_new(r) WHERE ACCOUNT_NO=all_num_old(r);
    DBMS_OUTPUT.PUT_LINE(TO_CHAR(SQL%ROWCOUNT) || ' rows updated for MTX_HIST_PIN_REGENERATION->ACCOUNT_NO');

END;
Thanks and greetings
Saurabh Sharma

Don't forget have UNDO you also worry about it again!

If you create a new session for each test at each level of volume, you can query V$ SESSTAT for the statistiic "redo size" to identify bytes redo for each level of volume. And then extrapolate from there!

Hemant K Collette
http://hemantoracledba.blogspot.com

Published by: Hemant K grapple on July 20, 2009 17:02: ADDITION of Signature

Tags: Database

Similar Questions

  • Please can someone explain how this circuit works?

    I was digging through some old files left here by a former employee and found this.  There is a text file with it that said it was a temperature alarm that was supposed to have a green light when the temperature was between 50 and 100, but a red light at any other temperature.  I can play with it and see that the lights are changing, but how to check temperatures?  Also, how this circuit works?  I never did something like this on my own, but I see what seems to be a comparator is powered by two OPERATIONAL amplifiers.  May of you please enlighten us on this so I can prove that it works?  I have a use for this, but I need to know if it will work in its current form, or if I need to make some adjustments.

    Although this tour might work in simulation there several defects that could cause problems if implemented in hardware.

    First, the Thermistors generally have a nonlinear inverse relationship to temperature. In this case this isn't a huge deal since temperatures too high or too low, the two are supposed to turn on the red LED. However, defining the thresholds of comparator at 1/3 and 2/3 of Vcc2 aren't very likely to correspond to the desired temperature.

    Then the LM324 has an R4 and R5 totem-pole output circuit are rather empty.  The output circuit can source or sink tens of milliamps for emitter junctions base of Q1 and Q2 may be vulnerable to damage.

    When Q3 and Q4 are disabled, as shown in the picture, the current flowing through the Green LED is 30 my. Indication LEDs are usually evaluated for 20 my or less.

    When Q3 or Q4 is enabled, the current flowing through the red LED is limited by the transconductance of transistors or the V-I characteristic of the diode. In both cases, the values are almost certainly in the 'let the magic smoke out' of the LED range.

    Although not destructive, Q3 and Q4 are not necessary.  The logic can be changed by reversing entries for the elements of comparison and by replacing maybe to OR AND on the transistor connections.

    Lynn

  • I no longer get suggested words when composing a message text on my iphone 5.  How to get back to get this function works

    I no longer get suggested words when composing a message text on my iphone 5.  How to get back to get this function works

    Make sure that the text is on. You can do this on the keyboard (if you have several) by pressing and holding down the button to change between them.

    Alternatively you can go to settings > general > keyboard and make sure predictive is turned on (the switch must be green).

    If you see the image below, press the small white bar above the buttons T and Y and slide upward slightly.

  • My computer says that it is connected to the internet but the HTTP 500 Internal server Err error rises. How I get working again?

    Why my internet has stopped working

    My computer says that it is connected to the internet but the HTTP 500 Internal server Err error rises. How I get working again? I have another computer in the House and that works very well.

    http://support.Microsoft.com/kb/321448

    In some cases, you must remove the cookie as well.
  • HP 6470 b 2nd hard drive upgrade. How fast this port works on? SATA I, II or III

    HP 6470 b 2nd hard drive upgrade. How fast this port works on? SATA I, II or III

    I want to put in a 60 GB SSD into the CD slot and want to see how fast it will support as this will be used for the Cache

    Thank you

    The published information is not explicit; He says only: SATA for the expansion Bay while the main hard drive Bay expressly says SATA-III. However, given that this isn't just an optical drive Bay, but also a general 'Bay expansion', it is safe to assume it of on the same SATA bus as main drive and is a SATA III interface.

    Data sheet

    6470b is also supposed to have a slot for a WSSD mSATA, but he is not described in the Manual:

    Manual

    Obviously the WSSD would work better for cache but you can use a 60 gig SSD in an expansion bay for both cache adapter. Even if the connection is SATA-II, it will be much faster to work for a cache of acceleration.

    If it's 'the Answer' please click on 'Accept as Solution' to help others find it.

  • When I try to scan with my CanoScan N640P ex scanner I receive a message indicating the Port to the printer that is used by another device. How can I work around this problem?

    When I try to scan with my CanoScan N640P ex scanner I receive a message indicating the Port to the printer that is used by another device.  How can I work around this problem?

    Hi ejp70,

    1. did you of recent changes on the computer?

    2. to when was the last time the scanner was working fine?

    3. you have any other printer\scanner connected to the computer?

    If you have any other printer\scanner connected to the computer, disconnect them and check if it works.

    I suggest that you uninstall and reinstall the scanner to the computer, also make sure that you install the latest drivers for scanner on Canon website.

  • I NEED ASSISTANCE WITH MY ETHERNET DRIVER. HOW CAN I GET THIS TO WORK NEW TI?

    Original title: driver ethernet

    I NEED ASSISTANCE WITH MY ETHERNET DRIVER.  HOW CAN I GET THIS TO WORK NEW TI

    Download and install it

    The driver should be available in the manufacture of computers site

    Use the snid on a label on the computer to search with while you're there

    Or if the motherboard came with a disc to load and the reader will be on it.

  • I just installed acrobat adobe 7.0 standard and everything seems to go well except it doesn't have the option of the typewriter in the section tool like my previous installation. This is a very important feature for me how this works?

    I just installed acrobat adobe 7.0 standard and everything seems to go well except it doesn't have the option of the typewriter in the section tool like my previous installation. This is a very important feature for me how this works?

    Hi timr22708473,

    Acrobat 7 is really an old version of acrobat & might not be compatible with your system configuration to features may or may not work.

    This is the reason why Adobe recommends always using the application in a consistent environment.

    Kind regards

    Nicos

  • I need to disable my CC on a single computer, but the grave Manager crashes when I try to do. How can I work around this problem?

    I need to disable my CC on a single computer, but the grave Manager crashes when I try to do. How can I work around this problem?

    Try the 2nd link

    Remove the license on a computer http://forums.adobe.com/thread/1442423?tstart=0 clouds can help

    -read http://helpx.adobe.com/x-productkb/policy-pricing/error-maxium-acitvation-exceeded.html

    -or https://helpx.adobe.com/x-productkb/policy-pricing/activate-deactivate-products.html

  • I need download Acrobat Reader on my PC at home. I have no internet there and need to download it to a flash player here to work as a file NOT on my hard drive. How this is done?

    I need download Acrobat Reader on my PC at home. I have no internet there and need to download it to a flash player here to work as a file NOT on my hard drive. How this is done?

    Hey davidl1589161

    Download the Setup file of Adobe Acrobat Reader DC using this link Adobe - Adobe Acrobat Reader DC Distribution, transfer it on your USB.

    Now install DC of Adobe Acrobat Reader on your computer in offline mode using the installation file in your Flash drive.

    Kind regards

    Nicos

  • I have lr 5 installed on my mac, I want to buy photographer cc (lr and ps) monthly subscription. How this will affect the already installed lr version... it will update my current version. I'm worried about all the files and it works

    I have lr 5 installed on my mac, I want to buy photographer cc (lr and ps) monthly subscription. How this will affect the already installed lr version... it will update my current version. I'm worried about all the files and work that I already have in my current version of lr 5? Thank you

    You can make reference to: Lightroom and Creative Cloud FAQ   using Adobe Photoshop Lightroom | Lightroom / Common Questions

    Concerning

    Baudier

  • WTH... it became a frustration of long hours, how can I get this download work?

    WTH... it became a frustration of long hours, how can I get this download work?

    Hi gustolis,

    You are on a managed network. If not then please download desktop CC: https://creative.adobe.com/#products/creative-cloud . Sign in using your Adobe Id and password, and try to download Acrobat in the list of applications.

    If stil the same question try please download from direct link: http://prodesigntools.com/adobe-acrobat-xi-pro-standard-reader-direct-download-links.html .

    Please follow the very important instructions before downloading.

    Please let us know if it worked.

    Kind regards

    Romit Sinha

  • How does the work of this Oracle

    Hello world!

    One of my friend has created t his job:

    sys.dbms_job. Submit (jobno, 'SendEmail();', (sysdate + 2/86400), null);

    Send emails very frequently.

    How this work should work? Please guide me.

    Thanks in advance.

    Nith

    You certainly JOB_QUEUE_PROCESSES set to 0 (zero), which disables the execution of the work.

    Hemant K Collette

  • Effect of green plant growth - how this work?

    Hello

    here take a look at this 2 sites:
    http://renaissanceuk.com/index_ok.php
    http://fierceangels.com/eCard/angelsfall/

    One of the first site (Renaissance, UK), the part of the header is a plant that "grows". How this is done?
    Site of one of the fierce angels, how are the growing ornament made?

    Thanks for all replies!
    Martin

    Nothing magical about either. The graph of the Renaissance is all there and gradually revealed by masking. She has the effect of turning images of leaves a little at the same time added.

    The angels we will move quickly, but also seems to be the same technique.

    So basically, all you need to do is draw the complete picture, then put a layer of masking above her and begins with no mask frame 1 and a mask that covers the entire shape in the end. resize frame by frame mask it or use interpolation to expand and modify the mask.

    Discover the masks in Flash help.

  • How can I use internal clock case OR USB - 6259 BNC for the acquisition of digital data in my own big software?

    I want to integrate the ANSI C sample program ReadDigPort - ExtClk.c in my own big package.

    I want to use the internal clock of the BNC NI USB-6259 (.. 80 kHz 120 kHz).

    In the document:
    High speed M: Series Multifunction DAQ for USB - 16-bit, up to 1.25 MECH built-in BNC connectivity. / s,.
    is written:
    Or sample DI source clock: Any PFI, RTSI, HAVE sample or convert clock, AO, Ctr n out internal and many other signals sample clock
    The digital subsystem doesn't have its own dedicated internal synchronization engine. Therefore, a sample clock must be provided another subsystem on the device or from an external source.

    How can I use internal clock case OR USB - 6259 BNC for the acquisition of digital data in my own big software?
    With what other subsystem on the device can generate a source of the clock? How?

    It is possible to set a clock on an internal counter (for example ' Dev1/ctr0"):
    Creates channels to generate digital impulses that define the freq and dutyCycle and adds the channel of the task that you specify with taskHandle.
    DAQmxCreateCOPulseChanFreq (taskHandle, "Dev1/ctr0" units, clockName, idleState,
    initialDelay, freq, the duty cycle); works

    But it is not possible to drive this internal clock to a terminal (for example "/ PFI0/Dev1"):
    DAQmxErrChk (DAQmxCreateCOPulseChanFreq (taskHandle, "/ PFI0/Dev1", clockName, units, idleState, '))
    initialDelay, freq, the duty cycle); does not work: error DAQmx: measurements: type I/O of the physical channel does not match the type of I/O required for the virtual channel you create. Name of the physical channel: PFI0. Name of the virtual channel: clock

    The sample clock source can be derived from an external terminal (for example "/ PFI0/Dev1"):
    Sets the source of the sample clock, the sample clock rate and the number of samples to acquire or generate.
    DAQmxCfgSampClkTiming (taskHandle, "/ PFI0/Dev1", maximumExpectedSamplingRate, DAQmx_Val_Rising, ")
    DAQmx_Val_ContSamps, bufferSize); works. Acquire or generate samples until you stop the task

    But it is not possible to derive the internal counter of the clock (for example ' Dev1/ctr0"):
    DAQmxCfgSampClkTiming (taskHandle, "Dev1/ctr0", maximumExpectedSamplingRate, DAQmx_Val_Rising,
    DAQmx_Val_ContSamps, bufferSize); does not work. Error: Acquire or generate samples until you stop the task: make sure that the name of the terminal is valid for the specified device. See Measurement & Automation explore valid names of terminals. Property: Property of DAQmx_SampClk_Src: DAQmx_SampClk_ActiveEdgeSource device: Terminal Source Dev1: Dev1/ctr0

    Hi datafriend,

    using what it says is correct:

    Or sample DI source clock: Any PFI, RTSI, HAVE sample or convert clock, AO, Ctr n out internal and many other signals sample clock
    The digital subsystem doesn't have its own dedicated internal synchronization engine. Therefore, a sample clock must be provided another subsystem on the device or from an external source.

    This means that if you do not use an external signal as clock you can use the sample clock to HAVE it on board or at the output of the internal counter.

    There are also 2 ANSI C examples in this regard:

    http://zone.NI.com/DevZone/CDA/EPD/p/ID/4485

    http://zone.NI.com/DevZone/CDA/EPD/p/ID/4488

    So in both cases you have to use a fictitious task you need only for the generation of the internal clock (HAVE or CTR)

Maybe you are looking for