orcale删除当前用户下所有的表

首先是查询出来所有的表,然后再逐一删除。

可以用excel编辑删除语句。

–delete tables
select ‘drop table ‘ || table_name ||’;’||chr(13)||chr(10) from user_tables;

–delete views
select ‘drop view ‘ || view_name||’;’||chr(13)||chr(10) from user_views;

–delete seqs
select ‘drop sequence ‘ || sequence_name||’;’||chr(13)||chr(10) from user_sequences;

–delete functions
select ‘drop function ‘ || object_name||’;’||chr(13)||chr(10) from user_objects where object_type=’FUNCTION’;

–delete procedure
select ‘drop procedure ‘ || object_name||’;’||chr(13)||chr(10) from user_objects where object_type=’PROCEDURE’;

–delete package
select ‘drop package ‘ || object_name||’;’||chr(13)||chr(10) from user_objects where object_type=’PACKAGE’;


转载请注明来源

×

喜欢就点赞,疼爱就打赏