Drop user cascade failed ORA-00604 ORA-02429 處理一例

來源:互聯網
上載者:User

在刪除索引、表、或者資料表空間及使用者等資料庫物件或者使用者的時候,有時候會遇到入下錯誤:

SQL> drop user Oracle cascade;
 
drop user oracle  cascade;
 
*
 
ERROR at line 1:
 
ORA-00604: error occurred at recursive SQL level 1
 
ORA-02429: cannot drop index used for enforcement of unique/primary key 
 
我們知道drop user 帶cascade會將所屬的資料表空間和其他關聯資料庫物件一起刪除,而這也說明正要被刪除的對象和其他對象之間存在主外鍵約束關聯的問題,所以需要查詢該對象存在哪些約束並刪除之

SQL>select 'alter table '||owner||'.'||table_name||' drop constraint '||constraint_name||' ;'
 from dba_constraints
 where constraint_type in ('U', 'P')
 and (index_owner, index_name) in
 (select owner, segment_name
 from dba_segments
 where onwner = 'ORACLE');
 
alter table w.table_name drop constraint PK_ID ;
 
alter table x.table_name drop constraint FK_UID ;
 
SQL> alter table w.table_name drop constraint pk_id;
 
table altered
 
SQL>alter table x.table_name drop constraint fk_uid;
 
table altered
 
SQL> drop user ORACLE cascade;
 
User dropped.
 
--使用者刪除成功 
 
查詢出結果並刪除即可drop user oralce cascade了,因為這個報錯比較典型,網上還看到過很多種延伸出來的問題原因,記錄之。

推薦閱讀:

ORA-01172、ORA-01151錯誤處理

ORA-00600 [2662]錯誤解決

ORA-01078 和 LRM-00109 報錯解決方案

ORA-00471 處理方法筆記

ORA-00314,redolog 損壞,或丟失處理方法

ORA-00257 歸檔日誌過大導致無法儲存的解決辦法

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.