11i - 12 Gather Schema Statistics fails with Ora-20001 errors after 11G database Upgrade (文档 ID 781813.1) | 转到底部 |
In this Document
APPLIES TO:Oracle Applications Technology Stack - Version 11.5.10.2 to 12.1.3 [Release 11.5.10 to 12.1] SYMPTOMS"Gather Schema Statistics" program reported following errors in request log files: Error #1: ERROR: While GATHER_TABLE_STATS: Error #4: ERROR: While GATHER_TABLE_STATS: object_name=FII.FII_FIN_ITEM_HIERARCHIES***ORA-20001: invalid column name or duplicate columns/column groups/expressions in method_opt*** CHANGESProblem started after database has been upgraded to 11G. CAUSEThere are two reasons for that error message: 1 ) There are duplicate rows on FND_HISTOGRAM_COLS table for JE_BE_LINE_TYPE_MAP table. The following SQL should return one row, not two: SQL>select column_name, nvl(hsize,254) hsize COLUMN_NAME HSIZE Since there are two rows in histograms table, FND_STATS creates following command to gather statistics on table ‘JE_BE_LINE_TYPE_MAP‘ : dbms_Stats.gather_table_stats(OWNNAME => ‘GL‘, TABNAME Above command will work on 9i and 10G databases but it will fail with ora-20001 errors on 11G. 2) Column does not exist on the table but still listed in FND_HISTOGRAMS_COL table. You can use following SQL to identify. SQL will prompt for table name, use table name from the errors. In above examples you can use FII_FIN_ITEM_HIERARCHIES. select hc.table_name, hc.column_name SOLUTIONFind out all duplicates and/or obsolete rows in FND_HISTOGRAM_COLS and delete one of them logged in as the applsys user. -- identify duplicate rows select table_name, column_name, count(*) -- Use above results on the following SQL to delete duplicates delete from FND_HISTOGRAM_COLS -- Use following SQL to delete obsoleted rows delete from FND_HISTOGRAM_COLS commit; |