dropuser:仅仅是删除用户,
dropuser××cascade:会删除此用户名下的所有表和视图。
user
Specifytheusertobedropped.OracleDatabasedoesnotdropuserswhoseschemas
containobjectsunlessyouspecifyCASCADEorunlessyoufirstexplicitlydropthe
user'sobjects.
CASCADE
SpecifyCASCADEtodropallobjectsintheuser'sschemabeforedroppingtheuser.You
mustspecifythisclausetodropauserwhoseschemacontainsanyobjects.
使用cascade参数可以删除该用户的全部objects。要说明的如下:
1.Iftheuser'sschemacontainstables,thenOracleDatabasedropsthetablesandautomaticallydropsanyreferentialintegrityconstraintsontablesinotherschemasthatrefertoprimaryanduniquekeysonthesetables.
如果用户的schema中有表,则在删除表的时候自动删除与该表相关的主键和外键。
2.Ifthisclauseresultsintablesbeingdropped,thenthedatabasealsodropsalldomainindexescreatedoncolumnsofthosetablesandinvokesappropriatedroproutines.
如果用户的schema中有表,则在删除表的时候自动删除与该表相关的索引。
3.OracleDatabaseinvalidates,butdoesnotdrop,thefollowingobjectsinotherschemas:
删除用户时,下列在其他用户中的objects不会被删除,只会被置为无效
3.1Viewsorsynonymsforobjectsinthedroppeduser'sschema
视图,同义词
3.2Storedprocedures,functions,orpackagesthatqueryobjectsinthedroppeduser'sschema
存储过程,函数,包
4.OracleDatabasedoesnotdropmaterializedviewsinotherschemasthatarebasedontablesinthedroppeduser'sschema.However,becausethebasetablesnolongerexist,thematerializedviewsintheotherschemascannolongerberefreshed.
其他用户建立的基于被删除用户的物化视图不会被删除,只是不能在刷新了。
5.OracleDatabasedropsalltriggersintheuser'sschema.
用户模式下的所有触发器全部被删除
6.OracleDatabasedoesnotdroprolescreatedbytheuser.
被删除用户建立的其他用户不会被删除
------------------------------------------------------------------------------
Blog:http://blog.youkuaiyun.com/tianlesoftware
网上资源:http://tianlesoftware.download.youkuaiyun.com
相关视频:http://blog.youkuaiyun.com/tianlesoftware/archive/2009/11/27/4886500.aspx
DBA1群:62697716(满);DBA2群:62697977