SQL that is emitted by the trace file lookup program

Source: Internet
Author: User

Trace file is a text file followed by TRC, which records various SQL operations and what is consumed

According to the trace file, we can understand which SQL is causing the system's performance bottleneck, and then take the appropriate

Mode tuning.

Query production report-WIP of the ownership process;

Show parameter sql_trace;

(if value is false, the system does not currently produce trace files.) Take the following actions to make the system produce trace

File. )

Alter session set Sql_trace=true;

EXEC Dbms_monitor. Database_trace_enable (True, true);

EXEC Dbms_monitor. Database_trace_disable ();

(The database-level trace is turned on to track SQL.) )

Search using everything. TRC finds trace file.

The trace file of the session after SQL Trace is usually placed in the Udump, the latest generation is sorted by time

. trc file, open with notpad++, find the corresponding SQL statement, replace the value in the SQL statement,

Plsql developer executes the SQL statement.

Select D.process_name "Process Name",

D.process_code "Process Code",

Count (A.wip_qty) QTY

From Sajet. G_sn_status A,

Sajet. G_wo_base B,

Sajet. Sys_pdline C,

Sajet. Sys_process D,

Sajet. Sys_part E,

Sajet.sys_stage F,

Sajet.sys_terminal G,

Sajet. Sys_factory L

WHERE l.factory_code = ' HE '

and c.pdline_name = ' FAB1 '

and B.work_order = ' 0001302E0002 '

and e.part_no = ' 10000015 '

and f.stage_name = ' C '

and d.process_name = ' laser sweep edge '

and g.terminal_name = ' las3-001 '

and A.out_process_time <=

To_date (' 2015-4-1 00:00:00 ', ' yyyy-mm-dd hh24:mi:ss ')

and c.factory_id = l.factory_id

and A.work_order = B.work_order

and a.wip_process <> 0

and a.part_id = e.part_id

and a.pdline_id = c.pdline_id

and a.wip_process = d.process_id

and a.stage_id = f.stage_id

and a.terminal_id = g.terminal_id

and A.work_flag = ' 0 '

and B.wo_status < ' 5 '

Group by D.process_name, D.process_code

Order by D.process_code, D.process_name

The same can be found in fine items.

Select A.work_order "Work ORDER",

A.serial_number "SERIAL number",

A.CUSTOMER_SN "CUSTOMER SN",

Decode (A.current_status, ' 1 ', ' NG ', ') ' STATUS ',

C.pdline_name "Production Line",

D.process_name "WIP PROCESS",

A.out_process_time "Out PROCESS Time",

F.emp_name "Employee"

From Sajet. G_sn_status A,

Sajet. G_wo_base B,

Sajet. Sys_pdline C,

Sajet. Sys_process D,

Sajet. Sys_emp F,

Sajet. Sys_factory L

where l.factory_id = c.factory_id

and d.process_name = ' laser sweep edge '

and c.pdline_name = ' FAB1 '

and L.factory_code = ' HE '

and B.work_order = ' 0001302E0002 '

and A.out_process_time <=

To_date (' 2015-4-1 00:00:00 ', ' yyyy-mm-dd hh24:mi:ss ')

and A.work_order = B.work_order

and a.pdline_id = c.pdline_id

and a.wip_process = d.process_id

and B.wo_status < ' 5 '

and A.work_flag = ' 0 '

and a.emp_id = f.emp_id (+)

Order by "Serial number" AA

SQL that is emitted by the trace file lookup program

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.