Skip to Main Content

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question, Krithika.

Asked: October 13, 2016 - 9:02 am UTC

Last updated: October 13, 2016 - 1:26 pm UTC

Version: 11.2

Viewed 1000+ times

You Asked

Dear Tom,

Please help me with the below

1) I did full dump restoration from prod to test environment
2) Now I'm trying to import the prod stats to test environment
3) Created STAT_TABLE in the newly imported test environment like below

begin
dbms_stats.CREATE_STAT_TABLE(
ownname=>'test' ,
stattab=>'STATS');
end;
/

impdp dumpfile=full_stats.dp TABLES=prod.stats content=data_only logfile=stats.log directory=DTPUMP_STATS remap_schema=prod:test

Am getting below error

ORA-39002: invalid operation
ORA-39166: Object prod.stats not found

Kindly clarify me on the above

Also please explain me whether we have to be sure about stats table whether it ll be present in prod user or not.

Thanks

and Chris said...

Have you created the stats table in your production DB and exported the stats to it using dbms_stats.export_database_stats?

And included the table in the export?

In any case, the import should include the table statistics without you needing to create a stat table. Unless you've excluded them!

You can validate this by running:

select * from user_tab_statistics


In your environments and checking they match.

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Krithika, October 18, 2016 - 3:35 pm UTC

Thanks a lot for the reply and sorry for the late reply!

It is verry useful...


Thanks

More to Explore

Data Pump

All of the database utilities including Data Pump are explained in the Utilities guide.