表分区维护的sql(6)
来源:未知 责任编辑:责任编辑 发表时间:2015-10-08 14:16 点击:次
from dual;
elsif (v_row.partitionflag = 2) then
--按周分区,肯定每天都要维护 www.2cto.com
v_partitionchar := Const_Partition_WEEK_prefix;
v_comments := 'partition_flag:' || v_row.partitionflag ||
' of maintenance table :' || v_row.table_name ||
' in partition_table can''t be supported.';
Pro_Record_Log(v_comments, v_comments);
goto here;
elsif (v_row.partitionflag = 3) then
--按月分区,每月1号维护
Select to_char(v_sysdate, 'dd') into v_day from dual;
begin
select to_number(param_value)
into v_MonthExecution_DAY
from partition_param t
where t.param_mask = 'MONTH_EXECUTION_DAY';
exception
when others then
if SQLCODE = -1403 then
v_comments := 'when maintenancing ' || v_row.table_name ||
',MONTH_EXECUTION_DAY in partition_param is invalid. it''s must be [1-28].';
Pro_Record_Log(v_comments, v_comments);
else
v_comments := 'when maintenancing ' || v_row.table_name ||
',an error happened.' || SQLERRM;
Pro_Record_Log(v_comments, v_comments);
end if;
goto here;
www.2cto.com
end;
if (v_MonthExecution_DAY is null or v_MonthExecution_DAY > 28 or
v_MonthExecution_DAY < 1) then
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>