删除数据库中的所有仅表、序列、视图等

你需要创建这些删除语句,通过oracle的数据字典找到该用户下的所有表、视图等对象,拼接成语句。如下 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

你可能感兴趣的:(删除数据)