Question

In Oracle 11g, is there a way to tell the database to use parallel execution whenever possible by setting a flag etc, rather than using PARALLEL hints with every SQL statement?

Was it helpful?

Solution

Simple answer: Yes. Unfortunately it is not quite a simple as that, as if you want to enable parallelism, then you are obviously concerned about performance, and it is extremely tunable.

Start with alter system set paralllel_automatic_tuning=true scope=spfile; then restart. This will have Oracle do what it thinks is best. There are many other parameters to set (e.g. parallel_execution_message_size) and you will need to experiment to find the best. Be careful with this; it is easy when you start out with parallel query to get carried away in benchmarking then discover in the "real world" a few queries fly but the overall throughput of the system actually decreases as some sessions are starved of CPU or the system is forced into swap. The documentation warns:

When concurrent users have too many query server processes, memory contention (paging), I/O contention, or excessive context switching can occur. This contention can reduce system throughput to a level lower than if parallel execution were not used.

So I strongly advise putting some limits in place, e.g. with resource consumer groups.

Also for any table you can do ALTER TABLE table_name PARALLEL (DEGREE x); where x is a number, 4 or 8 might be good places to start.

OTHER TIPS

I believe you want the parallel_automatic_tuning=true setting.

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top