Last active
December 28, 2015 07:09
-
-
Save sytkov/7462255 to your computer and use it in GitHub Desktop.
Gather table stats
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare | |
v_owner varchar2(4000) := '?'; | |
type t_varchar2_tab is table of varchar2(4000); | |
v_tables t_varchar2_tab := t_varchar2_tab( | |
'?', | |
'?' | |
); | |
begin | |
for i in 1..v_tables.count loop | |
dbms_stats.gather_table_stats( | |
ownname => v_owner, | |
tabname => v_tables(i), | |
estimate_percent => DBMS_STATS.AUTO_SAMPLE_SIZE, | |
method_opt => 'FOR ALL COLUMNS SIZE AUTO', | |
cascade => TRUE | |
); | |
end loop; | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment