10.07.2015 Views

Expert Oracle Exadata - Parent Directory

Expert Oracle Exadata - Parent Directory

Expert Oracle Exadata - Parent Directory

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 6 MAKING PCBS--------------------------------------Active% | PLSQL_OBJE | SQL_ID--------------------------------------2152% | | 05cq2hb1r37tr7% | |-- End of ASH snap 1, end=2010-12-06 19:25:43, seconds=5, samples_taken=42PL/SQL procedure successfully completed.There are several things worth mentioning in this listing. To set up the desired conditions we turnedon Auto DOP, which also enables Parallel Queuing, and then set the PARALLEL_SERVER_TARGET parameterto a very low number (10) in order to trigger queuing more easily. We then used a shell script (ss.sh) tofire off 20 copies of the avgskew.sql script in rapid succession. Querying V$SQL_MONITOR showed that thestatements were indeed queuing. This is an important point. All statements using parallel query willshow up in the V$SQL_MONITOR view. If they have a status of QUEUED they are not actually executing but areinstead waiting until enough parallel slaves become available. We also queried V$PX_PROCESS_SYSSTAT afew times to see how many parallel slaves were being used. Finally, we ran Tanel Poder’s snapper scriptto see what event the queued statements were waiting on. As you can see, it was the resmgr: pq queuedwait event.■ Note: There is one other thing you should be aware of with regard to the wait events. There is a wait eventchange that relates to parallel queuing. This example was created using <strong>Oracle</strong> Database version 11.2.0.2. If youare using 11.2.0.1 you will see a different set of wait events (there are two). The first is PX Queuing: statementqueue. This is the event that a statement waits on when it is next to run. The other is enq: JX - SQL statementqueue. This event is what a statement waits on when there are other statements ahead of it in the queue. Thisscheme seems quite unwieldy, which is probably why it was changed in the later release.Controlling Parallel QueuingThere are several mechanisms in place for controlling how the Parallel Statement Queuing featurebehaves. The basic approach is to use a first-in, first-out queuing mechanism. But there are ways toprioritize work within the queuing framework. It’s also possible to completely by-pass the queuingmechanism via a hint. And conversely, it is possible to enable queuing for a statement via a hint evenwhen the parallel Statement Queuing feature is not enabled at the database level. There are also a fewparameters that affect the queuing behavior. And finally, Resource Manager has the capability to affecthow statements are queued.Controlling Queuing with ParametersThere are a handful of parameters that affect how Parallel Queuing behaves. The main parameter isPARALLEL_SERVERS_TARGET, which tells <strong>Oracle</strong> how many parallel server processes to allow before startingto hold statements back in the queue. The default value for this parameter is calculated as follows:156

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!