import_schema_stats時報出ORA-20000:

tingsheng發表於2010-11-30
今天在執行import_schema_stats報瞭如下錯

SQL>@imp_schema_stats.sql

Session altered.

old   3:        wnname => '&u',
new   3:        wnname => 's500',
old   5:        statown => '&u');
new   5:        statown => 's500');
begin
*
ERROR at line 1:
ORA-20000: no statistics are imported
ORA-06512: at "SYS.DBMS_STATS", line 10604
ORA-06512: at line 2

經查,由於我把統計資訊表dictstattab建立在s500下,所以在使用export出來的統計資訊import時導致找不到dictstattab自身的統計資訊,因此報錯。換了import_table_stats後工作正常。

SQL> @delete_schema_stats.sql

Session altered.

old   2:   dbms_stats.delete_schema_stats('&user');
new   2:   dbms_stats.delete_schema_stats('s500');

PL/SQL procedure successfully completed.

SQL> @impstats_s500.sql


Session altered.

old   3:      wnname=>'&u',
new   3:      wnname=>'s500',
old   4:      tabname=>'&t',
new   4:      tabname=>'CUSTOMER',

PL/SQL procedure successfully completed.

old   3:      wnname=>'&u',
new   3:      wnname=>'s500',
old   4:      tabname=>'&t',
new   4:      tabname=>'DISTRICT',

PL/SQL procedure successfully completed.

old   3:      wnname=>'&u',
new   3:      wnname=>'s500',
old   4:      tabname=>'&t',
new   4:      tabname=>'HISTORY',

PL/SQL procedure successfully completed.


old   3:      wnname=>'&u',
new   3:      wnname=>'s500',
old   4:      tabname=>'&t',
new   4:      tabname=>'ITEM',

PL/SQL procedure successfully completed.

old   3:      wnname=>'&u',
new   3:      wnname=>'s500',
old   4:      tabname=>'&t',
new   4:      tabname=>'NEW_ORDERS',

PL/SQL procedure successfully completed.

old   3:      wnname=>'&u',
new   3:      wnname=>'s500',
old   4:      tabname=>'&t',
new   4:      tabname=>'ORDERS',

PL/SQL procedure successfully completed.

old   3:      wnname=>'&u',
new   3:      wnname=>'s500',
old   4:      tabname=>'&t',
new   4:      tabname=>'ORDER_LINE',

PL/SQL procedure successfully completed.

old   3:      wnname=>'&u',
new   3:      wnname=>'s500',
old   4:      tabname=>'&t',
new   4:      tabname=>'STOCK',

PL/SQL procedure successfully completed.

old   3:      wnname=>'&u',
new   3:      wnname=>'s500',
old   4:      tabname=>'&t',
new   4:      tabname=>'WAREHOUSE',

PL/SQL procedure successfully completed.

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7734298/viewspace-680687/,如需轉載,請註明出處,否則將追究法律責任。

相關文章