SHARE
TWEET

Untitled

a guest Jul 17th, 2017 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. DECLARE
  2.   N_JOBS_RUNNING NUMBER := 1;
  3. BEGIN
  4. SELECT COUNT(*) INTO N_JOBS_RUNNING FROM USER_SCHEDULER_JOBS WHERE JOB_NAME LIKE 'T_DIM_ENT_IDX_%';
  5.   WHILE N_JOBS_RUNNING<>0 LOOP
  6.     DBMS_LOCK.SLEEP(5);
  7.     SELECT COUNT(*) INTO N_JOBS_RUNNING FROM USER_SCHEDULER_JOBS WHERE JOB_NAME LIKE 'T_DIM_ENT_IDX_%';
  8.   END LOOP;
  9.   BEGIN
  10.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_U_1';
  11.     EXCEPTION WHEN OTHERS THEN NULL;
  12.   END;
  13.   BEGIN
  14.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_2';
  15.     EXCEPTION WHEN OTHERS THEN NULL;
  16.   END;
  17.   BEGIN
  18.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_3';
  19.     EXCEPTION WHEN OTHERS THEN NULL;
  20.   END;
  21.   BEGIN
  22.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_4';
  23.     EXCEPTION WHEN OTHERS THEN NULL;
  24.   END;
  25.   BEGIN
  26.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_5';
  27.     EXCEPTION WHEN OTHERS THEN NULL;
  28.   END;
  29.   BEGIN
  30.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_6';
  31.     EXCEPTION WHEN OTHERS THEN NULL;
  32.   END;
  33.   BEGIN
  34.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_7';
  35.     EXCEPTION WHEN OTHERS THEN NULL;
  36.   END;
  37.   BEGIN
  38.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_8';
  39.     EXCEPTION WHEN OTHERS THEN NULL;
  40.   END;
  41.   BEGIN
  42.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_9';
  43.     EXCEPTION WHEN OTHERS THEN NULL;
  44.   END;
  45.   BEGIN
  46.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_10';
  47.     EXCEPTION WHEN OTHERS THEN NULL;
  48.   END;
  49.   BEGIN
  50.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_11';
  51.     EXCEPTION WHEN OTHERS THEN NULL;
  52.   END;
  53.   BEGIN
  54.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_12';
  55.     EXCEPTION WHEN OTHERS THEN NULL;
  56.   END;
  57.   BEGIN
  58.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_13';
  59.     EXCEPTION WHEN OTHERS THEN NULL;
  60.   END;
  61.   BEGIN
  62.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_14';
  63.     EXCEPTION WHEN OTHERS THEN NULL;
  64.   END;
  65.   BEGIN
  66.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_15';
  67.     EXCEPTION WHEN OTHERS THEN NULL;
  68.   END;
  69.   BEGIN
  70.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_16';
  71.     EXCEPTION WHEN OTHERS THEN NULL;
  72.   END;
  73.   BEGIN
  74.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_17';
  75.     EXCEPTION WHEN OTHERS THEN NULL;
  76.   END;
  77.   BEGIN
  78.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_18';
  79.     EXCEPTION WHEN OTHERS THEN NULL;
  80.   END;
  81.   BEGIN
  82.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_19';
  83.     EXCEPTION WHEN OTHERS THEN NULL;
  84.   END;
  85.   BEGIN
  86.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_20';
  87.     EXCEPTION WHEN OTHERS THEN NULL;
  88.   END;
  89.   BEGIN
  90.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_21';
  91.     EXCEPTION WHEN OTHERS THEN NULL;
  92.   END;
  93.   BEGIN
  94.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_22';
  95.     EXCEPTION WHEN OTHERS THEN NULL;
  96.   END;
  97.   BEGIN
  98.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_23';
  99.     EXCEPTION WHEN OTHERS THEN NULL;
  100.   END;
  101.   BEGIN
  102.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_24';
  103.     EXCEPTION WHEN OTHERS THEN NULL;
  104.   END;
  105.   BEGIN
  106.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_25';
  107.     EXCEPTION WHEN OTHERS THEN NULL;
  108.   END;
  109.   BEGIN
  110.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_26';
  111.     EXCEPTION WHEN OTHERS THEN NULL;
  112.   END;
  113.   BEGIN
  114.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_27';
  115.     EXCEPTION WHEN OTHERS THEN NULL;
  116.   END;
  117.   BEGIN
  118.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_28';
  119.     EXCEPTION WHEN OTHERS THEN NULL;
  120.   END;
  121.   BEGIN
  122.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_29';
  123.     EXCEPTION WHEN OTHERS THEN NULL;
  124.   END;
  125.   BEGIN
  126.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_34';
  127.     EXCEPTION WHEN OTHERS THEN NULL;
  128.   END;
  129.   BEGIN
  130.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_35';
  131.     EXCEPTION WHEN OTHERS THEN NULL;
  132.   END;
  133.   BEGIN
  134.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_36';
  135.     EXCEPTION WHEN OTHERS THEN NULL;
  136.   END;
  137.   BEGIN
  138.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_37';
  139.     EXCEPTION WHEN OTHERS THEN NULL;
  140.   END;
  141.   BEGIN
  142.     EXECUTE IMMEDIATE 'DROP INDEX T_DIM_ENT_IDX_38';
  143.     EXCEPTION WHEN OTHERS THEN NULL;
  144.   END;
  145. END;
RAW Paste Data
Top