Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Why can't I run this query in Parallel ?

JOE_humbleJun 11 2015 — edited Jun 12 2015

DB version: 11.2.0.4

Platform : Oracle Linux 6.5

In my DB, a gather stats job with parallelism 5 like below is running fine. From OEM, I confirmed that the below gather stats job is running with 5 slave processes.

exec dbms_stats.gather_table_stats(  -

       ownname => 'PTMS', -

       tabname => 'ORDER_DETAIL', -

       estimate_percent => DBMS_STATS.AUTO_SAMPLE_SIZE,  -

       cascade => TRUE,  -

       method_opt => 'FOR ALL COLUMNS SIZE AUTO', -

       degree => 5);

order_detail is a table with 400 million records. I wanted to get a row count of this table. So, I tried to use parallelism as shown below.

But, the slave processes were not created. The SELECT query was running only with parallelism 1. I cofirmed this from real time data from OEM and gv$px_session view.

SQL> show parameter parallel_max_servers

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

parallel_max_servers                 integer     3200

SQL> ALTER SESSION FORCE PARALLEL QUERY PARALLEL 5;

Session altered.

SQL> ALTER SESSION enable parallel query;

Session altered.

SQL> select /*+ PARALLEL(5) */ count(*) from ptms.order_detail;

--- Also tried

select /*+ PARALLEL(ptms.order_detail,5) */ count(*) from ptms.order_detail;

--- Also tried 

ALTER SESSION ENABLE PARALLEL DML;

--- The below setting shouldn't be the cause. Right ? ALTER SESSION command should take precedence over this setting. Right ?

SQL> select table_name, DEGREE from dba_tables where owner='PTMS' and table_name= 'ORDER_DETAIL';

TABLE_NAME                         DEGREE

------------------------------  ----------------------------------------

ORDER_DETAIL                          1

This post has been answered by Dan Jankowski on Jun 11 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 10 2015
Added on Jun 11 2015
12 comments
1,768 views