BEGIN
    -- disabled trigger
    FOR rec IN
        (SELECT owner, table_name 
        FROM all_triggers
        WHERE owner = 'ALLIANCE')
    LOOP
        EXECUTE IMMEDIATE 'ALTER TABLE "' || rec.owner || '"."' || rec.table_name || '" DISABLE ALL TRIGGERS';
    END LOOP;
END;

BEGIN
    -- Disabled constraint
    FOR rec IN
      (SELECT c.owner, c.table_name, c.constraint_name
       FROM all_constraints c, all_tables t
       WHERE c.table_name = t.table_name
       AND c.status = 'ENABLED'
       AND c.owner = 'ALLIANCE'
       AND NOT (t.iot_type IS NOT NULL AND c.constraint_type = 'P')
       ORDER BY c.constraint_type DESC)
    LOOP
        EXECUTE IMMEDIATE 'ALTER TABLE "' || rec.owner || '"."' || rec.table_name || '" DISABLE CONSTRAINT ' || rec.constraint_name;
    END LOOP;
END;