- 论坛徽章:
- 0
|
1. 查看现网上一个SQL语句的计划:
SELECT * FROM TABLE(dbms_xplan.display_awr('4a89hv30yb4db'));
display_cursor
2. SQL语句运行时的绑定变量值:
SELECT * FROM dba_hist_sqlbind WHERE sql_id = '6ms263du2h1tm' ORDER BY last_captured DESC, position;
3. 找到被执行次数最多的SQL语句:
SELECT sql_id, COUNT(*) FROM dba_hist_active_sess_history GROUP BY sql_id;
4. SQL语句解析版本数量,即version count:
SELECT a.sql_id, a.sql_fulltext FROM v$sqlarea a ORDER BY version_count DESC;
5. 找到可能使用了硬编码的SQL语句:
SELECT substr(sql_text, 1, 50), COUNT(*) FROM v$sqlarea GROUP BY substr(sql_text, 1, 50)HAVING COUNT(*) > 6 ORDER BY COUNT(*) DESC; |
|