ITPub博客

首页 > Linux操作系统 > Linux操作系统 > partition 分区表重命名

partition 分区表重命名

原创 Linux操作系统 作者:perfychi 时间:2013-02-27 00:19:17 0 删除 编辑
declare
l_str varchar2(4000);
begin
        for x in (select a.partition_name, a.tablespace_name, a.high_value from user_tab_partitions a where a.table_name='AUDIT_TRAIL' and a.interval ='YES' and a.partition_name like 'SYS\_P%' escape '\')
loop
execute immediate 'select to_char(' || x.high_value || '-numtodsinterval(1, ''second''), ''"PART_"yyyy_mm'') from dual' into l_str;
execute immediate 'alter table audit_trail rename partition "' || x.partition_name || '"to "' || l_str || '"';
end loop;
end;
/

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/27042095/viewspace-754791/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2012-06-06

  • 博文量
    484
  • 访问量
    2975591