批量删除表的方法
2010-06-27 20:42
197 查看
该方法可进行小数据量的迁移工作
-- 如果表己经存在可以批量删除,然后重建
begin
for t in (
select table_name from
user_tables t
) loop
execute immediate 'drop table '||t.table_name;
end loop;
end;
-- 批量建表
begin
for t in (
select table_name from
user_tables@db_bas t
) loop
execute immediate 'create table '||t.table_name|| 'as select * from '||t.table_name||'@db_bas';
end loop;
end;
-- 如果表己经存在可以批量删除,然后重建
begin
for t in (
select table_name from
user_tables t
) loop
execute immediate 'drop table '||t.table_name;
end loop;
end;
-- 批量建表
begin
for t in (
select table_name from
user_tables@db_bas t
) loop
execute immediate 'create table '||t.table_name|| 'as select * from '||t.table_name||'@db_bas';
end loop;
end;
相关文章推荐
- 【颗粒归仓】(五)批量删除方法进阶
- 批量删除Windows7中隧道适配器的方法
- php+mysqli实现批量执行插入、更新及删除数据的方法
- 关于VIM 批量添加注释和删除注释的方法
- 多方法批量删除Android中无用的资源(更新Android Studio2.1工具)
- eclipse、Myeclipse中批量增加、删除注释--技巧方法小结
- 网站被黑后的处理方法及批量删除恶意代码
- 批量删除Word中回车的方法
- php+mysqli实现批量执行插入、更新及删除数据的方法
- dreamweaver中用正则表达式查找替换批量删除 tppabs标签的方法 一步到位
- linux下vi中批量删除空行的方法:
- Asp.net(C#)对文件操作的方法(读取,删除,批量拷贝,删除...)
- Mybatis中的foreach方法,批量插入和批量删除
- 一种批量删除数据的方法
- 批量删除要素的方法【转载】
- 批量删除Windows7中隧道适配器的方法
- 批量删除word或wps中超链接的方法
- php批量删除超链接的实现方法
- python中redis查看剩余过期时间及用正则通配符批量删除key的方法