|
- select
- dbms_stats.get_prefs(pname => 'STALE_PERCENT')
-
- from dual;
-
- begin
- dbms_stats.set_global_prefs(pname => 'STALE_PERCENT',
- pvalue => 15);
- end;
-
-
-
- begin
- dbms_stats.set_table_prefs(ownname => 'HR',
- tabname => 'EMPLOYEES',
- pname => 'STALE_PERCENT',
- pvalue => 13);
- end;
-
-
- select * from dba_tab_stat_prefs;
-
复制代码- select * from dba_tab_stat_prefs;
- select * from dba_tab_pending_stats;
- begin
- dbms_stats.set_table_prefs('STATS',tabname => 'TABJFV',pname => 'PUBLISH',
- pvalue => 'FALSE');
- end;
-
- select * from dba_tab_stat_prefs;
-
- select t.num_rows,t.last_analyzed from dba_tables t where t.table_name='TBJFV';
-
- select i.last_analyzed from dba_indexes i where i.table_name='TABJFV';
-
-
- select * from dba_tab_col_statistics tcs
- where tcs.table_name='TABJFV';
-
- begin
- dbms_stats.gather_table_stats('STATS','TABJFV',estimate_percent => 100,
- method_opt => 'for all columns size 1 for columns c2 size 254 for columns c3 size 254');
- end;
-
- -------
-
- select * from dba_tab_pending_stats;
-
- select * from dba_col_pending_stats;
-
-
- -----------------
-
- select * from dba_stat_extensions;
-
- select dbms_stats.create_extended_stats('STATS','TABJFV','(c1,c2)' )
- from dual;
-
- begin
- dbms_stats.gather_table_stats ('STATS','TABJFV',
- method_opt =>'for columns (c1,c2) size 254');
- end;
-
-
- select * from dba_tab_col_statistics tcs
- where tcs.table_name='TABJFV';
-
- ------------
- select * from dba_col_pending_stats;
- -----------
- begin
- dbms_stats.gather_table_stats('STATS','TABJFV',estimate_percent => 100,
- method_opt => 'for all columns size 1 for columns c2 size 254 for columns c3 size 254');
- end;
- ----
-
- begin
- dbms_Stats.publish_pending_stats(ownname => 'STATS',tabname => 'TABJFV');
- end;
-
- ----
- begin
- dbms_stats.set_table_prefs('STATS',tabname => 'TABJFV',pname => 'PUBLISH',
- pvalue => 'TRUE');
- end;
-
复制代码
|
|