I have a choice of SQL query that uses parallelism, something like this
INSERT INTO test_table tst
(
**************
**************
**************
)
SELECT DISTINCT
**************
**************
**************
FROM src_table a;
As you can see here, I have a hard-coded degree, but I do not want to do this, because the number of processors is not the same in the entire database where this code is executed.
My requirement:I need to query V$PARAMETERfor the available amount of CPU and use the value as result-2in my query. Something like that...
DECLARE
degree varchar2(1);
BEGIN
select value-2 INTO degree from v$parameter where name='cpu_count';
INSERT INTO test_table tst
(
**************
**************
**************
)
SELECT DISTINCT
**************
**************
**************
FROM src_table a;
END;
But it does not work, as I expected, and I see 32 parallel threads, regardless of the available processors. Is it correct? If not, is there another solution for my requirement?
Vivek source
share