Showing posts with label oracle export import statistics example. Show all posts
Showing posts with label oracle export import statistics example. Show all posts

Sunday, September 12, 2010

How to export import table statistics from one table to another?

Export statistics from one table:-

exec dbms_stats.create_stat_table('SCHEMA_USR','STATS_STORE_TABLE');

exec dbms_stats.export_table_stats (ownname => 'SCHEMA_USR', tabname => 'TAB_WITH_STATS', stattab => 'STATS_STORE_TABLE', cascade => true, statown => 'SCHEMA_USR');

Update table name in stats table

update SCHEMA_USR.STATS_STORE_TABLE set C1 = 'TAB_WITHOUT_STATS' ;

IMPORT stats to another table :-

exec dbms_stats.import_table_stats (ownname => 'SCHEMA_USR', tabname => 'TAB_WITHOUT_STATS', stattab => 'STATS_STORE_TABLE', cascade => true, statown => 'SCHEMA_USR');

exec dbms_stats.drop_stat_table('SCHEMA_USR','STATS_STORE_TABLE');