oracle数据库中删除多个分区表
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
declare v_date date; v_part_name varchar(50); begin v_date := date'2015-2-4'; while v_date >= date'2014-10-20' LOOP v_part_name := 'LOG_' || to_char(v_date,'yyyymmdd'); dbms_output.put_line(v_part_name); execute immediate 'ALTER TABLE table_log DROP PARTITION ' || v_part_name; v_date := v_date -1; END LOOP; end; |