惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

雷峰网
雷峰网
aimingoo的专栏
aimingoo的专栏
云风的 BLOG
云风的 BLOG
Microsoft Security Blog
Microsoft Security Blog
Vercel News
Vercel News
The GitHub Blog
The GitHub Blog
T
The Blog of Author Tim Ferriss
Microsoft Azure Blog
Microsoft Azure Blog
U
Unit 42
IT之家
IT之家
D
DataBreaches.Net
Y
Y Combinator Blog
B
Blog RSS Feed
F
Fortinet All Blogs
GbyAI
GbyAI
V
Visual Studio Blog
博客园 - 叶小钗
Google DeepMind News
Google DeepMind News
美团技术团队
L
LangChain Blog
N
Netflix TechBlog - Medium
G
Google Developers Blog
Recent Announcements
Recent Announcements
T
Tailwind CSS Blog

博客园 - 莫问奴归处

ora-01950:对表空间XXX无权限 TOMCAT不能连接SQL SERVER 2008 R2,不能创建JDBC连接之原因解密! SVN里的一些细小概念 WinRAR 4.20 beta2注册文件 如何在WEBLOGIC中设置日志输入 oracle中查询、禁用、启用、删除表外键 度分秒转化成度 windows server 2012 QQ交流群:256418966 怎样通过命令管理Windows7桌面防火墙 Windows8(2012) 如何改变登录界面上难看的头像,任意换! Windows8(2012) 如何配置回环适配器,如何开启桌面体验(媒体播放器,应用程序商店等) Windows8(2012) 如何启用Administrator用户并使用应用商店? windows server 2012 IE10,flash都可以用了 windows2012 永激活及配置 An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode. 茶的种类有多少种? 新手驾车上高速注意事项(ZT) 新雷语 正确清洗轮胎很关键 保持爱车光洁如新
Oracle删除当前用户下的所有表、视图、序列、函数、存储过程、包
莫问奴归处 · 2012-12-04 · via 博客园 - 莫问奴归处

--在终端依次输入以下命令
sqlplus
--输入需要删除的用户名
--输入密码
SET HEAD OFF;
set feedback off;
SPOOL c:\drop_tables.sql;
--chr(13) ASCII中=换行 chr(10) ASCII中=回车
--禁用所有约束
select 'alter table '||table_name||' disable constraint '||constraint_name||';' from user_constraints where constraint_type='R';
--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';
--delete trigger
SELECT 'drop TRIGGER "' ||SYS_CONTEXT('USERENV','CURRENT_USER')||'"."'|| TRIGGER_NAME ||'";' ||CHR(13) ||CHR(10)FROM USER_TRIGGERS;
spool off;
@c:\drop_tables.sql;
--清空Oracle的回收站
purge recyclebin;