我正在尝试合并区间分区表上的分区,因为我无法删除最初创建的分区,我试图通过执行立即实现它,但无法通过它。你能帮我解决这个问题。
DECLARE
l_tab_date DATE;
l_arcv_high_value VARCHAR2(300);
l_tab_date_p DATE;
l_tab_date_c DATE;
l_query_trun_arch VARCHAR2(3000);
BEGIN
SELECT high_value INTO l_arcv_high_value FROM all_tab_partitions WHERE
table_name='TEST_ARCHIVAL' AND partition_position=1;
l_tab_date:= TO_DATE (REGEXP_SUBSTR (l_arcv_high_value, '[^'']+', 1, 2) ,'SYYYY-MM-DD HH24:MI:SS');
l_tab_date_p:=TRUNC(l_tab_date-1,'MONTH');
l_tab_date_c:=TRUNC(l_tab_date, 'MONTH');
EXECUTE IMMEDIATE q'[ALTER TABLE TEST_ARCHIVAL MERGE PARTITIONS
for (to_date(l_tab_date_p,'DD-MM-YYYY')),
for (to_date(l_tab_date_c, 'DD-MM-YYYY'))]';
END;
/