select ‘drop table ‘||table_name||’;’ as sqlscript from user_tables;
–删除视图
select ‘drop view ’ || view_name||’;’ as sqlscript from user_views;
–删除序列
select ‘drop sequence ’ || sequence_name||’;’ as sqlscript from user_sequences;
–删除类型
select ‘drop type ‘||type_name||’;’ as sqlscript from user_types;
–删除触发器
select ‘drop trigger ‘||trigger_name||’;’ as sqlscript from user_triggers;
–删除同义词
select ‘drop synonym ‘||synonym_name||’;’ as sqlscript from user_synonyms;
–删除过程
select ‘drop procedure ’ || object_name||’;’ as sqlscript from user_objects where object_type=‘PROCEDURE’;
–删除函数
select ‘drop function ’ || object_name||’;’ as sqlscript from user_objects where object_type=‘FUNCTION’;
–删除包
select ‘drop package ’ || object_name||’;’ as sqlscript from user_objects where object_type=‘PACKAGE’;
Oracle数据库 批量 删除表、视图、序列、类型、触发器、同义词、过程、函数、包
未经允许不得转载:爱站程序员基地 » Oracle数据库 批量 删除表、视图、序列、类型、触发器、同义词、过程、函数、包