时间:2021-07-01 10:21:17 帮助过:4人阅读
select ‘drop table "‘ || table_name ||‘";‘||chr(13)||chr(10) from user_tables; --delete tables
select ‘drop view "‘ || view_name||‘";‘||chr(13)||chr(10) from user_views; --delete views
select ‘drop sequence "‘ || sequence_name||‘";‘||chr(13)||chr(10) from user_sequences;--delete seqs
select ‘drop function "‘ || object_name||‘";‘||chr(13)||chr(10) from user_objects where object_type=‘FUNCTION‘;--delete functions
select ‘drop procedure "‘ || object_name||‘";‘||chr(13)||chr(10) from user_objects where object_type=‘PROCEDURE‘;--DELETE PROCEDURE
select ‘drop package "‘ || object_name||‘";‘||chr(13)||chr(10) from user_objects where object_type=‘PACKAGE‘;--delete pags
先删子表后删父表,如果两张表相互有主外键约束,drop table tablename cascade constraints即可
oracle 删除当前用户下所有的表、索引、序列...
标签: