首页 > 数据库 >Oracle重建data pump(expdpd,impdp)How To Reload Datapump Utility EXPDP/IMPDP (Doc ID 430221.1)

Oracle重建data pump(expdpd,impdp)How To Reload Datapump Utility EXPDP/IMPDP (Doc ID 430221.1)

时间:2023-06-09 10:14:27浏览次数:60  
标签:expdpd impdp EXPDP rdbms -- admin sql ORACLE HOME

APPLIES TO:

Oracle Database Exadata Express Cloud Service - Version N/A and later
Oracle Database Backup Service - Version N/A and later
Oracle Database - Enterprise Edition - Version 10.1.0.2 and later
Oracle Database Cloud Schema Service - Version N/A and later
Gen 1 Exadata Cloud at Customer (Oracle Exadata Database Cloud Machine) - Version N/A and later
Information in this document applies to any platform.

GOAL

How to reload DATAPUMP utility? This may be required in different situations, like hanging issues, internal errors, data dictionary incompatibility, etc, all of them related to initiating phase of DataPump.

 

SOLUTION

 

In some cases DataPump utility may get corrupted and we need to recreate DataPump utility to overcome internal corruption. To do this, run specified scripts for Oracle version that you are running as given below. In a RAC environment, run the scripts only on one instance.

Note:  Run the following as sysdba user:

SQL> connect / as sysdba


For Oracle version 10.1 :

-- 1. Catdp.sql orders the installation of all its components including the Metadata API which was previously installed separately. SQL> @$ORACLE_HOME/rdbms/admin/catdp.sql


-- 2. dbmspump.sql will create DBMS procedures for DATAPUMP

SQL> @$ORACLE_HOME/rdbms/admin/dbmspump.sql

 
For Oracle version 10.2:

-- 1. Catdph.sql will Re-Install DataPump types and views

SQL> @$ORACLE_HOME/rdbms/admin/catdph.sql


-- Note:
-- If XDB is installed, then it is required to run "catmetx.sql" script also.
-- Use this code to verify if XDB is installed:

SQL> select substr(comp_name,1,30) comp_name,
     substr(comp_id,1,10) comp_id,
     substr(version,1,12) version,
     status
     from dba_registry;

-- Sample output if XDB installed,
Oracle XML Database    XDB    -version-    VALID


-- 2.prvtdtde.plb will re-install tde_library packages

SQL> @$ORACLE_HOME/rdbms/admin/prvtdtde.plb


-- 3. Catdpb.sql will Re-Install DataPump packages

SQL> @$ORACLE_HOME/rdbms/admin/catdpb.sql


-- 4.Dbmspump.sql will Re-Install DBMS DataPump objects

SQL> @$ORACLE_HOME/rdbms/admin/dbmspump.sql


-- 5. To recompile  invalid objects, if any

SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql

 
For Oracle version 11g and higher prior to 12c:

 

 

-- 1. Run catproc script, Catproc.sql

For running catproc.sql, please refer to


Note:863312.1 - Best Practices for running catalog, catproc and utlrp script

  

NOTE: IMPORTANT!

The catproc script should be run after the database has been opened with STARTUP UPGRADE.
The catproc script should NOT be run when the database is opened with unrestricted access. This can cause the database to experience performance issues, invalid objects and can even lead to a hanging situation.

 

  
 

 



-- 2.To recompile invalid objects, if any

SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql

 

 

Note: For Oracle release 12.1.0.1, there is no dpload.sql in $ORACLE_HOME/rdbms/admin.
To reload DataPump in Oracle release 12.1.0.1, please use the above steps shown for "For Oracle version 11g and higher prior to 12c".

 

 

For Oracle version 12c:

Note 1: Prior rebuilding DP catalog in 12.1.0.2 CDB , install Patch 25139545 as alerted in Document 2175021.1 - "Alert - Multitenant Customers: The objects created by the post-install steps of 12.1.0.2 Generic DataPump Patches Are not Shared Across All PDBS".             Failure of Datapatch on Multitenant Environment Can Cause DataPump Dictionary Inconsistency in Pluggable Database (PDB), see Document 2327652.1. Note 2:  For issues regarding KU$ Invalid Objects Owned by SYS after upgrading or applying datapatch, refer to Document 2289785.1 to rebuild Datapump.

 

On Multitenant Environment, for Oracle versions 12.1, 12.2, 18c, 19c, 21c, and 23c:

-- 1. To rebuild the DataPump packages with the following steps.

Under the ORACLE_HOME, execute:
cd rdbms/admin

-- run the dpload.sql in the CDB with all of the PDBs open, as described in "How to execute sql scripts in Multitenant environment (catcon.pl)" NOTE 1932340.1

Syntax:
$ORACLE_HOME/perl/bin/perl catcon.pl -d /u01/oracle -l <logging directory> -b <prefix for logfile of dpload for each PDB> dpload.sql

 
Where:
-l - directory to use for spool log files; for example, /tmp
-b - base name for log and spool file names; for example, dp_rebuild_log_base_name

For example, at OS prompt

cd $ORACLE_HOME/rdbms/admin

$ORACLE_HOME/perl/bin/perl catcon.pl -d /u01/oracle -l /tmp -b dp_rebuild_log_base_name dpload.sql

