Oracle 大表复制方案存储过程实现
Oracle 大表复制方案存储过程实现
Oracle 大表复制方案存储过程实现:- procedure makePayPlayIraBakNew is
- v_num number;
- begin
- vanceinfo.gmac_log_pro.setloginfo('makePayPlayIraBakNew',
- '1114',
- '9',
- sysdate,
- 'makePayPlayIraBakNew执行开始');
- v_num := 0;
- select count(1)
- into v_num
- from user_tables
- where table_name = 'GMAC_PAYPLAY_IRA_HIS';
- if(v_num > 0) then
- execute immediate 'DROP TABLE GMAC_PAYPLAY_IRA_HIS';
- end if;
- execute immediate 'CREATE TABLE GMAC_PAYPLAY_IRA_HIS AS SELECT * FROM GMAC_PAYPLAY';
- vanceinfo.gmac_log_pro.setloginfo('makePayPlayIraBakNew',
- '1114',
- '0',
- sysdate,
- 'makePayPlayIraBakNew执行成功结束');
- exception
- when others then
- vanceinfo.gmac_log_pro.setloginfo('makePayPlayIraBakNew',
- '1114',
- '9',
- sysdate,
- substr(sqlerrm, 1, 200));
- end makePayPlayIraBakNew;
评论暂时关闭