Oracle中drop user和drop user cascade的區別
SQL> delete user itp2;
delete user itp2
*
第 1 行出現錯誤:
ORA-00903: 表名無效
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'
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.
被刪除使用者建立的其他使用者不會被刪除
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.
被刪除使用者建立的其他使用者不會被刪除
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28673746/viewspace-1147484/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle OCP 1Z0-053 Q85(DROP USER CASCADE)Oracle
- mysql中delete fro mysql.user where XX和drop user的不同MySqldelete
- Oracle Purge和drop的區別Oracle
- oracle多使用者使用同一個表空間_drop user cascade的影響Oracle
- maridb Error 'Operation DROP USER failed forErrorAI
- Oracle User 和 Schema 的區別Oracle
- Oracle中User和Schema的區別和聯絡Oracle
- oracle10g中drop user造成ORA-07445 core dumpOracle
- [重慶思莊每日技術分享]-執行DROP USER ... CASCADE操作刪除很慢
- DROP USER過程中出現的奇怪的物件資訊物件
- drop table和truncate table的區別
- user和schema的區別
- alter database drop datafile 與 drop tablespace file 的區別Database
- 資料庫審計(create/alter/drop table、user、tablespace)資料庫
- 在MySQL中 Truncate Delect Drop 的區別MySql
- 資料包分析中Drop和iDrop的區別
- Drop table cascade constraintsAI
- ORACLE中的兩個概念:user和schema的區別和聯絡Oracle
- user_tab_columns和user_tab_cols的區別!
- truncate delete drop 區別delete
- oracle 9.2.0.8.0的drop user而引起的ora-0060[qmxiUnpPacked2], [121], [], [], [], [], [], []Oracle
- 水煮oracle33---關於oracle中segment、schema和user區別Oracle
- drop user 報ORA-03113 問題處理
- DROP TABLE ** CASCADE CONSTRAINTS PURGEAI
- user rollbacks和transaction rollbacks的區別
- "DROP USER" fails with error: ORA-00942 and ORA-00604 (一)AIError
- "DROP USER" fails with error: ORA-00942 and ORA-00604 (二)AIError
- SQL truncate 、delete與drop區別SQLdelete
- alter database datafile offline drop 與 alter tablespace drop datafile 區別Database
- truncate和不帶where子句的delete, 以及drop區別delete
- 資料庫:drop、truncate、delete的區別資料庫delete
- oracle drop columnsOracle
- 恢復oracle中drop掉的表Oracle
- 主子表drop table constraints cascade的測試AI
- computed watcher和user watcher的區別
- user rollbacks 與 transaction rollbacks 的區別
- 外來鍵約束drop table cascade constraintsAI
- Truncate table 詳解及與delete,drop 的區別delete