REM############################################################################ REM REM Copyright (c) 2002, 2003, Oracle Corporation. All rights reserved. REM REM REM PRODUCT REM Oracle Enterprise Manager REM REM THIS FILE IS MACHINE GENERATED. DO NOT EDIT! REM REM JOB TYPE SQL FOR JOB TYPE: DGCreateStandby REM REM############################################################################# SET DEFINE OFF SET SQLPREFIX OFF BEGIN BEGIN DECLARE l_job_type_name MGMT_JOB_TYPE_INFO.job_type%TYPE; l_job_type_id MGMT_JOB_TYPE_INFO.job_type_id%TYPE; l_major_version MGMT_JOB_TYPE_INFO.major_version%TYPE; l_minor_version1 MGMT_JOB_TYPE_INFO.minor_version1%TYPE; l_minor_version2 MGMT_JOB_TYPE_INFO.minor_version2%TYPE; BEGIN l_job_type_name:= 'DGCreateStandby'; BEGIN MGMT_JOB_ENGINE.fix_flatten_steps(TRUE); MGMT_JOB_ENGINE.get_max_versions(l_job_type_name, l_major_version, l_minor_version1, l_minor_version2, l_job_type_id); l_minor_version2 := l_minor_version2+1; EXCEPTION WHEN OTHERS THEN IF SQLCODE=MGMT_GLOBAL.INVALID_JOB_TYPE_ERR THEN l_major_version := 1; l_minor_version1 := 0; l_minor_version2 := 1; ELSE RAISE; END IF; END; -- CHECK TO VALIDATE REFERENCED COMMANDS/NESTED JOB TYPES BEGIN DECLARE l_commands SMP_EMD_STRING_ARRAY := SMP_EMD_STRING_ARRAY(); l_nested_jobtypes SMP_EMD_STRING_ARRAY := SMP_EMD_STRING_ARRAY(); BEGIN l_commands.trim(l_commands.count); l_commands.extend(1); l_commands(1) := 'reloadTargetPropertiesDG'; l_nested_jobtypes.trim(l_nested_jobtypes.count); l_nested_jobtypes.extend(1); l_nested_jobtypes(1) := 'DBClone'; MGMT_JOB_ENGINE.validate_job_type(l_job_type_name, l_commands, l_nested_jobtypes ); END; END; -- JOBTYPE ENTRY INSERT INTO MGMT_JOB_TYPE_INFO(job_type, version, major_version, minor_version1, minor_version2, job_type_category, all_target_types, agent_bound, single_target, suspend_on_nocreds, default_target_type, restartable, editable, suspendable, trusted,job_type_nlsid,job_type_default,create_text_nlsid,create_text_default,delete_text_nlsid,delete_text_default) VALUES ( l_job_type_name, '1.0', l_major_version, l_minor_version1, l_minor_version2, 0, 0, 0, 0, 0, null, 1, 0, 0, 1, 'DGCreateStandby_DGCreateStandby', 'Data Guard Create Standby', null, null, null, null) RETURNING job_type_id INTO l_job_type_id; -- ENTRIES FOR STEPSET main INSERT INTO mgmt_job_execplan(job_type_id, step_name, step_type, nested_job_type, nested_job_target_type, incoming_edge_type, origin_step_name, origin_step_type, switch_var_name, switch_var_index, switch_case_val, iterate_param, iterate_param_filter, num_children, stepset_name, stepset_status, command_name, restart_mode, all_params, all_targets, halt_on_failure,step_nlsid ,step_default,trusted) VALUES ( l_job_type_id, 'main', 2, null, null, -1, null, -1, null, null, null, null, null, 1, null, null, null, 1, 0, 0, 0, null, null, -1 ); -- ENTRY FOR NESTED JOB DBClone BEGIN DECLARE l_gen_iterate_param RAW(16) := SYS_GUID(); l_temp_stepset_name VARCHAR(96) := SYS_GUID() || 'DBClone'; l_gen_stepset_name VARCHAR(64) := substr(l_temp_stepset_name, 1, 64); BEGIN IF MGMT_JOB_ENGINE.is_nested_flatten_candidate(l_job_type_id, 'DBClone', TRUE) THEN INSERT INTO MGMT_JOB_EXECPLAN(job_type_id, step_name, step_type, nested_job_type, nested_job_target_type, incoming_edge_type, origin_step_name, origin_step_type, switch_var_name, switch_var_index, switch_case_val, iterate_param, iterate_param_filter, num_children, stepset_name, stepset_status, command_name, restart_mode, all_params, all_targets, halt_on_failure,step_nlsid ,step_default, flattened_targets) VALUES ( l_job_type_id, 'DBClone', 12, 'DBClone', null, 1, 'main', 2, null, null, null, l_gen_iterate_param, null, 0, 'main', null, null, 1, null, 1, 1, null, null, 0 ); INSERT INTO mgmt_job_execplan(job_type_id, step_name, step_type, nested_job_type, nested_job_target_type, incoming_edge_type, origin_step_name, origin_step_type, switch_var_name, switch_var_index, switch_case_val, iterate_param, iterate_param_filter, num_children, stepset_name, stepset_status, command_name, restart_mode, all_params, all_targets, halt_on_failure,step_nlsid ,step_default,trusted) VALUES ( l_job_type_id, 'DBClone', 6, null, null, 7, 'DBClone', 12, null, null, null, l_gen_iterate_param, null, 1, 'main', null, null, 1, null, null, 0, null, null, -1 ); INSERT INTO mgmt_job_execplan(job_type_id, step_name, step_type, nested_job_type, nested_job_target_type, incoming_edge_type, origin_step_name, origin_step_type, switch_var_name, switch_var_index, switch_case_val, iterate_param, iterate_param_filter, num_children, stepset_name, stepset_status, command_name, restart_mode, all_params, all_targets, halt_on_failure,step_nlsid ,step_default,trusted) VALUES ( l_job_type_id, 'DBClone', 2, null, null, 6, 'DBClone', 6, null, null, null, null, null, 1, 'DBClone', null, null, 1, null, null, 0, null, null, -1 ); INSERT INTO MGMT_JOB_EXECPLAN(job_type_id, step_name, step_type, nested_job_type, nested_job_target_type, incoming_edge_type, origin_step_name, origin_step_type, switch_var_name, switch_var_index, switch_case_val, iterate_param, iterate_param_filter, num_children, stepset_name, stepset_status, command_name, restart_mode, all_params, all_targets, halt_on_failure,step_nlsid ,step_default, flattened_targets) VALUES ( l_job_type_id, 'DBClone', 7, 'DBClone', null, 1, 'DBClone', 2, null, null, null, l_gen_iterate_param, null, 0, 'DBClone', null, null, 1, 1, 1, 0, null, null, 1 ); INSERT INTO MGMT_NESTED_JOB_TARGETS(job_type_id, step_name, step_type, target_name, target_type) VALUES ( l_job_type_id, 'DBClone', 12, l_gen_iterate_param, null ); ELSE INSERT INTO mgmt_job_execplan(job_type_id, step_name, step_type, nested_job_type, nested_job_target_type, incoming_edge_type, origin_step_name, origin_step_type, switch_var_name, switch_var_index, switch_case_val, iterate_param, iterate_param_filter, num_children, stepset_name, stepset_status, command_name, restart_mode, all_params, all_targets, halt_on_failure,step_nlsid ,step_default,trusted) VALUES ( l_job_type_id, 'DBClone', 7, 'DBClone', null, 1, 'main', 2, null, null, null, null, null, 0, 'main', null, null, 1, 1, 1, 0, null, null, -1 ); END IF; END; END; -- ENTRIES FOR STEP reloadStatePrimary INSERT INTO mgmt_job_execplan(job_type_id, step_name, step_type, nested_job_type, nested_job_target_type, incoming_edge_type, origin_step_name, origin_step_type, switch_var_name, switch_var_index, switch_case_val, iterate_param, iterate_param_filter, num_children, stepset_name, stepset_status, command_name, restart_mode, all_params, all_targets, halt_on_failure,step_nlsid ,step_default,trusted) VALUES ( l_job_type_id, 'reloadStatePrimary', 1, null, null, 7, 'DBClone', 7, null, null, null, null, null, 0, 'main', null, 'reloadTargetPropertiesDG', 1, 0, 0, 0, 'DBClone_reloadStatePrimary', 'Update Primary', -1 ); -- STEP PARAMETERS FOR STEP reloadStatePrimary BEGIN DECLARE l_vector_values MGMT_JOB_VECTOR_PARAMS := MGMT_JOB_VECTOR_PARAMS(); BEGIN INSERT INTO MGMT_JOB_STEP_PARAMS(job_type_id, step_name, param_name, parameter_type, encrypted, scalar_value, vector_value, value_of) VALUES ( l_job_type_id, 'reloadStatePrimary', 'targetName', 1, 0, '%source_target_name%', null, null ); INSERT INTO MGMT_JOB_STEP_PARAMS(job_type_id, step_name, param_name, parameter_type, encrypted, scalar_value, vector_value, value_of) VALUES ( l_job_type_id, 'reloadStatePrimary', 'targetType', 1, 0, '%source_target_type%', null, null ); END; END; -- ENTRIES FOR STEP reloadStateStandby INSERT INTO mgmt_job_execplan(job_type_id, step_name, step_type, nested_job_type, nested_job_target_type, incoming_edge_type, origin_step_name, origin_step_type, switch_var_name, switch_var_index, switch_case_val, iterate_param, iterate_param_filter, num_children, stepset_name, stepset_status, command_name, restart_mode, all_params, all_targets, halt_on_failure,step_nlsid ,step_default,trusted) VALUES ( l_job_type_id, 'reloadStateStandby', 1, null, null, 7, 'reloadStatePrimary', 1, null, null, null, null, null, 0, 'main', null, 'reloadTargetPropertiesDG', 1, 0, 0, 0, 'DBClone_reloadStateStandby', 'Update Standby', -1 ); -- STEP PARAMETERS FOR STEP reloadStateStandby BEGIN DECLARE l_vector_values MGMT_JOB_VECTOR_PARAMS := MGMT_JOB_VECTOR_PARAMS(); BEGIN INSERT INTO MGMT_JOB_STEP_PARAMS(job_type_id, step_name, param_name, parameter_type, encrypted, scalar_value, vector_value, value_of) VALUES ( l_job_type_id, 'reloadStateStandby', 'targetName', 1, 0, '%em_target_name%', null, null ); INSERT INTO MGMT_JOB_STEP_PARAMS(job_type_id, step_name, param_name, parameter_type, encrypted, scalar_value, vector_value, value_of) VALUES ( l_job_type_id, 'reloadStateStandby', 'targetType', 1, 0, '%em_target_type%', null, null ); END; END; -- PARAMETERDISPLAYINFO ENTRIES INSERT INTO MGMT_JOB_TYPE_PARAM_DSPLY_INFO (job_type_id , parameter_name ,show_in_create , show_in_results ,label_nlsid , label_default , hint_nlsid , hint_default , display_mode , num_lines , default_text , default_nlsid , param_order) VALUES ( l_job_type_id, 'sourceOracleHome', 1, 1, 'DBClone_sourceOracleHome', 'Source Oracle Home', null, null, 3, null, null, null, 0 ); -- PARAMETERDISPLAYINFO ENTRIES INSERT INTO MGMT_JOB_TYPE_PARAM_DSPLY_INFO (job_type_id , parameter_name ,show_in_create , show_in_results ,label_nlsid , label_default , hint_nlsid , hint_default , display_mode , num_lines , default_text , default_nlsid , param_order) VALUES ( l_job_type_id, 'sourceOracleSide', 1, 1, 'DBClone_sourceOracleSide', 'Source Oracle SID', null, null, 3, null, null, null, 1 ); -- PARAMETERDISPLAYINFO ENTRIES INSERT INTO MGMT_JOB_TYPE_PARAM_DSPLY_INFO (job_type_id , parameter_name ,show_in_create , show_in_results ,label_nlsid , label_default , hint_nlsid , hint_default , display_mode , num_lines , default_text , default_nlsid , param_order) VALUES ( l_job_type_id, 'destOracleHome', 1, 1, 'DBClone_destOracleHome', 'Destination Oracle Home', null, null, 3, null, null, null, 2 ); -- PARAMETERDISPLAYINFO ENTRIES INSERT INTO MGMT_JOB_TYPE_PARAM_DSPLY_INFO (job_type_id , parameter_name ,show_in_create , show_in_results ,label_nlsid , label_default , hint_nlsid , hint_default , display_mode , num_lines , default_text , default_nlsid , param_order) VALUES ( l_job_type_id, 'destOracleSid', 1, 1, 'DBClone_destOracleSid', 'Destination Oracle SID', null, null, 3, null, null, null, 3 ); -- PARAMETERDISPLAYINFO ENTRIES INSERT INTO MGMT_JOB_TYPE_PARAM_DSPLY_INFO (job_type_id , parameter_name ,show_in_create , show_in_results ,label_nlsid , label_default , hint_nlsid , hint_default , display_mode , num_lines , default_text , default_nlsid , param_order) VALUES ( l_job_type_id, 'destDbName', 1, 1, 'DBClone_destDbName', 'Destination DB Name', null, null, 3, null, null, null, 4 ); -- PARAMETERDISPLAYINFO ENTRIES INSERT INTO MGMT_JOB_TYPE_PARAM_DSPLY_INFO (job_type_id , parameter_name ,show_in_create , show_in_results ,label_nlsid , label_default , hint_nlsid , hint_default , display_mode , num_lines , default_text , default_nlsid , param_order) VALUES ( l_job_type_id, 'sourceUsername', 1, 1, 'DBClone_sourceUsername', 'Source User Name', null, null, 3, null, null, null, 5 ); -- PARAMETERDISPLAYINFO ENTRIES INSERT INTO MGMT_JOB_TYPE_PARAM_DSPLY_INFO (job_type_id , parameter_name ,show_in_create , show_in_results ,label_nlsid , label_default , hint_nlsid , hint_default , display_mode , num_lines , default_text , default_nlsid , param_order) VALUES ( l_job_type_id, 'destUsername', 1, 1, 'DBClone_destUsername', 'Destination User Name', null, null, 3, null, null, null, 6 ); -- PARAMETERDISPLAYINFO ENTRIES INSERT INTO MGMT_JOB_TYPE_PARAM_DSPLY_INFO (job_type_id , parameter_name ,show_in_create , show_in_results ,label_nlsid , label_default , hint_nlsid , hint_default , display_mode , num_lines , default_text , default_nlsid , param_order) VALUES ( l_job_type_id, 'sourceTempDir', 1, 1, 'DBClone_sourceTempDir', 'Source Temp Directory', null, null, 3, null, null, null, 7 ); -- PARAMETERDISPLAYINFO ENTRIES INSERT INTO MGMT_JOB_TYPE_PARAM_DSPLY_INFO (job_type_id , parameter_name ,show_in_create , show_in_results ,label_nlsid , label_default , hint_nlsid , hint_default , display_mode , num_lines , default_text , default_nlsid , param_order) VALUES ( l_job_type_id, 'destTempDir', 1, 1, 'DBClone_destTempDir', 'Destination Temp Directory', null, null, 3, null, null, null, 8 ); -- PARAMETERDISPLAYINFO ENTRIES INSERT INTO MGMT_JOB_TYPE_PARAM_DSPLY_INFO (job_type_id , parameter_name ,show_in_create , show_in_results ,label_nlsid , label_default , hint_nlsid , hint_default , display_mode , num_lines , default_text , default_nlsid , param_order) VALUES ( l_job_type_id, 'destListenerName', 1, 1, 'DBClone_destListenerName', 'Destination Listener Name', null, null, 3, null, null, null, 9 ); -- PARAMETERDISPLAYINFO ENTRIES INSERT INTO MGMT_JOB_TYPE_PARAM_DSPLY_INFO (job_type_id , parameter_name ,show_in_create , show_in_results ,label_nlsid , label_default , hint_nlsid , hint_default , display_mode , num_lines , default_text , default_nlsid , param_order) VALUES ( l_job_type_id, 'destListenerFile', 1, 1, 'DBClone_destListenerFile', 'Destination Listener File', null, null, 3, null, null, null, 10 ); -- PARAMETERDISPLAYINFO ENTRIES INSERT INTO MGMT_JOB_TYPE_PARAM_DSPLY_INFO (job_type_id , parameter_name ,show_in_create , show_in_results ,label_nlsid , label_default , hint_nlsid , hint_default , display_mode , num_lines , default_text , default_nlsid , param_order) VALUES ( l_job_type_id, 'retainBackupSet', 1, 1, 'DBClone_retainBackupSet', 'Retain Backup Set', null, null, 3, null, null, null, 11 ); -- PARAMETERDISPLAYINFO ENTRIES INSERT INTO MGMT_JOB_TYPE_PARAM_DSPLY_INFO (job_type_id , parameter_name ,show_in_create , show_in_results ,label_nlsid , label_default , hint_nlsid , hint_default , display_mode , num_lines , default_text , default_nlsid , param_order) VALUES ( l_job_type_id, 'useExistingBackupSet', 1, 1, 'DBClone_useExistingBackupSet', 'Use Existing Backup Set', null, null, 3, null, null, null, 12 ); -- DISPLAYINFO ENTRIES INSERT INTO MGMT_JOB_TYPE_DISPLAY_INFO(job_type_id, nls_bundle,use_default_create_ui) VALUES ( l_job_type_id, 'oracle.sysman.db.rsc.DBCloneJobMsg', 0 ); -- Ensure that all existing scheduled executions use the new jobtype version MGMT_JOB_ENGINE.reschedule_on_new_jobtype_ver(l_job_type_id); -- Patch NLS information for backward-compatibility MGMT_JOB_ENGINE.update_job_type_nls_info(l_job_type_id, l_job_type_name); END; END; MGMT_JOB_ENGINE.fix_flatten_steps(FALSE); EXCEPTION WHEN OTHERS THEN MGMT_JOB_ENGINE.fix_flatten_steps(FALSE); RAISE; END; / COMMIT; SET DEFINE ON SET SQLPREFIX ON