现象:exp时报错,如下:
[oracle@cicgo1 oracle]$ exp system/pass owner=cicgo file=/tmp/cicgo.dmp
Export: Release 8.1.7.4.0 - Production on Tue Apr 23 15:07:17 2013
(c) Copyright 2000 Oracle Corporation. All rights reserved.
Connected to: Oracle8i Release 8.1.7.4.0 - Production
JServer Release 8.1.7.4.0 - Production
Export done in US7ASCII character set and ZHS16GBK NCHAR character set
server uses ZHS16GBK character set (possible charset conversion)
About to export specified users ...
. exporting pre-schema procedural objects and actions
EXP-00008: ORACLE error 6550 encountered
ORA-06550: line 1, column 13:
PLS-00201: identifier 'ORDSYS.ORDTEXP' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
EXP-00083: The previous problem occurred when calling ORDSYS.ORDTEXP.schema_info_exp
. exporting foreign function library names for user cicgo
. exporting object type definitions for user cicgo
About to export cicgo's objects ...
. exporting database links
. exporting sequence numbers
EXP-00008: ORACLE error 904 encountered
ORA-00904: invalid column name
EXP-00000: Export terminated unsuccessfully
分析:
1.经查看 数据库中没有无效对象:
SQL> SELECT status, object_id, object_type, owner||'.'||object_name "OWNER.OBJECT"
FROM dba_objects
WHERE status != 'VALID'
ORDER BY 4,2; 2 3 4
2.根据文档Full Database Export Fails with EXP-00008: ORACLE error 6550 encountered (Doc ID 120540.1)的描述:
fact: Oracle Server - Enterprise Edition 8
fact: Oracle Server - Enterprise Edition 9
fact: Export Utility (EXP)
symptom: Full database export fails
symptom: EXP-00008: ORACLE error 6550 encountered
symptom: PLS-00201: identifier 'ORDSYS.ORDTEXP' must be declared
symptom: EXP-00083: The previous problem occurred when calling ORDSYS.
ORDTEXP.schema_info_exp
cause: User ORDSYS has been dropped. If Time Series option was installed,
<====该处说明造成exp失败原因为:用户ORDSYS被删除了,单Oracle字典表exppkgact$的信息却没有被更新到一致,因此造成exp时失败
据此推测造成这种现象有2种根本原因:
1.Oracle的BUG导致drop user时字典表exppkgact$未更新;
2.用户使用不正确的方式删除了用户。
fix:
Drop import/export support for Time Series
------------------------------------------
delete from sys.exppkgact$
where package = 'ORDTEXP' and
schema = 'ORDSYS'; <===此处说明了解决办法:delete掉exppkgact$中不一致的记录
commit;
按照Oracle提供的办法delete了字典表exppkgact$的相关记录:
SQL> delete from sys.exppkgact$
where package = 'ORDTEXP' and
schema = 'ORDSYS'; 2 3
1 row deleted.
SQL> commit;
Commit complete.
但执行exp时仍然报错:
[oracle@cicgo1 scripts]$ exp system/pass owner=cicgo file=/tmp/cicgo.dmp direct=y
Export: Release 8.1.7.4.0 - Production on Tue Apr 23 16:00:42 2013
(c) Copyright 2000 Oracle Corporation. All rights reserved.
Connected to: Oracle8i Release 8.1.7.4.0 - Production
JServer Release 8.1.7.4.0 - Production
Export done in ZHS16GBK character set and ZHS16GBK NCHAR character set
About to export specified users ...
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user cicgo
. exporting object type definitions for user cicgo
About to export cicgo's objects ...
. exporting database links
. exporting sequence numbers
EXP-00008: ORACLE error 904 encountered
ORA-00904: invalid column name
EXP-00000: Export terminated unsuccessfully
[oracle@cicgo1 scripts]$
发现这次未再报错ORA-06550了,只报了ORA-00904: invalid column name,到底是内部的什么SQL导致ORA-00904了,我使用了errorstack trace:
1.alter system set events '904 trace name ERRORSTA