Reputation: 6265
If I use /*csv*/
in my select statement, would it use all the available cores on the server side? Or just 1?
I am planning to do something like this:
spool "\path\to\spool1.txt"
select /*csv*/ * from employees;
I cannot use all the cores. I used /*+ parallel(auto) */
and I got reprimanded. I cannot use anymore than 1 core.
Upvotes: 0
Views: 166
Reputation: 22427
First of all, the CSV bit, is a SQL Developer and SQLcl specific output formatting thing, where client-side we take the output and auto-format it to CSV. That's ZERO DB processes there.
The database generally automatically will parallelism your queries as needed.
When the parameter PARALLEL_DEGREE_POLICY is set to AUTO, Oracle Database automatically decides if a statement should execute in parallel or not and what DOP it should use
You can additionally define your TABLEs in advance to be setup for parallel degree queries.
CREATE TABLE PARALLEL_5
(
COLUMN1 VARCHAR2(20)
, COLUMN2 INT
)
PARALLEL 5;
So don't use the Parallel hint to stay out of trouble with your DBA.
However, your DBA could also just take care of it by using a resource consumer group policy to restrict you automatically.
Degree of Parallelism Limit You can limit the maximum degree of parallelism for any operation within a consumer group. The degree of parallelism is the number of parallel execution servers that are associated with a single operation. Use the PARALLEL_DEGREE_LIMIT_P1 directive attribute to specify the degree of parallelism for a consumer group.
Upvotes: 3