Export and Import Table stats between databases

STEPS
Step1: Create a table to store the stats.
Step 2: Export the stats from the required table to the table created in step1.
Step3: Export the table using either exp or expdp from database 1
Step4: Import the table that contain stats into database2
Step5: Use dbms_stats to import the stats into database2
COMMANDS
exec dbms_stats.create_stat_table('APPS','OKC_K_ITEMS_TABLE_STATS')
exec dbms_stats.export_table_stats('OKC','OKC_K_ITEMS',null,'OKC_K_ITEMS_TABLE_STATS',null,true,'APPS')
exp apps file=exp_crp_stats.dmp tables=OKC_K_ITEMS_TABLE_STATS
imp apps file=exp_crp_stats.dmp full=y
exec dbms_stats.import_table_stats(OKC,'OKC_K_ITEMS',null,OKC_K_ITEMS_TABLE_STATS',null,true,'APPS')

No comments: