1. I was expecting 4 parallel threads, why there are so many?
2. Why thread P000 or P003 or P002 has 5 parallel connections in the result above, Where as P007 has only 2? How Oracle is deciding the number of threads?
3. I was in belief that if SOFAR = TOTALWORKS the task is complete. Is that right? Looking at SOFAR I used to calculate time remaining.
4. If I am right at question# 3 above, why I could see the thread P001.SOFAR = totalwork already, has started again where totalwork=28932?
You are querying the entire view which stores the historical data also. Use the below query to see the current sessions running more than last 5 seconds.
select sid,username,time_remaining, message from v$session_longops where (totalwork - sofar) > 5;
Questions:
1. I was expecting 4 parallel threads, why there are so many?
2. Why thread P000 or P003 or P002 has 5 parallel connections in the result above, Where as P007 has only 2? How Oracle is deciding the number of threads?
3. I was in belief that if SOFAR = TOTALWORKS the task is complete. Is that right? Looking at SOFAR I used to calculate time remaining.
4. If I am right at question# 3 above, why I could see the thread P001.SOFAR = totalwork already, has started again where totalwork=28932?
1. Because you are querying the whole view with out any condition.
2. Depends on the parallel servers available Oracle invoke the required servers.
3. SOFAR = elapsed time so far. For the sessions already completed obviously SOFAR = TOTALWORK
4. You are wrong in question # 3
Thanks,
Vijay Tummala
Try hard to get what you like OR you will be forced to like what you get.
I was thinking # of parallel session is static in this view. If P001 session is completed already, I was not expecting another session of P001. Otherwise how could someone estimate the remaining time of processes?
This is because Oracle allocate the work part by part to the parallel servers not at one stretch.
For example, a table with 1000 blocks and a query with 4 parallel servers, Oracle will divide the table into 4 parts i.e 250 blocks each. Out of 250 blocks first it allocate 100 blocks then another 100 then remaining 50. In this case you will see each parallel session 3 times.
Hope this clears.
Thanks,
Vijay Tummala
Try hard to get what you like OR you will be forced to like what you get.
yes, it is difficult to estimate the time for parallel queries by looking into v$session_longops. However, If the stats are updated for the respective tables / indexes then you can estimate the time by generating the explain plan for the query.
Thanks,
Vijay Tummala
Try hard to get what you like OR you will be forced to like what you get.
In my database I can see 8 parallel processes being fired for the migration scripts. Normally this can be controlled by the DEFAULT parallel hint being reduced to a specified parallelism. Having a 4 CPU machine, I reduced this to 4, still I see 8 sessions being fired. I changed the Parallel_threads_per_cpu to 1.
Any ideas what might prevent the parallel hints being used to control the width of parallelism?
PARALLEL_MAX_SERVERS parameter controls the number of parallel servers.
Also, please check if the tables have object level parallelism enabled (DEGREE column). If the parallel hint in the query is 2 and DEGREE is 2 for the table used in the query then you will see 4 parallel servers running.
Thanks,
Vijay Tummala
Try hard to get what you like OR you will be forced to like what you get.
Bookmarks