86 次に、AWRからの文を取得 SQL> DECLARE begin_id number; end_id number; cur sys_refcursor; BEGIN SELECT min(snap_id), max(snap_id) INTO begin_id, end_id FROM dba_hist_snapshot; open cur for select value(p) from table(dbms_sqltune.select_workload_repository( begin_snap => begin_id, end_snap => end_id, basic_filter => 'parsing_schema_name not in (''SYS'')’, ranking_measure1 => 'elapsed_time’, result_limit => 5000, attribute_list => 'ALL')) p; dbms_sqltune.load_sqlset('UPG_STS_1', cur); close cur; END; / プロ・チップ: DBSNMP、ORACLE_OCM、 LBACSYS、WMSYS、XDB、SYSTEMなどの 他の内部スキーマを除外することを検討してくださ い S T S SQL> DECLARE begin_id number; end_id number; cur sys_refcursor; BEGIN SELECT min(snap_id), max(snap_id) INTO begin_id, end_id FROM dba_hist_snapshot; open cur for select value(p) from table(dbms_sqltune.select_workload_repository( begin_snap => begin_id, end_snap => end_id, basic_filter => 'parsing_schema_name not in (''SYS'')’, ranking_measure1 => 'elapsed_time’, result_limit => 5000, attribute_list => 'ALL')) p; dbms_sqltune.load_sqlset('UPG_STS_1', cur); close cur; END; / SQL> DECLARE begin_id number; end_id number; cur sys_refcursor; BEGIN SELECT min(snap_id), max(snap_id) INTO begin_id, end_id FROM dba_hist_snapshot; open cur for select value(p) from table(dbms_sqltune.select_workload_repository( begin_snap => begin_id, end_snap => end_id, basic_filter => 'parsing_schema_name not in (''SYS'')’, ranking_measure1 => 'elapsed_time’, result_limit => 5000, attribute_list => 'ALL')) p; dbms_sqltune.load_sqlset('UPG_STS_1', cur); close cur; END; / SQL> DECLARE begin_id number; end_id number; cur sys_refcursor; BEGIN SELECT min(snap_id), max(snap_id) INTO begin_id, end_id FROM dba_hist_snapshot; open cur for select value(p) from table(dbms_sqltune.select_workload_repository( begin_snap => begin_id, end_snap => end_id, basic_filter => 'parsing_schema_name not in (''SYS'')’, ranking_measure1 => 'elapsed_time’, result_limit => 5000, attribute_list => 'ALL')) p; dbms_sqltune.load_sqlset('UPG_STS_1', cur); close cur; END; /