Export import statistics in Oracle

  1. Create Statistics table
exec dbms_stats.create_stat_table(ownname => 'SCOTT', stattab => 'STAT_BACKUP',tblspace=>'USERS');

2. Export the Stats of Schema or table


For Schema:
exec dbms_stats.export_schema_stats(ownname => 'SCOTT',stattab => 'STAT_BACKUP');

For Table:
exec dbms_stats.export_table_stats(ownname => 'SCOTT',tabname => 'EMPLOYEES',stattab => 'STAT_BACKUP');

3. Import the Stats of Schema or Table

For Schema Stats:
exec dbms_stats.import_schema_stats(ownname => 'SCOTT',stattab => 'STAT_BACKUP');

For Table Stats:
exec dbms_stats.import_table_stats(ownname => 'SCOTT',tabname => 'EMPLOYEES',stattab => 'STAT_BACKUP');

4. Drop Stats table if not required.


exec dbms_stats.drop_stat_table(ownname => 'SCOTT', stattab => 'STAT_BACKUP');
This entry was posted in Oracle on by .
Unknown's avatar

About SandeepSingh

Hi, I am working in IT industry with having more than 15 year of experience, worked as an Oracle DBA with a Company and handling different databases like Oracle, SQL Server , DB2 etc Worked as a Development and Database Administrator.

Leave a Reply