home *** CD-ROM | disk | FTP | other *** search
/ Oracle Video Server 3.0.3.1 / OVS_3031_NT.iso / win32 / tracesvr / otrcdtl.sql < prev    next >
Encoding:
Text File  |  1997-01-21  |  27.9 KB  |  603 lines

  1. rem OTRCDTL.SQL
  2. rem
  3. rem Creates and populates a table with summary data for each SQL statement.
  4. rem Statements are uniquely identified by the sql_text_hash field.  The table
  5. rem contains data for the parses, executions and fetches performed for each 
  6. rem statement; the data spans user sessions, since multiple users can execute
  7. rem the same statement.
  8. rem
  9. rem The procedure will prompt for the name of the detail table to create and 
  10. rem the name of the collection if the variables dtl_table_name and cllctn
  11. rem have not been defined.  You should create a separate detail table for 
  12. rem each collection.
  13. rem
  14. rem You need to create the elapsed function by executing OTRCFUNC.SQL before 
  15. rem creating the detail table.
  16.  
  17. CREATE TABLE &&dtl_table_name
  18.     (sql_text_hash  NUMBER,
  19.      cmd_type       NUMBER,
  20.      parse_count    NUMBER,
  21.      parse_ucpu_min NUMBER,
  22.      parse_ucpu_max NUMBER,
  23.      parse_ucpu_avg NUMBER,
  24.      parse_scpu_min NUMBER,
  25.      parse_scpu_max NUMBER,
  26.      parse_scpu_avg NUMBER,
  27.      exec_count     NUMBER,
  28.      exec_time_min  NUMBER,
  29.      exec_time_max  NUMBER,
  30.      exec_time_avg  NUMBER,
  31.      exec_ucpu_min  NUMBER, 
  32.      exec_ucpu_max  NUMBER,
  33.      exec_ucpu_avg  NUMBER,
  34.      exec_scpu_min  NUMBER,
  35.      exec_scpu_max  NUMBER,
  36.      exec_scpu_avg  NUMBER,
  37.      exec_block_gets_min   NUMBER,
  38.      exec_block_gets_max   NUMBER,
  39.      exec_block_gets_avg   NUMBER,
  40.      exec_cons_gets_min    NUMBER,
  41.      exec_cons_gets_max    NUMBER,
  42.      exec_cons_gets_avg    NUMBER,
  43.      exec_reads_min NUMBER,
  44.      exec_reads_max NUMBER,
  45.      exec_reads_avg NUMBER,
  46.      exec_redo_count_min   NUMBER,
  47.      exec_redo_count_max   NUMBER,
  48.      exec_redo_count_avg   NUMBER,
  49.      exec_redo_size_min    NUMBER,
  50.      exec_redo_size_max    NUMBER,
  51.      exec_redo_size_avg    NUMBER,
  52.      exec_sort_mem_min     NUMBER,
  53.      exec_sort_mem_max     NUMBER,
  54.      exec_sort_mem_avg     NUMBER,
  55.      exec_sort_disk_min    NUMBER,
  56.      exec_sort_disk_max    NUMBER,
  57.      exec_sort_disk_avg    NUMBER,
  58.      exec_sort_rows_min    NUMBER,
  59.      exec_sort_rows_max    NUMBER,
  60.      exec_sort_rows_avg    NUMBER,
  61.      exec_row_count NUMBER,
  62.      fetch_count    NUMBER,
  63.      fetch_time_min NUMBER,
  64.      fetch_time_max NUMBER,
  65.      fetch_time_avg NUMBER, 
  66.      fetch_ucpu_min NUMBER,
  67.      fetch_ucpu_max NUMBER,
  68.      fetch_ucpu_avg NUMBER,
  69.      fetch_scpu_min NUMBER,
  70.      fetch_scpu_max NUMBER,
  71.      fetch_scpu_avg NUMBER,
  72.      fetch_block_gets_min  NUMBER,
  73.      fetch_block_gets_max  NUMBER,
  74.      fetch_block_gets_avg  NUMBER,
  75.      fetch_cons_gets_min   NUMBER,
  76.      fetch_cons_gets_max   NUMBER,
  77.      fetch_cons_gets_avg   NUMBER,
  78.      fetch_reads_min NUMBER,
  79.      fetch_reads_max NUMBER,
  80.      fetch_reads_avg NUMBER,
  81.      fetch_redo_count_min  NUMBER,
  82.      fetch_redo_count_max  NUMBER,
  83.      fetch_redo_count_avg  NUMBER,
  84.      fetch_redo_size_min   NUMBER,
  85.      fetch_redo_size_max   NUMBER,
  86.      fetch_redo_size_avg   NUMBER,
  87.      fetch_sort_mem_min    NUMBER,
  88.      fetch_sort_mem_max    NUMBER,
  89.      fetch_sort_mem_avg    NUMBER,
  90.      fetch_sort_disk_min   NUMBER,
  91.      fetch_sort_disk_max   NUMBER,
  92.      fetch_sort_disk_avg   NUMBER,
  93.      fetch_sort_rows_min   NUMBER,
  94.      fetch_sort_rows_max   NUMBER,
  95.      fetch_sort_rows_avg   NUMBER,
  96.      fetch_row_count NUMBER);
  97. COMMIT;
  98.  
  99. INSERT INTO &&dtl_table_name (sql_text_hash, cmd_type)
  100.     SELECT distinct p.sql_text_hash_end, p.oracle_cmd_type_end
  101.     FROM v_192216243_f_5_e_8_7_3 p, epc_collection c
  102.     WHERE c.collection_name = '&&cllctn' and
  103.           c.collection_id = p.collection_number;
  104. COMMIT;
  105.  
  106. UPDATE &&dtl_table_name d
  107.     SET parse_count =
  108.         (SELECT count(*) FROM v_192216243_f_5_e_8_7_3 p, epc_collection c
  109.          WHERE d.sql_text_hash = p.sql_text_hash_end AND
  110.                c.collection_name = '&&cllctn' AND
  111.                c.collection_id = p.collection_number),
  112.         parse_ucpu_min = 
  113.         (SELECT min(p.ucpu_end - p.ucpu_start)
  114.          FROM v_192216243_f_5_e_8_7_3 p, epc_collection c
  115.          WHERE d.sql_text_hash = p.sql_text_hash_end AND
  116.                c.collection_name = '&&cllctn' AND
  117.                c.collection_id = p.collection_number),
  118.         parse_ucpu_max =
  119.         (SELECT max(p.ucpu_end - p.ucpu_start)
  120.          FROM v_192216243_f_5_e_8_7_3 p, epc_collection c
  121.          WHERE d.sql_text_hash = p.sql_text_hash_end AND
  122.                c.collection_name = '&&cllctn' AND
  123.                c.collection_id = p.collection_number),
  124.         parse_ucpu_avg =
  125.         (SELECT avg(p.ucpu_end - p.ucpu_start)
  126.          FROM v_192216243_f_5_e_8_7_3 p, epc_collection c
  127.          WHERE d.sql_text_hash = p.sql_text_hash_end AND
  128.                c.collection_name = '&&cllctn' AND
  129.                c.collection_id = p.collection_number),
  130.         parse_scpu_min = 
  131.         (SELECT min(p.scpu_end - p.scpu_start)
  132.          FROM v_192216243_f_5_e_8_7_3 p, epc_collection c
  133.          WHERE d.sql_text_hash = p.sql_text_hash_end AND
  134.                c.collection_name = '&&cllctn' AND
  135.                c.collection_id = p.collection_number),
  136.         parse_scpu_max =
  137.         (SELECT max(p.scpu_end - p.scpu_start)
  138.          FROM v_192216243_f_5_e_8_7_3 p, epc_collection c
  139.          WHERE d.sql_text_hash = p.sql_text_hash_end AND
  140.                c.collection_name = '&&cllctn' AND
  141.                c.collection_id = p.collection_number),
  142.         parse_scpu_avg =
  143.         (SELECT avg(p.scpu_end - p.scpu_start)
  144.          FROM v_192216243_f_5_e_8_7_3 p, epc_collection c
  145.          WHERE d.sql_text_hash = p.sql_text_hash_end AND
  146.                c.collection_name = '&&cllctn' AND
  147.                c.collection_id = p.collection_number);
  148. COMMIT;
  149.  
  150. UPDATE &&dtl_table_name d
  151.     SET exec_count =
  152.         (SELECT count(*) FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  153.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  154.                c.collection_name = '&&cllctn' AND
  155.                c.collection_id = x.collection_number),
  156.         exec_time_min =
  157.         (SELECT min(elapsed('&&cllctn', 
  158.                             x.timestamp_start, x.timestamp_nano_start, 
  159.                             x.timestamp_end, x.timestamp_nano_end))
  160.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  161.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  162.                c.collection_name = '&&cllctn' AND
  163.                c.collection_id = x.collection_number),
  164.         exec_time_max =
  165.         (SELECT max(elapsed('&&cllctn', 
  166.                             x.timestamp_start, x.timestamp_nano_start, 
  167.                             x.timestamp_end, x.timestamp_nano_end))
  168.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  169.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  170.                c.collection_name = '&&cllctn' AND
  171.                c.collection_id = x.collection_number),
  172.         exec_time_avg =
  173.         (SELECT avg(elapsed('&&cllctn', 
  174.                             x.timestamp_start, x.timestamp_nano_start, 
  175.                             x.timestamp_end, x.timestamp_nano_end))
  176.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  177.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  178.                c.collection_name = '&&cllctn' AND
  179.                c.collection_id = x.collection_number),
  180.         exec_ucpu_min = 
  181.         (SELECT min(x.ucpu_end - x.ucpu_start)
  182.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  183.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  184.                c.collection_name = '&&cllctn' AND
  185.                c.collection_id = x.collection_number),
  186.         exec_ucpu_max =
  187.         (SELECT max(x.ucpu_end - x.ucpu_start)
  188.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  189.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  190.                c.collection_name = '&&cllctn' AND
  191.                c.collection_id = x.collection_number),
  192.         exec_ucpu_avg =
  193.         (SELECT avg(x.ucpu_end - x.ucpu_start)
  194.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  195.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  196.                c.collection_name = '&&cllctn' AND
  197.                c.collection_id = x.collection_number),
  198.         exec_scpu_min = 
  199.         (SELECT min(x.scpu_end - x.scpu_start)
  200.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  201.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  202.                c.collection_name = '&&cllctn' AND
  203.                c.collection_id = x.collection_number),
  204.         exec_scpu_max =
  205.         (SELECT max(x.scpu_end - x.scpu_start)
  206.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  207.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  208.                c.collection_name = '&&cllctn' AND
  209.                c.collection_id = x.collection_number),
  210.         exec_scpu_avg =
  211.         (SELECT avg(x.scpu_end - x.scpu_start)
  212.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  213.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  214.                c.collection_name = '&&cllctn' AND
  215.                c.collection_id = x.collection_number);
  216. COMMIT;
  217.  
  218. UPDATE &&dtl_table_name d
  219.     SET exec_block_gets_min = 
  220.         (SELECT min(x.db_block_gets_end - x.db_block_gets_start)
  221.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  222.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  223.                c.collection_name = '&&cllctn' AND
  224.                c.collection_id = x.collection_number),
  225.         exec_block_gets_max =
  226.         (SELECT max(x.db_block_gets_end - x.db_block_gets_start)
  227.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  228.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  229.                c.collection_name = '&&cllctn' AND
  230.                c.collection_id = x.collection_number),
  231.         exec_block_gets_avg =
  232.         (SELECT avg(x.db_block_gets_end - x.db_block_gets_start)
  233.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  234.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  235.                c.collection_name = '&&cllctn' AND
  236.                c.collection_id = x.collection_number),
  237.         exec_cons_gets_min = 
  238.         (SELECT min(x.consistent_gets_end - x.consistent_gets_start)
  239.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  240.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  241.                c.collection_name = '&&cllctn' AND
  242.                c.collection_id = x.collection_number),
  243.         exec_cons_gets_max =
  244.         (SELECT max(x.consistent_gets_end - x.consistent_gets_start)
  245.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  246.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  247.                c.collection_name = '&&cllctn' AND
  248.                c.collection_id = x.collection_number),
  249.         exec_cons_gets_avg =
  250.         (SELECT avg(x.consistent_gets_end - x.consistent_gets_start)
  251.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  252.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  253.                c.collection_name = '&&cllctn' AND
  254.                c.collection_id = x.collection_number),
  255.         exec_reads_min = 
  256.         (SELECT min(x.physical_reads_end - x.physical_reads_start)
  257.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  258.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  259.                c.collection_name = '&&cllctn' AND
  260.                c.collection_id = x.collection_number),
  261.         exec_reads_max = 
  262.         (SELECT max(x.physical_reads_end - x.physical_reads_start)
  263.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  264.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  265.                c.collection_name = '&&cllctn' AND
  266.                c.collection_id = x.collection_number),
  267.         exec_reads_avg = 
  268.         (SELECT avg(x.physical_reads_end - x.physical_reads_start)
  269.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  270.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  271.                c.collection_name = '&&cllctn' AND
  272.                c.collection_id = x.collection_number);
  273. COMMIT;
  274.  
  275. UPDATE &&dtl_table_name d
  276.     SET exec_redo_count_min = 
  277.         (SELECT min(x.redo_entries_end - x.redo_entries_start)
  278.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  279.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  280.                c.collection_name = '&&cllctn' AND
  281.                c.collection_id = x.collection_number),
  282.         exec_redo_count_max = 
  283.         (SELECT max(x.redo_entries_end - x.redo_entries_start)
  284.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  285.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  286.                c.collection_name = '&&cllctn' AND
  287.                c.collection_id = x.collection_number),
  288.         exec_redo_count_avg = 
  289.         (SELECT avg(x.redo_entries_end - x.redo_entries_start)
  290.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  291.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  292.                c.collection_name = '&&cllctn' AND
  293.                c.collection_id = x.collection_number),
  294.         exec_redo_size_min = 
  295.         (SELECT min(x.redo_size_end - x.redo_size_start)
  296.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  297.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  298.                c.collection_name = '&&cllctn' AND
  299.                c.collection_id = x.collection_number),
  300.         exec_redo_size_max = 
  301.         (SELECT max(x.redo_size_end - x.redo_size_start)
  302.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  303.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  304.                c.collection_name = '&&cllctn' AND
  305.                c.collection_id = x.collection_number),
  306.         exec_redo_size_avg = 
  307.         (SELECT avg(x.redo_size_end - x.redo_size_start)
  308.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  309.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  310.                c.collection_name = '&&cllctn' AND
  311.                c.collection_id = x.collection_number),
  312.         exec_row_count = 
  313.         (SELECT sum(x.row_count_end)
  314.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  315.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  316.                c.collection_name = '&&cllctn' AND
  317.                c.collection_id = x.collection_number);
  318. COMMIT;
  319.  
  320. UPDATE &&dtl_table_name d
  321.     SET exec_sort_mem_min = 
  322.         (SELECT min(x.sort_memory_end - x.sort_memory_start)
  323.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  324.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  325.                c.collection_name = '&&cllctn' AND
  326.                c.collection_id = x.collection_number),
  327.         exec_sort_mem_max = 
  328.         (SELECT max(x.sort_memory_end - x.sort_memory_start)
  329.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  330.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  331.                c.collection_name = '&&cllctn' AND
  332.                c.collection_id = x.collection_number),
  333.         exec_sort_mem_avg = 
  334.         (SELECT avg(x.sort_memory_end - x.sort_memory_start)
  335.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  336.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  337.                c.collection_name = '&&cllctn' AND
  338.                c.collection_id = x.collection_number),
  339.         exec_sort_disk_min = 
  340.         (SELECT min(x.sort_disk_end - x.sort_disk_start)
  341.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  342.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  343.                c.collection_name = '&&cllctn' AND
  344.                c.collection_id = x.collection_number),
  345.         exec_sort_disk_max = 
  346.         (SELECT max(x.sort_disk_end - x.sort_disk_start)
  347.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  348.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  349.                c.collection_name = '&&cllctn' AND
  350.                c.collection_id = x.collection_number),
  351.         exec_sort_disk_avg = 
  352.         (SELECT avg(x.sort_disk_end - x.sort_disk_start)
  353.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  354.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  355.                c.collection_name = '&&cllctn' AND
  356.                c.collection_id = x.collection_number),
  357.         exec_sort_rows_min = 
  358.         (SELECT min(x.sort_rows_end - x.sort_rows_start)
  359.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  360.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  361.                c.collection_name = '&&cllctn' AND
  362.                c.collection_id = x.collection_number),
  363.         exec_sort_rows_max = 
  364.         (SELECT max(x.sort_rows_end - x.sort_rows_start)
  365.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  366.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  367.                c.collection_name = '&&cllctn' AND
  368.                c.collection_id = x.collection_number),
  369.         exec_sort_rows_avg = 
  370.         (SELECT avg(x.sort_rows_end - x.sort_rows_start)
  371.          FROM v_192216243_f_5_e_9_7_3 x, epc_collection c
  372.          WHERE d.sql_text_hash = x.sql_text_hash_end AND
  373.                c.collection_name = '&&cllctn' AND
  374.                c.collection_id = x.collection_number);
  375. COMMIT;
  376.  
  377. UPDATE &&dtl_table_name d
  378.     SET fetch_count =
  379.         (SELECT count(*) FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  380.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  381.                c.collection_name = '&&cllctn' AND
  382.                c.collection_id = f.collection_number),
  383.         fetch_time_min =
  384.         (SELECT min(elapsed('&&cllctn', 
  385.                             f.timestamp_start, f.timestamp_nano_start, 
  386.                             f.timestamp_end, f.timestamp_nano_end))
  387.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  388.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  389.                c.collection_name = '&&cllctn' AND
  390.                c.collection_id = f.collection_number),
  391.         fetch_time_max =
  392.         (SELECT max(elapsed('&&cllctn', 
  393.                             f.timestamp_start, f.timestamp_nano_start, 
  394.                             f.timestamp_end, f.timestamp_nano_end))
  395.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  396.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  397.                c.collection_name = '&&cllctn' AND
  398.                c.collection_id = f.collection_number),
  399.         fetch_time_avg =
  400.         (SELECT avg(elapsed('&&cllctn', 
  401.                             f.timestamp_start, f.timestamp_nano_start, 
  402.                             f.timestamp_end, f.timestamp_nano_end))
  403.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  404.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  405.                c.collection_name = '&&cllctn' AND
  406.                c.collection_id = f.collection_number),
  407.         fetch_ucpu_min = 
  408.         (SELECT min(f.ucpu_end - f.ucpu_start)
  409.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  410.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  411.                c.collection_name = '&&cllctn' AND
  412.                c.collection_id = f.collection_number),
  413.         fetch_ucpu_max =
  414.         (SELECT max(f.ucpu_end - f.ucpu_start)
  415.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  416.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  417.                c.collection_name = '&&cllctn' AND
  418.                c.collection_id = f.collection_number),
  419.         fetch_ucpu_avg =
  420.         (SELECT avg(f.ucpu_end - f.ucpu_start)
  421.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  422.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  423.                c.collection_name = '&&cllctn' AND
  424.                c.collection_id = f.collection_number),
  425.         fetch_scpu_min = 
  426.         (SELECT min(f.scpu_end - f.scpu_start)
  427.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  428.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  429.                c.collection_name = '&&cllctn' AND
  430.                c.collection_id = f.collection_number),
  431.         fetch_scpu_max =
  432.         (SELECT max(f.scpu_end - f.scpu_start)
  433.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  434.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  435.                c.collection_name = '&&cllctn' AND
  436.                c.collection_id = f.collection_number),
  437.         fetch_scpu_avg =
  438.         (SELECT avg(f.scpu_end - f.scpu_start)
  439.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  440.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  441.                c.collection_name = '&&cllctn' AND
  442.                c.collection_id = f.collection_number);
  443. COMMIT;
  444.  
  445. UPDATE &&dtl_table_name d
  446.     SET fetch_block_gets_min = 
  447.         (SELECT min(f.db_block_gets_end - f.db_block_gets_start)
  448.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  449.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  450.                c.collection_name = '&&cllctn' AND
  451.                c.collection_id = f.collection_number),
  452.         fetch_block_gets_max =
  453.         (SELECT max(f.db_block_gets_end - f.db_block_gets_start)
  454.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  455.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  456.                c.collection_name = '&&cllctn' AND
  457.                c.collection_id = f.collection_number),
  458.         fetch_block_gets_avg =
  459.         (SELECT avg(f.db_block_gets_end - f.db_block_gets_start)
  460.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  461.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  462.                c.collection_name = '&&cllctn' AND
  463.                c.collection_id = f.collection_number),
  464.         fetch_cons_gets_min = 
  465.         (SELECT min(f.consistent_gets_end - f.consistent_gets_start)
  466.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  467.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  468.                c.collection_name = '&&cllctn' AND
  469.                c.collection_id = f.collection_number),
  470.         fetch_cons_gets_max =
  471.         (SELECT max(f.consistent_gets_end - f.consistent_gets_start)
  472.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  473.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  474.                c.collection_name = '&&cllctn' AND
  475.                c.collection_id = f.collection_number),
  476.         fetch_cons_gets_avg =
  477.         (SELECT avg(f.consistent_gets_end - f.consistent_gets_start)
  478.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  479.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  480.                c.collection_name = '&&cllctn' AND
  481.                c.collection_id = f.collection_number),
  482.         fetch_reads_min = 
  483.         (SELECT min(f.physical_reads_end - f.physical_reads_start)
  484.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  485.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  486.                c.collection_name = '&&cllctn' AND
  487.                c.collection_id = f.collection_number),
  488.         fetch_reads_max = 
  489.         (SELECT max(f.physical_reads_end - f.physical_reads_start)
  490.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  491.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  492.                c.collection_name = '&&cllctn' AND
  493.                c.collection_id = f.collection_number),
  494.         fetch_reads_avg = 
  495.         (SELECT avg(f.physical_reads_end - f.physical_reads_start)
  496.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  497.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  498.                c.collection_name = '&&cllctn' AND
  499.                c.collection_id = f.collection_number);
  500. COMMIT;
  501.  
  502. UPDATE &&dtl_table_name d
  503.     SET fetch_redo_count_min = 
  504.         (SELECT min(f.redo_entries_end - f.redo_entries_start)
  505.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  506.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  507.                c.collection_name = '&&cllctn' AND
  508.                c.collection_id = f.collection_number),
  509.         fetch_redo_count_max = 
  510.         (SELECT max(f.redo_entries_end - f.redo_entries_start)
  511.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  512.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  513.                c.collection_name = '&&cllctn' AND
  514.                c.collection_id = f.collection_number),
  515.         fetch_redo_count_avg = 
  516.         (SELECT avg(f.redo_entries_end - f.redo_entries_start)
  517.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  518.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  519.                c.collection_name = '&&cllctn' AND
  520.                c.collection_id = f.collection_number),
  521.         fetch_redo_size_min = 
  522.         (SELECT min(f.redo_size_end - f.redo_size_start)
  523.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  524.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  525.                c.collection_name = '&&cllctn' AND
  526.                c.collection_id = f.collection_number),
  527.         fetch_redo_size_max = 
  528.         (SELECT max(f.redo_size_end - f.redo_size_start)
  529.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  530.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  531.                c.collection_name = '&&cllctn' AND
  532.                c.collection_id = f.collection_number),
  533.         fetch_redo_size_avg = 
  534.         (SELECT avg(f.redo_size_end - f.redo_size_start)
  535.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  536.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  537.                c.collection_name = '&&cllctn' AND
  538.                c.collection_id = f.collection_number),
  539.         fetch_row_count = 
  540.         (SELECT sum(f.row_count_end)
  541.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  542.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  543.                c.collection_name = '&&cllctn' AND
  544.                c.collection_id = f.collection_number);
  545. COMMIT;
  546.  
  547. UPDATE &&dtl_table_name d
  548.     SET fetch_sort_mem_min = 
  549.         (SELECT min(f.sort_memory_end - f.sort_memory_start)
  550.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  551.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  552.                c.collection_name = '&&cllctn' AND
  553.                c.collection_id = f.collection_number),
  554.         fetch_sort_mem_max = 
  555.         (SELECT max(f.sort_memory_end - f.sort_memory_start)
  556.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  557.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  558.                c.collection_name = '&&cllctn' AND
  559.                c.collection_id = f.collection_number),
  560.         fetch_sort_mem_avg = 
  561.         (SELECT avg(f.sort_memory_end - f.sort_memory_start)
  562.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  563.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  564.                c.collection_name = '&&cllctn' AND
  565.                c.collection_id = f.collection_number),
  566.         fetch_sort_disk_min = 
  567.         (SELECT min(f.sort_disk_end - f.sort_disk_start)
  568.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  569.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  570.                c.collection_name = '&&cllctn' AND
  571.                c.collection_id = f.collection_number),
  572.         fetch_sort_disk_max = 
  573.         (SELECT max(f.sort_disk_end - f.sort_disk_start)
  574.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  575.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  576.                c.collection_name = '&&cllctn' AND
  577.                c.collection_id = f.collection_number),
  578.         fetch_sort_disk_avg = 
  579.         (SELECT avg(f.sort_disk_end - f.sort_disk_start)
  580.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  581.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  582.                c.collection_name = '&&cllctn' AND
  583.                c.collection_id = f.collection_number),
  584.         fetch_sort_rows_min = 
  585.         (SELECT min(f.sort_rows_end - f.sort_rows_start)
  586.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  587.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  588.                c.collection_name = '&&cllctn' AND
  589.                c.collection_id = f.collection_number),
  590.         fetch_sort_rows_max = 
  591.         (SELECT max(f.sort_rows_end - f.sort_rows_start)
  592.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  593.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  594.                c.collection_name = '&&cllctn' AND
  595.                c.collection_id = f.collection_number),
  596.         fetch_sort_rows_avg = 
  597.         (SELECT avg(f.sort_rows_end - f.sort_rows_start)
  598.          FROM v_192216243_f_5_e_10_7_3 f, epc_collection c
  599.          WHERE d.sql_text_hash = f.sql_text_hash_end AND
  600.                c.collection_name = '&&cllctn' AND
  601.                c.collection_id = f.collection_number);
  602. COMMIT;
  603.