清空数据库所有表的数据

declare cursor c_t is select table_name from user_tables;
table_name user_tables.table_name%type;
begin open c_t;
loop fetch c_t into table_name;
exit when c_t%notfound;
execute immediate 'delete from ' || table_name;
end loop;
close c_t;
end;

原文地址:https://www.cnblogs.com/wangkeai/p/4125603.html