EXP-00008: ORACLE error 904 encountered的解決方法
2024-08-29 13:29:40
供稿:網友
 
【錯誤情況】 
[[email protected] admin]$ exp wmap/[email protected]
export: release 8.1.7.4.0 - production on fri oct 8 11:28:37 2004
(c) copyright 2000 oracle corporation.  all rights reserved.
connected to: oracle9i release 9.2.0.1.0 - production
jserver release 9.2.0.1.0 - production
enter array fetch buffer size: 4096 > 
export file: expdat.dmp > host     
(2)u(sers), or (3)t(ables): (2)u > u
export grants (yes/no): yes > 
export table data (yes/no): yes > 
compress extents (yes/no): yes > 
export done in we8iso8859p1 character set and utf8 nchar character set
server uses zhs16gbk character set (possible charset conversion)
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user wmap 
. exporting object type definitions for user wmap 
about to export wmap's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export wmap's tables via conventional path ...
exp-00008: oracle error 904 encountered
ora-00904: "spolicy": invalid identifier
exp-00000: export terminated unsuccessfully
[[email protected] admin]$ 
【解決方法一】 
bookmark go to end 
 
fact: oracle server - enterprise edition
symptom: ora-00904: invalid column name
symptom: exp-00008: oracle error %s encountered
cause: the package is missing, invalid or corrupt
 
fix:
how to handle ora-00904 errors on export
========================================
when running full database export the following errors will be returned:
exp80 user/password full=y file=d:/db-backup/orcl/exporcl.dmp
log=d:/db-backup/orcl/exporcl.log consistent=y buffer=40960000
    exp-00008: oracle error 904 encountered
    ora-00904: invalid column name
 
to get a clue what has force these ora-00904 message, follow the following
steps:
1. connect as privileged user and run the following command inside an 
   sqlplus session:
 
   sql> alter system set events='904 trace name errorstack';
   -------------------------------- note ------------------------------------
   this event will work starting with oracle8i. if running a oracle database 
   version below oracle8i, you'll get ora-02065 errors returned, when 
   specifying this event. in oracle versions below 8i you'll have to insert 
   the following entry into init.ora
   event="904 trace name errorstack"
   
   --------------------------------------------------------------------------
 
2. retry the full export. when the ora-00904 occurs, a trace file will be
   written to the storage location specified by the init.ora parameter
   'user_dump_dest'. as soon as the ora-00904 has been returned to your
   export session, you can abort the export and examine the trace information.
3. disable event tracing by running the following command:
 
   sql> alter system set events='904 trace name errorstack off';
   on oracle versions below 8.1.5 return the event entry from init.ora
4. examine the trace file:
   *** session id:(9.3) 2001.11.21.15.28.00.494
   *** 2001.11.21.15.28.00.494
   ksedmp: internal or fatal error
   ora-00904: invalid column name
   current sql statement for this session:
   select fname,fsize,maxextend,inc from sys.exu8fil where tsid = :1
                                         ===========
   a) a problem with object exu8fil has been detected
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   in this example, there's a problem with the exe8fil view. to examine,
   whether this object exist, run the following command:
   sql> select owner,object_name,object_type,object_id,status
        from   dba_objects
        where  object_name='exu8fil';
   if the problem is on the exu8fil object you simply can recreate the 
   object by running the catexp.sql script.
   b) a problem with object dbms_java or dbms_java_test
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   ksedmp: internal or fatal error
   ora-00904: invalid column name
   current sql statement for this session:
   select synnam, dbms_java.longname(synnam), dbms_java.longname(syntab), ...
   on systems where the java server has been installed the trace file could
   contain information on a failing select statement on dbms_java packages.
   for reference on fixing errors relating to dbms_java, please follow 
   <note:1017276.102>.
 【解決方法二】 
if this error (ora-904 invalid column name) occurs after applying a patch, this would probably fix the problem. 
1. first, run catexp as internal. then retry the export. often times this will fix the problem and then export will run without error. the reason being a problem with object exu8fil view has been detected. 
to examine, whether this object exist, run the following command: 
sql> select owner,object_name,object_type,object_id,status 
from dba_objects 
where object_name='exu8fil'; 
if the problem is on the exu8fil object you simply can recreate the object by running the catexp.sql script.