|
本帖最后由 botang 于 2016-9-12 10:21 编辑
手工周期捕获 STS:
- BEGIN
- dbms_sqltune.create_sqlset(sqlset_name => 'XXX', sqlset_owner =>'SYSTEM');
- END;
- /
- DECLARE
- bf VARCHAR2(110);
- BEGIN
- bf := q'#UPPER(PARSING_SCHEMA_NAME) = 'APPS' AND UPPER(SQL_TEXT) NOT LIKE 'APPLICAT%' AND UPPER(MODULE) = 'DWH_TEST%' #';
- dbms_sqltune.capture_cursor_cache_sqlset( sqlset_name=>'XXX', time_limit=>'360',
- repeat_interval=>'5',
- basic_filter=>bf,
- sqlset_owner=>'SYSTEM');
- END;
- /
复制代码
练习查看执行计划步骤顺序:
- explain plan for
- SELECT c.cust_city, t.calendar_quarter_desc, SUM(s.amount_sold) sales_amount
- FROM sh.sales s, sh.times t, sh.customers c, sh.channels ch
- WHERE s.time_id = t.time_id AND s.cust_id = c.cust_id AND s.channel_id = ch.channel_id
- AND c.cust_state_province = 'FL'
- AND ch.channel_desc = 'Direct Sales'
- AND t.calendar_quarter_desc IN ('2000-01', '2000-02','1999-12') GROUP BY c.cust_city,
- t.calendar_quarter_desc;
复制代码
- select substr(t.table_name,3,1),count(*) from dba_tables t where t.tablespace_name='SYSAUX'
- and t.table_name like 'WR_$\_%' escape '\'
- group by substr(t.table_name,3,1);
复制代码
|
|