1. 程式人生 > 其它 >Oracle撈取系統未採用繫結變數sql的語句

Oracle撈取系統未採用繫結變數sql的語句

繫結變數目的:減少硬解析,增加sql語句的共享性,避免sql注入,降低資料被盜風險。 撈取系統未採用繫結變數sql的語句如下: 繫結變數目的:減少硬解析,增加sql語句的共享性,避免sql注入,降低資料被盜風險。 撈取系統未採用繫結變數sql的語句如下:
 1 with force_mathces as
 2  (select l.force_matching_signature mathces,
 3           max(l.sql_id || l.child_number) max_sql_child,
 4           dense_rank() over(order by count(*) desc) ranking,count(*) times 
 5      from v$sql l
 6     where l.force_matching_signature <> 0
 7       and l.parsing_schema_name <>
'SYS' 8 group by l.force_matching_signature 9 having count(*) > 10) 10 select v.sql_id, v.sql_text, v.parsing_schema_name, fm.ranking,fm.times 11 from force_mathces fm, v$sql v 12 where fm.max_sql_child = (v.sql_id || v.child_number) 13 and fm.ranking <= 50 14 order by fm.ranking;