Oracle SQL*PLUS - 删除当前用户的所有对象
发布时间:2020-05-27 19:13:31 所属栏目:MySql 来源:互联网
导读:Oracle SQL*PLUS - 删除当前用户的所有对象
|
下面是脚本之家 jb51.cc 通过网络收集整理的代码片段。 脚本之家小编现在分享给大家,也给大家做个参考。 --.sql脚本 --唯一注意的是下面的f:dropobj.sql 为操作的.sql; --你的电脑没有F盘,请换为D或者E其他存在的盘符 --用于删除当前用户的所有对象 --use for drop all objects in current user; set heading off; set feedback off; spool f:dropobj.sql; prompt --删除约束条件 select 'alter table '||table_name||' drop constraint '||constraint_name||' ;' from user_constraints where constraint_type='R'; prompt --删除表空间 select 'drop table '||table_name ||';' from user_tables; prompt --删除视图 select 'drop view ' ||view_name||';' from user_views; prompt --删除数字序列 select 'drop sequence ' ||sequence_name||';' from user_sequences; prompt --删除函数 select 'drop function ' ||object_name||';' from user_objects where object_type='FUNCTION'; prompt --删除存储过程 select 'drop procedure '||object_name||';' from user_objects where object_type='PROCEDURE'; prompt --删除包 prompt --删除包内容 select 'drop package '|| object_name||';' from user_objects where object_type='PACKAGE'; prompt --删除数据库链接 select 'drop database link '|| object_name||';' from user_objects where object_type='DATABASE LINK'; spool off; set heading on; set feedback on; @@f:dropobj.sql; host del f:dropobj.sql; --done for drop objects in current user; --在SQL*PLUS 将这整段作为.sql导入或者直接复制黏贴,按F5执行,完成。 以上是脚本之家(jb51.cc)为你收集整理的全部代码内容,希望文章能够帮你解决所遇到的程序开发问题。 如果觉得脚本之家网站内容还不错,欢迎将脚本之家网站推荐给程序员好友。 (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