NOTE: After dpload.sql is run via caton.pl, to recompile any invalid objects, utlrp.sql can be run in all containers vi catcon.pl as well, e.g.

host perl $ORACLE_HOME/rdbms/admin/catcon.pl -n 1 -l /path_for_logs -b name_for_logs $ORACLE_HOME/rdbms/admin/utlrp.sql;
This command can be run several times to compile objects which did not get processed during the first run.

Also, if there are Data Pump components that are still invalid in any one container, utlrp.sql can be run individually in that container, e.g.

connect / as sysdba
alter session set container = <PDB_NAME>
@utlrp.sql

 

On Non-Multitenant Environment, for Oracle version 12c and higher:

-- 1. Rebuild the DataPump packages with the following steps.

Under the ORACLE_HOME, execute:
cd rdbms/admin

-- run SQL*Plus as sysdba

@dpload.sql

 

-- 2. To recompile  invalid objects, if any

SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql

 

Additional Resources

Community: Database Utilities

Still have questions? Use the above community to search for similar discussions or start a new discussion on this subject.

标签:expdpd,impdp,EXPDP,rdbms,--,admin,sql,ORACLE,HOME
From: https://www.cnblogs.com/muzisanshi/p/17468357.html

相关文章

  • 【Oracle impdp/expdp】Big lesson from failure with impdp/expdp in 12c
     最近忙于做数据库12c-19c迁移,基于公司的情况,选用了最拿手的expdp/impdporacle自带的王者级别工具进行迁移。按照常规思路,一顿操作猛如虎,expdp直接选用full=y将数据全库导出,然后在19c中导入,无论是12c中的导出还是19c中的导入数据,没有任何的错误,然而在无意间,反过来去检查下两......
  • expdp 导出缓慢
    expdp导出缓慢查询等待事件,目前导出的等待事件是:selectinst_id,sql_id,event,count(*)fromgv$sessionwherewait_class<>'Idle'groupbyinst_id,sql_id,eventorderbycount(*)desc;INST_IDEVENTCOUNT(1)---------......
  • expdp同一个用户下的多表导出导入
    expdpexpuser/oracleparfile=exptable.parcontent=metadata_onlycluster=n编辑exptable.par文件moreexptable.pardumpfile=mdm.dmplogfile=mdm.logschemas=mdmdirectory=expdp_dmpexclude=statisticsflashback_scn=3523577018PARALLEL=4COMPRESSION=allinclude=TA......
  • expdp 报错ORA-7445 的一个问题展开
    某客户说一套数据库由于非正常关机重启之后,进行数据导出发现报错,expdp无法正常工作,报错之后直接退出:处理对象类型SCHEMA_EXPORT/JOB..导出了"STATS"."T_REPORT_MONTH_TEMPS"988.2MB1292221行ORA-39014:一个或多个......
  • Oracle系列---【oracle使用expdp和impdp实现导入导出】
    一、前提条件两个数据版本和字符集还有语言得一致。#查看数据库版本号selectversionfromv$instance;#查看语言和字符集selectuserenv('language')fromdual;二、创建临时表空间MY_TEMPsu-oraclesqlplus/assysdba;SQL>CREATEDIRECTORYMY_TEMPAS'/OPT/TEM......
  • Oracle使用Impdp导入dmp文件的详细过程
    这一天为了导入这个Oracle的dmp文件,简直就是血泪史,因本人对Oracle并不是很会,随意踩了很多小白会踩的坑,因此特意记录一下过程,防备下次的使用。1、首先将你需要的dmp文件准备好,将其放在Oracle安装目录的任意位置,但是如果你想按照我的步骤来,就和我安装到相同的目录,否则会和第五步的......
  • Oracle使用expdp数据泵导出多张表
    由于需要导出的表数量较多,这里要用到include参数。一、exclude/include参数用法:   EXCLUDE=[object_type]:[name_clause],[object_type]:[name_clause]  -->排出特定对象   INCLUDE=[object_type]:[name_clause],[object_type]:[name_clause]  -->包含特定对象 ......
  • oracle导出impdp导入已存在表设置TABLE_EXISTS_ACTION参数
    目录oracle导出impdp导入已存在表设置TABLE_EXISTS_ACTION参数1、TABLE_EXISTS_ACTION参数说明2、使用示例oracle导出impdp导入已存在表设置TABLE_EXISTS_ACTION参数1、TABLE_EXISTS_ACTION参数说明有四个参数:skip:默认操作,跳过已存在的表不做处理。append:在原有的数据上追加......
  • oracle数据库按用户备份恢复,使用 expdp、impdp
    1,在数据库本机执行su-oracle切换oracle用户sqlplys/assysdba使用超级用户登select*fromdba_directories;查看管理员目录,一般会存在几个。2,导出命令,expdpuser/passwd@orclschemas=userdumpfile=expdp.dmpdirectory=DATA_PUMP_DIRlogfile=expdp.log##......
  • Oracle 停止impdp或expdp过程
    Oracle在执行impdp或expdp过程中如果不想执行按Ctrl+C中断,但进程并未中断仍在后台运行,可以看导出的文件大小一直在长expdp正确停止过程:1.查看正在运行的job,可以发现自己的job还在执行select*fromdba_datapump_jobs;2.根据上面job_name进入到刚才执行的expdp下expdpsy......