`
realnicky
  • 浏览: 61645 次
  • 来自: 杭州
社区版块
存档分类
最新评论

How To Cleanup Orphaned DataPump Jobs In DBA_DATAPUMP_JOBS

 
阅读更多

 

How To Cleanup Orphaned DataPump Jobs In DBA_DATAPUMP_JOBS ?

How To Cleanup Orphaned DataPump Jobs In DBA_DATAPUMP_JOBS ? 文档 ID: 336014.1 类型: HOWTO Modified Date: 05-MAR-2008 状态: PUBLISHED

In this Document
  Goal
  Solution
  References


 

 

Applies to:Enterprise Manager for RDBMS - Version: 10.1 to 11.1
- Enterprise Edition - Version: 10.1 to 11.1
Oracle Server - Personal Edition - Version: 10.1 to 11.1
Oracle Server - Standard Edition - Version: 10.1 to 11.1
Information in this document applies to any platform.
GoalHow to cleanup orphaned Data Pump jobs in DBA_DATAPUMP_JOBS ? Solution

The jobs used in this example:
- Export job SCOTT.EXPDP_20051121 is a schema level export that is running
- Export job SCOTT.SYS_EXPORT_TABLE_01 is an orphaned table level export job
- Export job SCOTT.SYS_EXPORT_TABLE_02 is a table level export job that was stopped
- Export job SYSTEM.SYS_EXPORT_FULL_01 is a full database export job that is temporary stopped


Step 1. Determine in SQL*Plus which Data Pump jobs exist in the database:

%sqlplus /nolog
CONNECT / as sysdba
SET lines 200
COL owner_name FORMAT a10;
COL job_name FORMAT a20
COL state FORMAT a11 
COL operation LIKE state
COL job_mode LIKE state

-- locate Data Pump jobs:

SELECT owner_name, job_name, operation, job_mode,
state, attached_sessions
FROM dba_datapump_jobs
WHERE job_name NOT LIKE 'BIN$%'
ORDER BY 1,2;

OWNER_NAME JOB_NAME             OPERATION JOB_MODE   STATE        ATTACHED
---------- ------------------- --------- --------- ----------- --------
SCOTT       EXPDP_20051121       EXPORT     SCHEMA     EXECUTING          1
SCOTT       SYS_EXPORT_TABLE_01 EXPORT     TABLE      NOT RUNNING     0
SCOTT       SYS_EXPORT_TABLE_02 EXPORT     TABLE      NOT RUNNING         0
SYSTEM      SYS_EXPORT_FULL_01   EXPORT     FULL       NOT RUNNING        0

Step 2. Ensure that the listed jobs in dba_datapump_jobs are not export/import Data Pump jobs that are active: status should be 'NOT RUNNING'.

Step 3. Check with the job owner that the job with status 'NOT RUNNING' in dba_datapump_jobs is not an export/import Data Pump job that has been temporary stopped, but is actually a job that failed. (E.g. the full database export job by SYSTEM isnota job that failed, but was deliberately paused with STOP_JOB).

Step 4. Determine in SQL*Plus the related master tables:

-- locate Data Pump master tables:

SELECT o.status, o.object_id, o.object_type, 
        o.owner||'.'||object_name "OWNER.OBJECT"
   FROM dba_objects o, dba_datapump_jobs j
WHERE o.owner=j.owner_name AND o.object_name=j.job_name
    AND j.job_name NOT LIKE 'BIN$%' ORDER BY 4,2;

STATUS    OBJECT_ID OBJECT_TYPE   OWNER.OBJECT
------- ---------- ------------ -------------------------
VALID         85283 TABLE         SCOTT.EXPDP_20051121
VALID         85215 TABLE         SCOTT.SYS_EXPORT_TABLE_02
VALID         85162 TABLE         SYSTEM.SYS_EXPORT_FULL_01

Step 5. For jobs that were stopped in the past and won't be restarted anymore, delete the master table. E.g.:

DROP TABLE scott.sys_export_table_02;

Step 6. Re-run the query on dba_datapump_jobs and dba_objects (step 1 and 4). If there are still jobs listed in dba_datapump_jobs, and these jobs do not have a master table anymore, cleanup the job while connected as the job owner. E.g.:

CONNECT scott/tiger
SET serveroutput on
SET lines 100
DECLARE
    h1 NUMBER;
BEGIN
    h1 := DBMS_DATAPUMP.ATTACH('SYS_EXPORT_TABLE_01','SCOTT');
    DBMS_DATAPUMP.STOP_JOB (h1);
END;
/

Note that after the call to the STOP_JOB procedure, it may take some time for the job to be removed. Query the view user_datapump_jobs to check whether the job has been removed:

SELECT * FROM user_datapump_jobs;

Step 7. Confirm that the job has been removed:

CONNECT / as sysdba
SET lines 200 
COL owner_name FORMAT a10; 
COL job_name FORMAT a20 
COL state FORMAT a11  
COL operation LIKE state 
COL job_mode LIKE state 

-- locate Data Pump jobs: 

SELECT owner_name, job_name, operation, job_mode, 
state, attached_sessions 
FROM dba_datapump_jobs 
WHERE job_name NOT LIKE 'BIN$%' 
ORDER BY 1,2; 

OWNER_NAME JOB_NAME             OPERATION JOB_MODE   STATE        ATTACHED
---------- ------------------- --------- --------- ----------- --------
SCOTT       EXPDP_20051121       EXPORT     SCHEMA     EXECUTING           1
SYSTEM      SYS_EXPORT_FULL_01   EXPORT     FULL       NOT RUNNING         0

-- locate Data Pump master tables:

SELECT o.status, o.object_id, o.object_type, 
        o.owner||'.'||object_name "OWNER.OBJECT"
   FROM dba_objects o, dba_datapump_jobs j
WHERE o.owner=j.owner_name AND o.object_name=j.job_name
    AND j.job_name NOT LIKE 'BIN$%' ORDER BY 4,2;

STATUS    OBJECT_ID OBJECT_TYPE   OWNER.OBJECT
------- ---------- ------------ -------------------------
VALID         85283 TABLE         SCOTT.EXPDP_20051121
VALID         85162 TABLE         SYSTEM.SYS_EXPORT_FULL_01


Remarks:
1. Orphaned Data Pump jobs do not have an impact on new Data Pump jobs. The view dba_datapump_jobs is a view, based on gv$datapump_job, obj$, com$, and user$. The view shows the Data Pump jobs that are still running, or jobs for which the master table was kept in the database, or in case of an abnormal end of the Data Pump job (the orphaned job). If a new Data Pump job is started, a new entry will be created, which has no relation to the old Data Pump jobs.

2. When starting the new Data Pump job and using a system generated name, we check the names of existing Data Pump jobs in the dba_datapump_job in order to obtain a unique new system generated jobname. Naturally, there needs to be enough free space for the new master table to be created in the schema that started the new Data Pump job.

3. A Data Pump job is not the same as a job that is defined with DBMS_JOBS. Jobs created with DBMS_JOBS use there own processes. Data Pump jobs use a master process and worker process(es). In case a Data Pump still is temporary stopped (STOP_JOB while in interactive command mode), the Data Pump job still exists in the database (status: NOT RUNNING), while the master and worker process(es) are stopped and do not exist anymore. The client can attach to the job at a later time, and continue the job execution (START_JOB).

4. The possibility of corruption when the master table of an active Data Pump job is deleted, depends on the Data Pump job.

4.a. If the job is anexport job, corruption is unlikely as the drop of the master table will only cause the Data Pump master and worker processes to abort. This situation is similar to aborting an export of the original export client.

4.b. If the job is animport jobthen the situation is different. When dropping the master table, the Data Pump worker and master processes will abort. This will probably lead to an incomplete import: e.g. not all table data was imported, and/or table was imported incomplete, and indexes, views, etc. are missing. This situation is similar to aborting an import of the original import client.

The drop of the master table itself, does not lead to any data dictionary corruption. If you keep the master table after the job completes (using the undocumented parameter: KEEP_MASTER=Y), then a drop of the master table afterwards, will not cause any corruption.

ReferencesNote 286496.1- Export/Import DataPump Parameter TRACE - How to Diagnose Oracle Data Pump
KeywordsDBMS_DATAPUMP.STOP_JOB; DBA_DATAPUMP_JOBS; DBMS_DATAPUMP.ATTACH;

 

分享到:
评论

相关推荐

    zabbix-orphaned-data-cleanup:Zabbix数据库中孤立数据的清理脚本

    Zabbix数据库清理这个仓库包含一些有用的查询,以清理Zabbix数据库中的旧孤立数据。 尽管Zabbix做客房整理,但它不能很好地清除孤立数据。 特别是如果您来自较长的升级产品线(从1.x到1.6到1.8到2.x),则数据库很...

    fix_orphaned_inode_list:当使用pishrink时,我遇到了错误“发现损坏的孤儿链表中的Inodes”。 该脚本尝试修复孤立的inode列表

    fix_orphaned_inode_list 首先,非常感谢pishrink开发人员。 该脚本部分是从pishrink原始脚本复制而来的,但没有图像缩小功能。 它仅使用与pishrink相同的逻辑来映射变量,安装环回和运行fsck工具。 当使用pishrink...

    WordPress数据库清理插件Clean Options

    选择适当的选项,点击“Find Orphaned Options” --->进入“To double-check options in the Orphaned Options list”页面--->单击下方的“Select All“ ,选择页面中的内容---->点击”View Selected Options ...

    2021-2022计算机二级等级考试试题及答案No.17518.docx

    In this document, we have a collection of questions and answers related to the 2021-2022 Computer Level Two Certification Exam. The content covers a wide range of topics in computer science and ...

    Advanced Exchange Recovery 2.0

    Advanced Exchange Recovery uses advanced technologies to scan the orphaned or damaged Exchange offline storage files(.ost) and recover your mail messages and other items as much as possible, so to ...

    plex-orphaned-files:在您的Plex库中查找未建立索引的文件

    对于其他平台,请从下载ZIP,然后运行bin/plex-orphaned-files bin/plex-orphaned-files.bat bin/plex-orphaned-files或bin/plex-orphaned-files.bat 。 有关如何运行二进制文件,请参见。码头工人该二进制文件

    sap标准后台作业

    - **SAP_REORG_ORPHANED_JOBLOGS (RSTS0024)**:每周运行,用于清理孤儿作业日志。 5. **特殊注意事项** - **程序兼容性**: - `RSXMILOGREORG`仅从4.6C版本起可用,在早期版本中应使用`ZRSXMILOGREORG`(参考...

    NGUI Next-Gen UI v3.0.6

    - FIX: Added extra code to ensure that draw calls won't get orphaned. - FIX: Panel alpha is now cumulative (parents affect children). - FIX: Got rid of old double-buffering code that was causing ...

    Orphaned Resources-crx插件

    语言:English (United States) 浏览时查找具有过期域的资源。 当您浏览的页面的其中一个资源中具有可能已过期或易受攻击(易于进行DNS劫持)的域时,此扩展名将通知您。 这是浏览时免费查找漏洞的好方法。...

    delete-orphaned-multisite-tables:查找和删除WordPress多站点网络中的孤立表

    安装将此插件上传到/wp-content/plugins/delete-orphaned-multisite-tables/目录1.通过WordPress中的“插件”菜单或使用WP-CLI命令wp plugin activate delete-orphaned-multisite-tables : wp plugin a

    orphaned-texts:Android 4.3 Jelly Bean 及以下的孤立文本

    孤立的文本Orphaned Texts 是一个 Android 应用程序,旨在让用户查看、导出和删除由于成为孤立的文本消息部分。 此存储库中的应用程序专为 Android 4.3 Jelly Bean 及以下版本设计。 对于较新的设备,请参阅。下载从...

    project_skeletons:一些典型的骨架

    PROJECT_SKELETONS 【项目信息】 该项目包含一些应用程序骨架。 它包含 bootstrap_skeleton - 一个简单的引导项目; ... python_cli_skeleton - 一个简单的 python cli 项目(带有单元测试、验收测试、模拟测试和...

    evm2wasm:[ORPHANED]将EVM代码转换为eWASM

    注意:此项目未积极维护。 有关替代候选者,请参见和 。 概要 EVM(以太坊VM 1.0)到转编译器。 这是在线。 安装 克隆存储库并运行npm install 利用 有一个命令行工具可以对EVM输入进行反编译: ...

    freeling-client:Ruby 的自由包装器

    -EOFMalcolm X was effectively orphaned early in life. His father was killed when he was six and his mother was placed in a mental hospital when he was thirteen, after which he lived in a series of ...

    openmp官方文档

    - targetdata构造与orphaned调用:讨论了在没有并行构造的情况下如何使用targetdata。 OpenMP官方文档不仅对初学者来说是打开并行编程世界的大门,对有经验的开发者来说也是深入理解和掌握最新并行计算技术的桥梁...

    STM32 Nucleo 集成开发环境ide使用指南.pdf

    STM32 Nucleo开发板的开发指南,包括如何使用keil EWARM TrueSTUDIO SW4STM32进行开发的教程

    sql2005错误15023:当前数据库中已存在用户或角色

    孤立用户(Orphaned User) 当数据库从一个服务器迁移到另一个服务器时,如果登录和用户不匹配,就会出现孤立用户的情况。这种情况下,即使数据库中存在用户账户,但登录信息不匹配,导致无法登录数据库。 解决...

    UNIX环境高级编程(第二版,英文版)

    Orphaned Process Groups Section 9.11. FreeBSD Implementation Section 9.12. Summary Exercises Chapter 10. Signals Section 10.1. Introduction Section 10.2. Signal Concepts ...

    UNIX环境高级编程英文第三版+源码

    1.3 Logging In 2 1.4 Files and Directories 4 1.5 Input and Output 8 1.6 Programs and Processes 10 1.7 Error Handling 14 1.8 User Identification 16 1.9 Signals 18 1.10 Time Values 20 1.11 System Calls ...

    cisco交换机iso灾难恢复教程

    在超级终端输入flash_init命令,出现如下提示:Initializing Flash...,flashfs[0]: 1 files, 1 directories,flashfs[0]: 0 orphaned files, 0 orphaned directories,flashfs[0]: Total bytes: 3612672,flashfs[0...

Global site tag (gtag.js) - Google Analytics