Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Oracle query slow execution of sql, using V$SESSION_LONGOPS analysis

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

/ * OPNAME: refers to the name of the operation that has been executed for a long time. Such as: Table ScanTARGET: the object_name being operated. For example: tableA TARGET_DESC: describe the content of target SOFAR: this is something to focus on, indicating the number of work to be done, such as how many blocks have been scanned. TOTALWORK: refers to the total number of target objects (expected). Such as the number of blocks. UNITS: START_TIME: start time of the process LAST_UPDATE_TIM: time of the last call to set_session_longops TIME_REMAINING: estimated how long it will take to complete, in seconds ELAPSED_SECONDS: from the start operation time to the last update time CONTEXT:MESSAGE: a complete description of the operation, including progress and operation content. USERNAME: same as in v$session. SQL_ADDRESS: associated v$sqlSQL_HASH_VALUE: associated v$sqlQCSID: mainly used together with parallel queries. * / SELECT V.SQL_ID, USERNAME, SID, OPNAME, ROUND (SOFAR * 100 / TOTALWORK, 0) | |%'AS "execution progress percentage", TIME_REMAINING "estimated remaining time (seconds)", SQL_TEXT, A.ELAPSED_SECONDS "execution time (seconds)", A.START_TIME "execution start time", A.TOTALWORK "Total (block block)" A.SOFAR "completed (block block)", A.SOFAR / A.ELAPSED_SECONDS "scans per second (block block)" FROM V$SESSION_LONGOPS A, V$SQL V WHERE 1 = 1-- AND TIME_REMAINING 0 AND SQL_ADDRESS = ADDRESS AND SQL_HASH_VALUE = HASH_VALUE ORDER BY A.ELAPSED_SECONDS DESC SELECT DBMS_SQLTUNE.REPORT_SQL_MONITOR (SQL_ID = > '85tpcyjsu9mx6) AS REPORT FROM DUAL, REPORT_LEVEL = >' ALL')

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report