How to view parallel related information in Oracle

Source: Internet
Author: User

Below I introduce three kinds of view parallel related content, such as parallelism, parallel execution instance and so on through the experiment.

1, V$pq_tqstat view

– Script

[Oracle@rac1 ~]$ Cat Showdop.sql

Column Server_type format A15

Column PROCESS format A10

Select Dfo_number,

TQ_ID,

Server_type,

Process

Num_rows,

bytes

Instance

From V$pq_tqstat

ORDER BY Dfo_number Desc,

TQ_ID,

Server_type Desc,

Process

/

Luocs@luocs11g> Select/*+ Parallel (2) */COUNT (*) from LTB1;

COUNT (*)

----------

3560448

Luocs@luocs11g> @showdop

Dfo_number tq_id server_type PROCESS num_rows BYTES INSTANCE

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

1 0 Producer P000 1 32 1

1 0 Producer P001 1 32 1

1 0 Consumer QC 2 64 1

2, Dbms_monitor. Client_id_trace_enable

Luocs@www> BEGIN

2 dbms_session. Set_identifier (' www.luocs.com ');

3 Dbms_monitor. Client_id_trace_enable

4 (client_id => ' www.luocs.com ',

5 WAITS => TRUE

6);

7 End;

8/

Pl/sql procedure successfully completed.

Luocs@www> Select/*+ Parallel (3) */COUNT (*) from test1;

COUNT (*)

----------

456128

Luocs@www> exec dbms_monitor. Client_id_trace_disable (' www.luocs.com ');

Pl/sql procedure successfully completed.

Sys@www> Select Client_identifier from v$session where sid= (select Sid from V$mystat where rownum=1);

Client_identifier

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

Www.luocs.com

Sys@www> Col primary_id for A30

Sys@www> Select Trace_type, primary_id, waits, binds from dba_enabled_traces;

Trace_type primary_id WAITS Binds

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

client_id www.luocs.com TRUE FALSE

[Oracle@rac1 ~]$ cd/u01/app/oracle/diag/rdbms/www/ltb1/trace/

[Oracle@rac1 trace]$ trcsess clientid=www.luocs.com output=luocs_test2.trc

[Oracle@rac1 trace]$ ls luocs_test2.trc

-rw-r--r--1 Oracle oinstall 103514 07:06 LUOCS_TEST2.TRC

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.