数据库在使用DataPump导出时碰到了ORA-39125与ORA-04063。完整的ORA-39125提示是Worker unexpected fatal error in KUPW$WORKER.UNLOAD_METADATA while calling DBMS_METADATA.FETCH_XML_CLOB [OBJECT_GRANT:"GX_ADMIN"],在使用包DBMS_METADATA.FETCH_XML_CLOB时碰到错误。下面是对这个错误的解决过程。
1、产生ORA-39125与ORA-04063
oracle@linux-ejad:~> export ORACLE_SID=SZ4701
oracle@linux-ejad:~> expdp \'\/ as sysdba \' directory=db_dump_dir dumpfile=sz4701.dmp logfile=exp_4701.log schemas=gx_admin
Export: Release 10.2.0.3.0 - 64bit Production on Tuesday, 05 November, 2013 13:49:23
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Release 10.2.0.3.0 - 64bit Production
Starting "SYS"."SYS_EXPORT_SCHEMA_01": '/******** AS SYSDBA' directory=db_dump_dir dumpfile=sz4701.dmp logfile=exp_4701.log
schemas=gx_admin
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 447.8 MB
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/TABLESPACE_QUOTA
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/SYNONYM/SYNONYM
Processing object type SCHEMA_EXPORT/TYPE/TYPE_SPEC
Processing object type SCHEMA_EXPORT/TYPE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type SCHEMA_EXPORT/SEQUENCE/SEQUENCE
Processing object type SCHEMA_EXPORT/SEQUENCE/GRANT/OWNER_GRANT/OBJECT_GRANT
ORA-39125: Worker unexpected fatal error in KUPW$WORKER.UNLOAD_METADATA while calling DBMS_METADATA.FETCH_XML_CLOB
[OBJECT_GRANT:"GX_ADMIN"]
ORA-04063: view "SYS.KU$_CLUSTER_VIEW" has errors
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
ORA-06512: at "SYS.KUPW$WORKER", line 6234
----- PL/SQL Call Stack -----
object line object
handle number name
0x7605bab0 14916 package body SYS.KUPW$WORKER
0x7605bab0 6293 package body SYS.KUPW$WORKER
0x7605bab0 2339 package body SYS.KUPW$WORKER
0x7605bab0 6854 package body SYS.KUPW$WORKER
0x7605bab0 1259 package body SYS.KUPW$WORKER
0x835e2470 2 anonymous block
Job "SYS"."SYS_EXPORT_SCHEMA_01" stopped due to fatal error at 13:49:37
2、分析错误
oracle@linux-ejad:~> oerr ora 39125
39125, 00000, "Worker unexpected fatal error in %s while calling %s [%s]"
// *Cause: An unhandled exception was detected internally within the worker
// process for the Data Pump job while calling the specified external
// routine. This is an internal error. Additional information may be
// supplied.
// *Action: If problem persists, contact Oracle Customer Support.
--第一个ORA告诉我们是一个内部错误,联系Oracle Support
oracle@linux-ejad:~> oerr ora 04063
04063, 00000, "%s has errors"
// *Cause: Attempt to execute a stored procedure or use a view that has
// errors. For stored procedures, the problem could be syntax errors
// or references to other, non-existent procedures. For views,
// the problem could be a reference in the view's defining query to
// a non-existent table.
// Can also be a table which has references to non-existent or
// inaccessible types.
// *Action: Fix the errors and/or create referenced objects as necessary.
--第二个ORA给出了相对比较具体一些的信息,执行过程或使用试图时有一些错误发生。
--结合导出时的错误提示来看是系统过程和视图调用出现了问题
--Oracle Metalink Doc ID 742018.1 给出了针对这个问题的解决方案。
--通常是由于一个全新的安装而部分组件无效所致。需要重建相关数据字典。
3、解决故障
SQL> set linesize 190
SQL> col comp_id for a12;
SQL> col comp_name for a35;
SQL> col version for a12;
SQL> select comp_id, comp_name, version, status from dba_registry;
COMP_ID COMP_NAME VERSION STATUS
------------ ----------------------------------- ------------ ---------------------------------
OLS Oracle Label Security 10.2.0.3.0 VALID
EXF Oracle Expression Filter 10.2.0.3.0 VALID
OWM Oracle Workspace Manager 10.2.0.1.0 VALID
CATALOG Oracle Database Catalog Views 10.2.0.3.0 INVALID
CATPROC Oracle Database Packages and Types 10.2.0.3.0 INVALID
JAVAVM JServer JAVA Virtual Machine 10.2.0.3.0 VALID
XML Oracle XDK 10.2.0.3.0 VALID
CATJAVA Oracle Database Java Packages 10.2.0.3.0 VALID
--从上面的查询可知,当前有2个组件处于INVALID状态
--下面直接列出meatlink给出关于这个问题的解决步骤
cd $ORACLE_HOME/rdbms/admin
SQL> startup restrict
SQL> select count(*) from dba_objects where status='INVALID';
SQL> @catalog
SQL> @catproc
SQL> @utlrp <== To compile the invalid objects
SQL> select count(*) from dba_objects where status='INVALID';
col comp_id for a12
col comp_name for a30
col version for a12
select comp_id, comp_name, version, status from dba_registry;
SQL> shutdown immediate
SQL> startup
--完成上面的操作后,再次导出成功。
--注,重建数据字典动作较大,建议先备份数据库后再操作
更多参考
有关Oracle RAC请参考
使用crs_setperm修改RAC资源的所有者及权限
使用crs_profile管理RAC资源配置文件
RAC 数据库的启动与关闭
再说 Oracle RAC services
Services in Oracle Database 10g
Migrate datbase from single instance to Oracle RAC
Oracle RAC 连接到指定实例
Oracle RAC 负载均衡测试(结合服务器端与客户端)
Oracle RAC 服务器端连接负载均衡(Load Balance)
Oracle RAC 客户端连接负载均衡(Load Balance)
ORACLE RAC 下非缺省端口监听配置(listener.ora tnsnames.ora)
ORACLE RAC 监听配置 (listener.ora tnsnames.ora)
配置 RAC 负载均衡与故障转移
CRS-1006 , CRS-0215 故障一例
基于Linux (RHEL 5.5) 安装Oracle 10g RAC
使用 runcluvfy 校验Oracle RAC安装环境
有关Oracle 网络配置相关基础以及概念性的问题请参考:
配置非默认端口的动态服务注册
配置sqlnet.ora限制IP访问Oracle
Oracle 监听器日志配置与管理
设置 Oracle 监听器密码(LISTENER)
配置ORACLE 客户端连接到数据库
有关基于用户管理的备份和备份恢复的概念请参考
Oracle 冷备份
Oracle 热备份
Oracle 备份恢复概念
Oracle 实例恢复
Oracle 基于用户管理恢复的处理
SYSTEM 表空间管理及备份恢复
SYSAUX表空间管理及恢复
Oracle 基于备份控制文件的恢复(unsing backup controlfile)
有关RMAN的备份恢复与管理请参考
RMAN 概述及其体系结构
RMAN 配置、监控与管理
RMAN 备份详解
RMAN 还原与恢复
RMAN catalog 的创建和使用
基于catalog 创建RMAN存储脚本
基于catalog 的RMAN 备份与恢复
RMAN 备份路径困惑
使用RMAN实现异机备份恢复(WIN平台)
使用RMAN迁移文件系统数据库到ASM
linux 下RMAN备份shell脚本
使用RMAN迁移数据库到异机
有关ORACLE体系结构请参考
Oracle 表空间与数据文件
Oracle 密码文件
Oracle 参数文件
Oracle 联机重做日志文件(ONLINE LOG FILE)
Oracle 控制文件(CONTROLFILE)
Oracle 归档日志
Oracle 回滚(ROLLBACK)和撤销(UNDO)
Oracle 数据库实例启动关闭过程
Oracle 10g SGA 的自动化管理
Oracle 实例和Oracle数据库(Oracle体系结构)