/*报错信息
Export file created by EXPORT:V11.02.00 via conventional path
import done in AL32UTF8 character set and AL16UTF16 NCHAR character set
export client uses ZHS16GBK character set (possible charset conversion)
. importing DRM_PFM's objects into DRM_PFM
. importing DRM_PFM's objects into DRM_PFM
. . importing table "T_TOPCOMMRL_REQUEST" 57273 rows imported
IMP-00017: following statement failed with ORACLE error 20005:
"BEGIN DBMS_STATS.SET_INDEX_STATS(NULL,'"PK_T_TOPCOMMRL_REQUEST_ID"',NULL,N"
"ULL,NULL,182998,2197,182998,1,1,182974,2,6); END;"
IMP-00003: ORACLE error 20005 encountered
ORA-20005: object statistics are locked (stattype = ALL)
ORA-06512: at "SYS.DBMS_STATS", line 2205
ORA-06512: at "SYS.DBMS_STATS", line 3003
ORA-06512: at "SYS.DBMS_STATS", line 7865
ORA-06512: at line 1
*/
/*
查询表统计信息是否被锁,并获取解锁执行语句
*/
select 'exec dbms_stats.unlock_table_stats(''' || user || ''',''' ||
table_name || ''');'
from user_tab_statistics
where stattype_locked is not null;
/*
通过sql 命令行执行解锁命令
*/
SQL> exec dbms_stats.unlock_table_stats('DRM_PFM','ASYNCHRONCW_REQUEST');
PL/SQL procedure successfully completed
转载于:https://my.oschina.net/fengzhi714/blog/2251094