I am trying to insert 1 million record after performing some calculation on each row in oracle. 15 hours gone and it is still in works. When i write a select query on this table it shows nothing. I don't know where is my inserted data going on each insert.
So my question is that, is there any way to check how many rows insert till now while performing long running insertion in oracle table, thanks.
One of the most common ways to improve the performance of an INSERT operation is to use the APPEND optimizer hint. APPEND forces the optimizer to perform a direct path INSERT and appends new values above the high water mark (the end of the table) while new blocks are being allocated.
Use the @DATEDIFF function to calculate the difference between two dates or datetimes, in days or seconds. The difference between the specified dates. Valid values can be: DD , which computes the difference in days.
For a conventional INSERT , you probably only want to commit when the application's logical transaction is complete. Unnecessarily committing after every conventional insert would cause problems with performance and atomicity. For a direct-path INSERT /*+ APPEND */ , you probably need to commit as soon as possible.
It depends whether you are doing the insertion in SQL
or PL/SQL
. While using PL/SQL
you have your own ways to get the number of rows already been processed, you can of course write your own program.
Coming to SQL
, I can think of two ways :
Most of the GUI based tools
would have nice graphical representation for the long operations view. You can query -
SELECT ROUND(SOFAR*21411/TOTALWORK)
FROM V$SESSION_LONGOPS
WHERE username = '<username>'
AND TIME_REMAINING > 0
The V$TRANSACTION
view can tell you whether any transaction is still pending. If your INSERT
is completed and COMMIT
is issued, the transaction would be completed. You can join
it with v$session
. You can query -
SELECT ....
from v$transaction t
inner join v$session s
ON t.addr = s.taddr;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With