分区语句整理 7
来源:互联网 发布:vibe算法 编辑:程序博客网 时间:2024/04/30 16:02
/**
* @description call add partition procedure to add the latest partotion
* @description partition day is to_char(sysdate,'yyyymmdd')
*/
prc_s_maintain_partition(iv_char_date => to_char((trunc(sysdate,'DD')-to_char(sysdate,'D')+1),'yyyymmdd'),
on_statuscode => vv_par_flag);
/**
* @description exc_error2 will be raised if the return of sp_dw_tab_add_partition procedure is not 0
* @description get the vv_par_flag
*/
if vv_par_flag <>0 then
raise exc_error2;
end if;
/**
* @description clean all expired partitions, only the latest partition is keeping
* @description the latest partition's date is to_char(sysdate,'yyyymmdd')
*/
open vc_table_info;
loop
fetch vc_table_info
into l_table_info;
exit when vc_table_info%notfound;
if l_table_info.table_owner = vv_user1 or l_table_info.table_owner = vv_user2 or l_table_info.table_owner = vv_user3
or l_table_info.table_owner = vv_user4 then
if l_table_info.partition_name = l_table_info.partition_name2 then
vv_sql := '';
else
vv_sql := 'alter table ' ||l_table_info.table_owner||'.'|| l_table_info.table_name ||
' drop partition ' || l_table_info.partition_name;
execute immediate vv_sql;
end if;
end if;
- 分区语句整理 7
- 分区语句整理
- 分区语句整理 2
- 分区整理语句 3
- 分区语句整理 4
- 分区语句整理 5
- 分区语句整理 6
- 分区语句整理 8
- 语句整理
- hive分区语句
- 表分区常用语句
- MySql分区类型以及建分区语句
- SQL Server 表分区整理
- 分区索引碎片整理Script
- 表分区处理语句记录
- hive修改 表/分区语句
- 批量生成添加分区语句
- hive修改 表/分区语句
- 网络安全知识学习
- response.getWriter().write()与out.print()的区别
- 分区语句整理 6
- Android Fragment的使用
- 躲避杀软抓取系统明文密码
- 分区语句整理 7
- JAVA 正则表达式 (超详细,转)
- TransientDataAccessResourceException和java.sql.SQLException: boo!
- C#陈广自学视频笔记3——namespace
- 分区语句整理 8
- ORACLE删除当前用户下所有的表的方法
- Python调用C/C++
- linux shell中"2>&1"含义
- [LeetCode 34]Search for a Range