87: fnd_stats.gather_table_stats(g_schema_owner,'PER_EMPDIR_ORGANIZATIONS');
88: fnd_stats.gather_table_stats(g_schema_owner,'PER_EMPDIR_JOBS');
89: fnd_stats.gather_table_stats(g_schema_owner,'PER_EMPDIR_POSITIONS');
90: fnd_stats.gather_table_stats(g_schema_owner,'PER_EMPDIR_PHONES');
91: fnd_stats.gather_table_stats(g_schema_owner,'PER_EMPDIR_LOCATIONS');
92: fnd_stats.gather_table_stats(g_schema_owner,'PER_EMPDIR_LOCATIONS_TL');
93: fnd_stats.gather_table_stats(g_schema_owner,'PER_EMPDIR_IMAGES');
94:
95: write_log(1, 'End gathering stats: '||to_char(SYSDATE, 'DD/MM/RRRR HH:MI:SS'));
88: fnd_stats.gather_table_stats(g_schema_owner,'PER_EMPDIR_JOBS');
89: fnd_stats.gather_table_stats(g_schema_owner,'PER_EMPDIR_POSITIONS');
90: fnd_stats.gather_table_stats(g_schema_owner,'PER_EMPDIR_PHONES');
91: fnd_stats.gather_table_stats(g_schema_owner,'PER_EMPDIR_LOCATIONS');
92: fnd_stats.gather_table_stats(g_schema_owner,'PER_EMPDIR_LOCATIONS_TL');
93: fnd_stats.gather_table_stats(g_schema_owner,'PER_EMPDIR_IMAGES');
94:
95: write_log(1, 'End gathering stats: '||to_char(SYSDATE, 'DD/MM/RRRR HH:MI:SS'));
96:
652: BEGIN
653: g_date := trunc(SYSDATE);
654:
655: FORALL I IN 1 .. p_cnt
656: INSERT INTO per_empdir_locations values (
657: locationTbl.orig_system(I)
658: ,locationTbl.orig_system_id(I)
659: ,locationTbl.business_group_id(I)
660: ,locationTbl.derived_locale(I)
726: END IF;
727:
728: OPEN p_cursor FOR query_str;
729: ELSIF (p_mode = 1) THEN
730: query_str := query_str || ' WHERE EXISTS (SELECT ''e'' FROM per_empdir_locations il' ||
731: ' WHERE il.orig_system_id = l.location_id'||
732: ' AND il.orig_system = ''' || g_srcSystem || '''' ||
733: ' AND il.object_version_number <> l.object_version_number)';
734: IF hr_multi_tenancy_pkg.get_system_model = 'B' THEN
735: query_str := query_str || ' AND label_to_char(HR_ENTERPRISE) <> ''C::ENT''';
736: END IF;
737: OPEN p_cursor FOR query_str;
738: ELSIF (p_mode = 2) THEN
739: query_str := query_str || ' WHERE NOT EXISTS (SELECT ''e'' FROM per_empdir_locations il' ||
740: ' WHERE il.orig_system_id = l.location_id' ||
741: ' AND il.orig_system = ''' || g_srcSystem || ''')';
742: IF hr_multi_tenancy_pkg.get_system_model = 'B' THEN
743: query_str := query_str || ' AND label_to_char(HR_ENTERPRISE) <> ''C::ENT''';
756:
757: g_date := trunc(SYSDATE);
758:
759: FORALL I IN 1 .. p_cnt
760: UPDATE per_empdir_locations
761: SET orig_system = locationTbl.orig_system(I)
762: ,orig_system_id = locationTbl.orig_system_id(I)
763: ,business_group_id = locationTbl.business_group_id(I)
764: ,derived_locale = locationTbl.derived_locale(I)
2661: write_log(1, 'Begin merge per loctl: '||to_char(SYSDATE, 'DD/MM/RRRR HH:MI:SS'));
2662:
2663: g_date := trunc(SYSDATE);
2664:
2665: UPDATE per_empdir_locations_tl loc
2666: SET (orig_system, orig_system_id, location_code, description,
2667: language, source_lang, object_version_number, partition_id,
2668: last_update_date, last_update_by, created_by, creation_date,
2669: request_id, program_application_id, program_id, program_update_date)
2685:
2686: l_cnt := sql%rowcount;
2687: COMMIT;
2688:
2689: write_log(1, 'Total # of records updated for per_empdir_locations_tl: '||l_cnt);
2690: write_log(2, 'Total # of records updated for per_empdir_locations_tl: '||l_cnt);
2691:
2692: INSERT /*+ parallel(loc) append */ INTO per_empdir_locations_tl loc(
2693: ORIG_SYSTEM,
2686: l_cnt := sql%rowcount;
2687: COMMIT;
2688:
2689: write_log(1, 'Total # of records updated for per_empdir_locations_tl: '||l_cnt);
2690: write_log(2, 'Total # of records updated for per_empdir_locations_tl: '||l_cnt);
2691:
2692: INSERT /*+ parallel(loc) append */ INTO per_empdir_locations_tl loc(
2693: ORIG_SYSTEM,
2694: ORIG_SYSTEM_ID,
2688:
2689: write_log(1, 'Total # of records updated for per_empdir_locations_tl: '||l_cnt);
2690: write_log(2, 'Total # of records updated for per_empdir_locations_tl: '||l_cnt);
2691:
2692: INSERT /*+ parallel(loc) append */ INTO per_empdir_locations_tl loc(
2693: ORIG_SYSTEM,
2694: ORIG_SYSTEM_ID,
2695: LOCATION_CODE,
2696: DESCRIPTION,
2722: g_request_id,
2723: g_prog_appl_id,
2724: g_prog_id,
2725: g_date
2726: FROM hr_locations_all_tl ltl, hr_locations_all l, per_empdir_locations pel
2727: WHERE ltl.location_id = l.location_id
2728: AND pel.orig_system_id = l.location_id
2729: AND pel.orig_system = g_srcSystem
2730: AND NOT EXISTS (SELECT 'e' from per_empdir_locations_tl il
2726: FROM hr_locations_all_tl ltl, hr_locations_all l, per_empdir_locations pel
2727: WHERE ltl.location_id = l.location_id
2728: AND pel.orig_system_id = l.location_id
2729: AND pel.orig_system = g_srcSystem
2730: AND NOT EXISTS (SELECT 'e' from per_empdir_locations_tl il
2731: WHERE il.orig_system_id = ltl.location_id
2732: AND il.orig_system = g_srcSystem);
2733:
2734: l_cnt := sql%rowcount;
2733:
2734: l_cnt := sql%rowcount;
2735: COMMIT;
2736:
2737: write_log(1, 'Total # of new records processed for per_empdir_locations_tl: '||l_cnt);
2738: write_log(2, 'Total # of new records processed for per_empdir_locations_tl: '||l_cnt);
2739: write_log(1, 'End merge per loctl: '||to_char(SYSDATE, 'DD/MM/RRRR HH:MI:SS'));
2740:
2741: EXCEPTION WHEN OTHERS THEN
2734: l_cnt := sql%rowcount;
2735: COMMIT;
2736:
2737: write_log(1, 'Total # of new records processed for per_empdir_locations_tl: '||l_cnt);
2738: write_log(2, 'Total # of new records processed for per_empdir_locations_tl: '||l_cnt);
2739: write_log(1, 'End merge per loctl: '||to_char(SYSDATE, 'DD/MM/RRRR HH:MI:SS'));
2740:
2741: EXCEPTION WHEN OTHERS THEN
2742: errbuf := errbuf||SQLERRM;
2875: ,retcode
2876: ,p_eff_date
2877: );
2878:
2879: write_log(1, 'Total # of records updated for per_empdir_locations: '||l_cnt);
2880: write_log(2, 'Total # of records updated for per_empdir_locations: '||l_cnt);
2881:
2882: bulk_process_per_locations(
2883: 2
2876: ,p_eff_date
2877: );
2878:
2879: write_log(1, 'Total # of records updated for per_empdir_locations: '||l_cnt);
2880: write_log(2, 'Total # of records updated for per_empdir_locations: '||l_cnt);
2881:
2882: bulk_process_per_locations(
2883: 2
2884: ,l_cnt
2886: ,retcode
2887: ,p_eff_date
2888: );
2889:
2890: write_log(1, 'Total # of new records processed for per_empdir_locations: '||l_cnt);
2891: write_log(2, 'Total # of new records processed for per_empdir_locations: '||l_cnt);
2892: write_log(1, 'End merge per locations: '||to_char(SYSDATE, 'DD/MM/RRRR HH:MI:SS'));
2893:
2894: EXCEPTION WHEN OTHERS THEN
2887: ,p_eff_date
2888: );
2889:
2890: write_log(1, 'Total # of new records processed for per_empdir_locations: '||l_cnt);
2891: write_log(2, 'Total # of new records processed for per_empdir_locations: '||l_cnt);
2892: write_log(1, 'End merge per locations: '||to_char(SYSDATE, 'DD/MM/RRRR HH:MI:SS'));
2893:
2894: EXCEPTION WHEN OTHERS THEN
2895: errbuf := errbuf||SQLERRM;
3264: BEGIN
3265:
3266:
3267: write_log(1, 'Begin populating per location tl: '||to_char(SYSDATE, 'DD/MM/RRRR HH:MI:SS'));
3268: EXECUTE IMMEDIATE 'ALTER TABLE '||g_schema_owner||'.PER_EMPDIR_LOCATIONS_TL TRUNCATE PARTITION internal REUSE STORAGE';
3269: EXECUTE IMMEDIATE 'ALTER INDEX '||g_schema_owner||'.PER_EMPDIR_LOCATIONS_TL_PK REBUILD';
3270:
3271: g_date := trunc(SYSDATE);
3272:
3265:
3266:
3267: write_log(1, 'Begin populating per location tl: '||to_char(SYSDATE, 'DD/MM/RRRR HH:MI:SS'));
3268: EXECUTE IMMEDIATE 'ALTER TABLE '||g_schema_owner||'.PER_EMPDIR_LOCATIONS_TL TRUNCATE PARTITION internal REUSE STORAGE';
3269: EXECUTE IMMEDIATE 'ALTER INDEX '||g_schema_owner||'.PER_EMPDIR_LOCATIONS_TL_PK REBUILD';
3270:
3271: g_date := trunc(SYSDATE);
3272:
3273: INSERT /*+ parallel(loc) append */ INTO per_empdir_locations_tl loc(
3269: EXECUTE IMMEDIATE 'ALTER INDEX '||g_schema_owner||'.PER_EMPDIR_LOCATIONS_TL_PK REBUILD';
3270:
3271: g_date := trunc(SYSDATE);
3272:
3273: INSERT /*+ parallel(loc) append */ INTO per_empdir_locations_tl loc(
3274: ORIG_SYSTEM,
3275: ORIG_SYSTEM_ID,
3276: LOCATION_CODE,
3277: DESCRIPTION,
3309:
3310: l_cnt := sql%rowcount;
3311: COMMIT;
3312:
3313: write_log(1, 'Total # of records processed for per_empdir_locations_tl: '||l_cnt);
3314: write_log(2, 'Total # of records processed for per_empdir_locations_tl: '||l_cnt);
3315: write_log(1, 'End populating per locations tl: '||to_char(SYSDATE, 'DD/MM/RRRR HH:MI:SS'));
3316:
3317: EXCEPTION WHEN OTHERS THEN
3310: l_cnt := sql%rowcount;
3311: COMMIT;
3312:
3313: write_log(1, 'Total # of records processed for per_empdir_locations_tl: '||l_cnt);
3314: write_log(2, 'Total # of records processed for per_empdir_locations_tl: '||l_cnt);
3315: write_log(1, 'End populating per locations tl: '||to_char(SYSDATE, 'DD/MM/RRRR HH:MI:SS'));
3316:
3317: EXCEPTION WHEN OTHERS THEN
3318: errbuf := errbuf||SQLERRM;
3332:
3333: BEGIN
3334:
3335: write_log(1, 'Begin populating per locations: '||to_char(SYSDATE, 'DD/MM/RRRR HH:MI:SS'));
3336: EXECUTE IMMEDIATE 'ALTER TABLE '||g_schema_owner||'.PER_EMPDIR_LOCATIONS TRUNCATE PARTITION internal REUSE STORAGE';
3337: EXECUTE IMMEDIATE 'ALTER INDEX '||g_schema_owner||'.PER_EMPDIR_LOCATIONS_PK REBUILD';
3338:
3339: bulk_process_per_locations(
3340: 0
3333: BEGIN
3334:
3335: write_log(1, 'Begin populating per locations: '||to_char(SYSDATE, 'DD/MM/RRRR HH:MI:SS'));
3336: EXECUTE IMMEDIATE 'ALTER TABLE '||g_schema_owner||'.PER_EMPDIR_LOCATIONS TRUNCATE PARTITION internal REUSE STORAGE';
3337: EXECUTE IMMEDIATE 'ALTER INDEX '||g_schema_owner||'.PER_EMPDIR_LOCATIONS_PK REBUILD';
3338:
3339: bulk_process_per_locations(
3340: 0
3341: ,l_cnt
3343: ,retcode
3344: ,p_eff_date
3345: );
3346:
3347: write_log(1, 'Total # of records processed for per_empdir_locations: '||l_cnt);
3348: write_log(2, 'Total # of records processed for per_empdir_locations: '||l_cnt);
3349: write_log(1, 'End populating per locations: '||to_char(SYSDATE, 'DD/MM/RRRR HH:MI:SS'));
3350:
3351: EXCEPTION WHEN OTHERS THEN
3344: ,p_eff_date
3345: );
3346:
3347: write_log(1, 'Total # of records processed for per_empdir_locations: '||l_cnt);
3348: write_log(2, 'Total # of records processed for per_empdir_locations: '||l_cnt);
3349: write_log(1, 'End populating per locations: '||to_char(SYSDATE, 'DD/MM/RRRR HH:MI:SS'));
3350:
3351: EXCEPTION WHEN OTHERS THEN
3352: errbuf := errbuf||SQLERRM;
3672: write_log(1, 'Process began @: '|| to_char(SYSDATE, 'DD/MM/RRRR HH:MI:SS'));
3673:
3674: BEGIN
3675: EXECUTE IMMEDIATE 'ALTER TRIGGER PER_EMPDIR_ASSIGNMENTS_WHO DISABLE';
3676: EXECUTE IMMEDIATE 'ALTER TRIGGER PER_EMPDIR_LOCATIONS_WHO DISABLE';
3677: EXECUTE IMMEDIATE 'ALTER TRIGGER PER_EMPDIR_PEOPLE_WHO DISABLE';
3678: EXECUTE IMMEDIATE 'ALTER TRIGGER PER_EMPDIR_PHONES_WHO DISABLE';
3679:
3680: EXCEPTION WHEN OTHERS THEN