I have some code running on Oracle 11g, we are migrating to 12c (12.2.0.1.0).
In one of the processing procedure DBMS_STATS.IMPORT_TABLE_STATS is invoked and in stattab parameter name of the view is provided.
The view is a simple select query from one table, one column is computed by decode function, other are taken as they are in the source column. The user that invokes IMPORT_TABLE_STATS is the owner of the destination table, view and table under the view.
In 11g code is working, in 12c I receive following error:
ORA-20000: Object does not exist or insufficient privileges.
Any ideas about reason? Are there changes in 12c version of DBMS_STATS implementation, that forbids the use of view as a source for IMPORT_TABLE_STATS?
DMBS_STATSand found out thatIMPORT_TABLE_STATSaccepts a view instead of the officialCREATE_STAT_TABLEtable, and now are unhappy that this hack doesn't work in 12.2. Having said that, I find such creativity impressive and certainly worth some investigation. - wolφi