Escolar Documentos
Profissional Documentos
Cultura Documentos
(An Introduction)
Doug Burns
(dougburns@yahoo.com)
Introduction
• Introduction
• Parallel Architecture
• Configuration
• Dictionary Views
• Tracing and Wait Events
• Conclusion
Introduction
• Parallel Query Option introduced in 7.1
– Now called Parallel Execution
Non-Parallel
U s e r P ro c e s s
S e rv e r
select * from emp; P ro c e s s
S la v e
EM P
0
U s e r P ro c e s s
Parallel
R e a d in g 1 s t
H a lf
select /*+
Q C
parallel(emp,2) */
S la v e 1
R e a d in g 2 n d
H a lf
Parallel Architecture
• The Degree of Parallelism (DOP) refers to the
number of discrete threads of work
• parallel_min_servers
– Default - 0
– May choose to increase this if PX usage is constant to
reduce overhead of starting and stopping slave
processes.
More on this subject in tomorrow’s presentation
Configuration
• parallel_execution_message_size
– Default Value – 2148 bytes
– Automatic Tuning Default – 4Kb
– Maximum size of a message buffer
– May be worth increasing to 8Kb, depending on wait
event analysis.
– However, small increases in message size could lead
to large increases in large pool memory
requirements
– Remember that DOP2 relationship and multiple
sessions
Configuration
• Metalink Note 201799.1 contains full details and guidance for setting all parameters
• Ensure that standard parameters are also set appropriately
– large_pool_size
• Modified by parallel_automatic_tuning
• Calculation in Data Warehousing Guide
• Can be monitored using v$sgastat
– processes
• Modified by parallel_automatic_tuning
– sort_area_size
• For best results use automatic PGA management
• Be aware of _smm_px_max_size
• Metalink Note 201799.1 contains full details and guidance for all relevant parameters
Dictionary Views
• Introduction
• Parallel Architecture
• Configuration
• Dictionary Views
• Tracing and Wait Events
• Conclusion
Dictionary Views
• Parallel-specific Dictionary Views
SELECT table_name
FROM dict
WHERE table_name LIKE 'V%PQ%' OR table_name like 'V%PX%‘;
TABLE_NAME
------------------------------
V$PQ_SESSTAT
V$PQ_SYSSTAT
V$PQ_SLAVE
V$PQ_TQSTAT
V$PX_BUFFER_ADVICE
V$PX_SESSION
V$PX_SESSTAT
V$PX_PROCESS
V$PX_PROCESS_SYSSTAT
STATISTIC VALUE
------------------------------ ----------
Servers Busy 0
Servers Idle 0
Servers Highwater 3
Server Sessions 3
Servers Started 3
Servers Shutdown 3
Servers Cleaned Up 0
Dictionary Views
• v$pq_slave
– Gives information on the activity of individual PX slaves
– v$px_process contains similar information
– 9i Results
P001 SELECT A1.C0 C0,A1.C1 C1,A1.C2 C2,A1.C3 C3,A1.C4 C4,A1.C5 C5,
A1.C6 C6,A1.C7 C7 FROM :Q3000 A1 ORDER BY A1.C0
– 10g Results
P001 SELECT /*+ PARALLEL (attendance, 2) */ * FROM attendance
ORDER BY amount_paid
Dictionary Views
• Additional information in standard Dictionary
Views
– e.g. v$sysstat
NAME VALUE
---------------------------------------------- ----------
PX local messages sent 4895
PX local messages recv'd 4892
PX remote messages sent 0
PX remote messages recv'd 0
Dictionary Views
Monitoring
•• Monitoring the adaptive
the adaptive multi-user multi-user
algorithm algorithm
– We need to be able to check whether operations are being downgraded and by
We
–how need to be able to check whether operations are
much
being downgraded
– Downgraded and
to serial could be by how
a particular much
problem!
– Downgraded to serial could be a particular problem!
SELECT name, value FROM v$sysstat WHERE name LIKE 'Parallel%'
NAME VALUE
---------------------------------------------------------------- ----------
SELECT name, value
Parallel operations FROM v$sysstat WHERE name LIKE 546353
not downgraded 'Parallel%'
Parallel operations downgraded to serial 432
Parallel operations downgraded 75 to 99 pct 790
NAME
Parallel operations downgraded 50 to 75 pct 1454
VALUE
------------------ ----------------------------------------------
Parallel operations downgraded 25 to 50 pct 7654 ----------
Parallel operations downgraded 1 to
Parallel operations not downgraded 25 pct 11873 546353
P*ssed-off users 432
Parallel operations downgraded 75 to 99 pct 790
Parallel operations downgraded 50 to 75 pct 1454
Parallel operations downgraded 25 to 50 pct 7654
Parallel operations downgraded 1 to 25 pct 11873
Dictionary Views
• Statspack
– Example Report (Excerpt)
– During overnight batch operation
– Mainly Bitmap Index creation
– Slightly difficult to read
Parallel operations downgraded 1 0
Parallel operations downgraded 25 0
Parallel operations downgraded 50 7
Parallel operations downgraded 75 38
Parallel operations downgraded to 1
Parallel operations not downgrade 22
– With one stream downgraded to serial, the rest of the schedule may depend on this one job.
Tracing and Wait Events
• Introduction
• Parallel Architecture
• Configuration
• Dictionary Views
• Tracing and Wait Events
• Conclusion
Tracing and Wait Events
• Tracing Parallel Execution operations is more complicated than standard
tracing
– One trace file per slave (as well as the query coordinator)
– Potentially 5 trace files even with a DOP of 2
– May be in background_dump_dest or user_dump_dest (usually background_dump_dest)
Tracing and Wait Events
• Much simpler in 10g
– Use trcsess to generate a consolidated trace file for QC and all slaves
exec dbms_session.set_identifier(‘PX_TEST');
REM tracefile_identifier is optional, but might make things easier for you
alter session set tracefile_identifier=‘PX_TEST';
exec dbms_monitor.client_id_trace_enable(‘PX_TEST');
REM DO WORK
exec dbms_monitor.client_id_trace_disable(‘PX_TEST’);
GENERATE THE CONSOLIDATED TRACE FILE AND THEN RUN IT THROUGH TKPROF
<SNIPPED>
• If there are any significant waits for this event, this may
indicate you have shared pool resource issues.
Doug Burns
(dougburns@yahoo.com)
(oracledoug.blogspot.com)
(doug.burns.tripod.com)