oracle 刪除(所有)約束 禁用(所有)約束 啓用(所有)約束

執行以下sql生成的語句即可

1

刪除所有外鍵約束

select 'alter table '||table_name||' drop constraint '||constraint_name||';' from user_constraints where constraint_type='R'

2

禁用所有外鍵約束

select 'alter table '||table_name||' disable constraint '||constraint_name||';' from user_constraints where constraint_type='R'

3

啓用所有外鍵約束

select 'alter table '||table_name||' enable constraint '||constraint_name||';' from user_constraints where constraint_type='R'
————————————————
版權聲明:本文爲CSDN博主「buye1213」的原創文章,遵循CC 4.0 BY-SA版權協議,轉載請附上原文出處鏈接及本聲明。
原文鏈接:https://blog.csdn.net/buye1213/article/details/84810079

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章