SQL> delete user itp2;
delete user itp2
       *
第 1 行出现错误:
ORA-00903: 表名无效
SQL> drop user itp2;
drop user itp2
*
第 1 行出现错误:
ORA-01940: 无法删除当前已连接的用户
SQL> drop user itp2;
用户已删除。
SQL> drop user itp;
drop user itp
*
第 1 行出现错误:
ORA-01922: 必须指定 CASCADE 以删除 'ITP'
SQL> drop user itp cascade;
用户已删除。
SQL>
drop user ; 仅仅是删除用户,
drop user ×× cascade ;会删除此用户名下的所有表和视图。

user
Specify the user to be dropped. Oracle Database does not drop users whose schemas 
contain objects unless you specify CASCADE or unless you first explicitly drop the 
user's objects.

CASCADE 
Specify CASCADE to drop all objects in the user's schema before dropping the user. You 
must specify this clause to drop a user whose schema contains any objects.

使用cascade参数可以删除该用户的全部objects。要说明的如下:

1 If the user's schema contains tables, then Oracle Database drops the tables and 
automatically drops any referential integrity constraints on tables in other schemas 
that refer to primary and unique keys on these tables.

如果用户的schema中有表,则在删除表的时候自动删除与该表相关的主键和外键。

2 If this clause results in tables being dropped, then the database also drops all 
domain indexes created on columns of those tables and invokes appropriate drop 
routines. 
如果用户的schema中有表,则在删除表的时候自动删除与该表相关的索引。

3 Oracle Database invalidates, but does not drop, the following objects in other 
schemas:
删除用户时,下列在其他用户中的objects不会被删除,只会被置为无效

1 Views or synonyms for objects in the dropped user's schema
视图,同义词

2 Stored procedures, functions, or packages that query objects in the dropped 
user's schema
存储过程,函数,包

4 Oracle Database does not drop materialized views in other schemas that are based 
on tables in the dropped user's schema. However, because the base tables no 
longer exist, the materialized views in the other schemas can no longer be 
refreshed.
其他用户建立的基于被删除用户的物化视图不会被删除,只是不能在刷新了。

5 Oracle Database drops all triggers in the user's schema.
用户模式下的所有触发器全部被删除

6 Oracle Database does not drop roles created by the user
被删除用户建立的其他用户不会被删除

drop user和drop user cascade的区别的更多相关文章

  1. Oracle中drop user和drop user cascade的区别

    drop user : 仅仅是删除用户,drop user username cascade :会删除此用户名下的所有表和视图. userSpecify the user to be dropped. ...

  2. oracle--drop user 和 drop user cascade 的区别【转载】

    drop user : 仅仅是删除用户, drop user ×× cascade :会删除此用户名下的所有表和视图. user Specify the user to be dropped. Ora ...

  3. 主外键 设置 on update cascade 和on delete cascade 的区别

    on update cascade 和on delete cascade 的区别 这是数据库外键定义的一个可选项,用来设置当主键表中的被参考列的数据发生变化时,外键表中响应字段的变换规则的.updat ...

  4. mysql 用drop和delete方法删除用户的区别

    在学习drop方法删除用户时,按照书上讲的一直没操作成功,后来到网上查了点其他资料,才弄明白drop的方法,贴出来和大家分享一下. (方法一)drop user 用户名; 语法:drop user 用 ...

  5. (转载)mysql 用drop和delete方法删除用户的区别

    (转载)http://hi.baidu.com/yymagento/item/56c3f6184bce8347e75e06db 在学习drop方法删除用户时,按照书上讲的一直没操作成功,后来到网上查了 ...

  6. delete、truncate、drop三种删除语句联系与区别

    相同点: 1.truncate和不带where子句的delete.以及drop都会删除表内的数据. 2.drop.truncate都是DDL语句(数据定义语言),执行后会自动提交. 不同点: 1. t ...

  7. drop、delete和truncate三者的区别

    相同点:1.truncate和不带where子句的delete.以及drop都会删除表内的数据.2.drop.truncate都是DDL语句(数据定义语言),执行后会自动提交.不同点:1. trunc ...

  8. sql 外键 on update cascade 和 on delete cascade 作用区别?

    这是数据库外键定义的一个可选项,用来设置当主键表中的被参考列的数据发生变化时,外键表中响应字段的变换规则的.update 则是主键表中被参考字段的值更新,delete是指在主键表中删除一条记录:on ...

  9. oracle中delete、truncate、drop的区别

    oracle中delete.truncate.drop的区别 标签: deleteoracletable存储 2012-05-23 15:12 7674人阅读 评论(0) 收藏 举报  分类: ora ...

随机推荐

  1. java 多线程之 interrupt()和线程终止方式

    interrupt() 说明 interrupt()的作用是中断本线程. 本线程中断自己是被允许的:其它线程调用本线程的interrupt()方法时,会通过checkAccess()检查权限.这有可能 ...

  2. Hanlp中文自然语言处理入门介绍

    自然语言处理定义: 自然语言处理是一门计算机科学.人工智能以及语言学的交叉学科.虽然语言只是人工智能的一部分(人工智能还包括计算机视觉等),但它是非常独特的一部分.这个星球上有许多生物拥有超过人类的视 ...

  3. java jni 调用c++ opencv代码成功范例

    java上建立接口定义 package com.dtk; public class Rec { public native String RecImage(String src); public st ...

  4. 在VS2008中加入ExtJS智能提示

    在VS2008中加入ExtJS智能提示   在VS2008中加入ExtJS智能提示—>(方法一) 关于如何在VS2008中加入ExtJS的智能提示的方法,我这里有2种方法,相对于第二种方法,第一 ...

  5. ALGO-5_蓝桥杯_算法训练_最短路

    记: 一开始没接触过关于最短距离的算法,便开始翻阅关于图的知识, 得知关于最短距离的算法有Dijkstra算法(堆优化暂未看懂),Bellman-Ford算法,Floyd算法,SPFA算法. 由于数据 ...

  6. bzoj4918: 回文数对

    Description 给定区间[L,R],请统计有多少对整数A,B(L<=A,B<=R)满足A xor B的值在二进制表示下,去掉所有前导0后是回文串 Input 第一行包含一个正整数T ...

  7. bzoj 4929: 第三题

    Description 给定n,b,c,d,e以及A0,A1,···,An−1,定义 xk=b×c^4k+d×c^2k+e f(x)=Sigma(Aix^i),0<=i<=n-1 请你求出 ...

  8. DOM操作之属性和样式操作

    在DOM操作,除了前面的节点操作以外,常常被用到的操作还有属性操作和节点操作,下面,主要来总结一下jQuery中的属性操作方法和样式操作方法. 在开始操作前,我们需要先在html中添加如下代码,后面所 ...

  9. ASP.NET Web Pages:表单

    ylbtech-.Net-ASP.NET Web Pages:表单 1.返回顶部 1. ASP.NET Web Pages - HTML 表单 表单是 HTML 文档中放置输入控件(文本框.复选框.单 ...

  10. python 使用selenium和requests爬取页面数据

    目的:获取某网站某用户下市场大于1000秒的视频信息 1.本想通过接口获得结果,但是使用post发送信息到接口,提示服务端错误. 2.通过requests获取页面结果,使用html解析工具,发现麻烦而 ...