Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: parallel query works on single CPU or not?
L. Tseng wrote:
>
> Hi,
>
> We run Oracle Work Group Server 7.3 on NT4.0. The default in init.ora file
> sets 5 max parallel server. I altered a large table (not index) with parallel
> degree 3 but did not see the performance gain. So, my questions are:
>
> Does parallel query work on single CPU ?
> How can you tell if a parallel query is being performed?
> Is there any other parameters need to be tuned?
>
> Thanks,
>
> Leslie
>
Yes, parallel query is a performance gain in a single cpu machine. It’s
the old
multitasking game, if one process is blocked on a resource, another
process can
get some quality cpu time. But as always, the more active processes on
the
system, the less the gain.
You can determine if parallel query will be performed by looking at the
plan_table
output from the explain plan utility. I can’t remember the details but
the
description(s) gets better with the higher the Oracle version (7.1, 7.2,
7.3, ?.?). But, if you are running with the cost based optimizer just
because
the explain plan says it’s so doesn’t mean it’s so (see next paragraph).
I like to run several queries to see what is happening at run time (see
below).
You can look at your session in the v$ tables and see that the parallel
query
servers you are using are associated with your session for the duration
of your
parallel query. The v$ tables also have statistics about each parallel
query
server and some summarized statistics.
QUERY OUTPUT WHEN OPQ IS NOT BEING USED:
Oracle Pgm Oracle Oracle Unix User Unix Unix Session User Name Pid Pid ID Serial# TTY# ---------- ---------- ------ ------ ------- ------- ------- Server Program Name Type ------------------------------------------------ ---------Current SQL Statement
oracle OPS$ORACLE 66878 92992 244 1640 pts/1 sqlplus_at_bart (Pipe Two-Task) DEDICATEDselect count(*) from ADJUSTMENTS
QUERY OUTPUT WHEN OPQ IS BEING USED (note how all processes are
associated
with Pgm Unix Pid 66878):
Oracle Pgm Oracle Oracle Unix User Unix Unix Session User Name Pid Pid ID Serial# TTY# ---------- ---------- ------ ------ ------- ------- ------- Server Program Name Type ------------------------------------------------ ---------Current SQL Statement
oracle OPS$ORACLE 66878 21256 154 552 pts/1 sqlplus_at_bart (Pipe Two-Task) DEDICATEDSELECT /*+ ROWID(A1)*/ COUNT(*) FROM "ADJUSTMENTS" A1 WHERE ROWID BETWEEN
oracle OPS$ORACLE 66878 21508 214 1074 pts/1 sqlplus_at_bart (Pipe Two-Task) DEDICATEDSELECT /*+ ROWID(A1)*/ COUNT(*) FROM "ADJUSTMENTS" A1 WHERE ROWID BETWEEN
oracle OPS$ORACLE 66878 92992 244 1640 pts/1 sqlplus_at_bart (Pipe Two-Task) DEDICATEDselect /*+ FULL(A) PARALLEL(A,2) */ count(*) from ADJUSTMENTS A
SOME OF THE OPQ STATISTICS AVAILABLE: SYSTEM STATISTICS Report For Oracle Parallel Query Servers
Current Statistic Value ------------------------------ ----------- DFO Trees 1 Distr Msgs Recv'd 0 Distr Msgs Sent 0 Local Msgs Recv'd 4 Local Msgs Sent 2 Queries Initiated 1 Server Sessions 2 Servers Busy 0 Servers Cleaned Up 0 Servers Highwater 2 Servers Idle 4 Servers Shutdown 0 Servers Started 0Hit enter to continue
SLAVE SERVERS STATISTICS Report For Oracle Parallel Query Servers
Currently Total Times Cur Busy Busy Name Status Busy Bus Pct Pct ----- ------ ------ --- --------- -------- P000 IDLE 1 NO .000 .000 P001 IDLE 1 NO .000 .000 P002 IDLE 0 NO .000 .000 P003 IDLE 0 NO .000 .000
REM
REM == AUTHOR - Brian P. Mac Lean REM == DATE - 02-JAN-97 REM == FILE - tool_session.sql
col bb heading "Unix|User" format a10 col cc heading "Oracle|User|Name" format a10 col dd heading "Pgm|Unix|Pid" format a6 col ee heading "Oracle|Unix|Pid" format a6 col ef heading "Oracle|Session|ID" format 999999 col eg heading "Serial#" format 999999 col ff heading "TTY#" format a7 col gg heading "Program Name" format a48 col hh heading "Current SQL Statement" format a80 col ii heading "Server|Type" format a9 select unique vs.osuser bb, vs.username cc, vs.process dd, vp.spid ee, vs.sid ef, vs.serial# eg, vs.terminal ff, vs.program gg, vs.server ii, vsql.sql_text hh
and vs.paddr = vp.addr and vs.sql_address = vsql.address (+) and vs.sql_hash_value = vsql.hash_value (+);
break on bb nodup on cc nodup on dd nodup on ee nodup on ef nodup on eg
nodup
col gg heading "Accessing|Object" format a28
select unique
vs.osuser bb, vs.username cc, vs.process dd, vp.spid ee, vs.sid ef, vs.serial# eg, va.object gg
and vs.paddr = vp.addr and vs.sid = va.sid order by vs.osuser, vs.username, vs.process, vp.spid, vs.sid;
exit;
REM ================================ END OF FILE ===============================
REM
REM == AUTHOR - Brian P. Mac Lean REM == DATE - 10-JAN-97 REM == FILE - tool_pq.sql
col num format 999 heading "Nbr" col name format a30 heading "Name" col type format 999 heading "Type" col value format a15 heading "Value" col meg format 99.99 heading "Size|Meg" col isdefault format a9 heading "IsDefault"ttitle "Current Parameter Report For Oracle Parallel Query Servers" select num, name, type, value, isdefault from v$parameter
REM only valid if your current session has run a parallel query REM
REM col statistic format a30 heading "Statistic" REM col last_query format 99,999 heading "Last|Session|Totals" REM col session_to format 99,999,999 heading "All|Session|Totals"REM ttitle "SESSION STATISTICS Report For Oracle Parallel Query Servers" REM select *
col statistic format a30 heading "Statistic" col value format 99,999,999 heading "Current|Value"ttitle "SYSTEM STATISTICS Report For Oracle Parallel Query Servers" select *
col name format a5 heading "Name" col status format a6 heading "Status" col sessions format 99999 heading "Times|Busy" col cur_busy format a3 heading "Currently|Busy?" col cur_busy_pct format 999.999 heading "Currently|Busy|Pct" col tot_busy_pct format 999.999 heading "Total|Busy|Pct"ttitle "SLAVE SERVERS STATISTICS Report For Oracle Parallel Query Servers"
status AS status, sessions AS sessions, decode(busy_time_cur, '0', 'NO', 'YES') AS cur_busy, (busy_time_cur / (busy_time_cur + idle_time_cur + 1)) * 100 AS cur_busy_pct, (busy_time_total / (busy_time_total + idle_time_total + 1)) * 100AS tot_busy_pct
exit;
REM ================================ END OF FILE =============================== \\|// (0-0) +-----oOO----(_)-----------+ | Brian P. Mac Lean | | Database Analyst | | brian.maclean_at_teldta.com | | http://www.teldta.com | +-------------------oOO----+ |__|__| || || ooO Ooo
Who needs friends when you can sit alone in your room and drink? Received on Tue May 13 1997 - 00:00:00 CDT
![]() |
![]() |