Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Launching managed jobs from within the run steps

Christian Leigh edited this page Jul 18, 2019 · 1 revision

Launching jobs from within the run steps

If you need to launch a job from within a run-step use the call :-

migration_run_framework.pr_start_managed_job(i_job_name => 'MY_MANAGED_JOB'
                                            ,i_job_sql  => 'BEGIN your_code_here END;')

That way the migration framework will "KNOW" about your launched job so that it can be stopped and managed correctly through the framework.

If you want to use DBMS_PARALLEL_EXECUTE to have some parallel activity that you have specifically crafted then please use the following 2 calls to notify the run framework.

migration_run_framework.pr_register_parallel_task
migration_run_framework.pr_deregister_parallel_task

For example

migration_run_framework.pr_register_parallel_task(i_task_name => 'MY_HAND_CRAFTED_PARALLEL_JOB');
 
              dbms_parallel_execute.create_chunks_by_number_col(task_name    => 'MY_HAND_CRAFTED_PARALLEL_JOB'
                                                               ,table_owner  => 'XYZ_SCHEMA'
                                                               ,table_name   => 'MY_TABLE'
                                                               ,table_column => 'ID'
                                                               ,chunk_size   => 100000);
              dbms_parallel_execute.run_task(task_name      => 'MY_HAND_CRAFTED_PARALLEL_JOB'
                                            ,sql_stmt       => l_sql_clob
                                            ,language_flag  => dbms_sql.native
                                            ,parallel_level => l_threads);
 
migration_run_framework.pr_deregister_parallel_task(i_task_name => 'MY_HAND_CRAFTED_PARALLEL_JOB');