1、先禁用数据库中所有的约束

select 'alter table ' || table_name || ' disable constraint ' ||
constraint_name || ';'
from user_constraints
where constraint_type = 'R';

执行所有约束禁用命令。


2、清空所有表中的数据

select 'truncate table '||table_name||';' from user_tables;

执行所有的清表命令。

 

3、删除所有表

select 'drop table '||table_name||';' as sqlscript from user_tables;

执行所有的删除命令。


4、启用数据库中所有表的约束

select 'alter table ' || table_name || ' enable constraint ' ||
constraint_name || ';'
from user_constraints
where constraint_type = 'R';

执行所有约束启用命令。

相关文章:

  • 2021-08-18
  • 2022-12-23
  • 2021-08-01
  • 2022-01-13
  • 2022-12-23
  • 2022-03-06
  • 2022-12-23
  • 2021-10-26
猜你喜欢
  • 2021-10-16
  • 2021-08-18
  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案