在刪除一個表時,如果該表的主鍵是另一個表的外鍵,如果不用cascade關鍵字就會報錯:
SQL> drop table dict_loc_type; drop table dict_loc_type ORA-02449: 表中的唯一/主鍵被外鍵引用
使用cascade關鍵字,表被成功刪除:
SQL> drop table dict_loc_type cascade constraints; Table dropped
使用flashback語句可以恢復被刪除的表,但是被刪除的外鍵無法恢復:
SQL> flashback table dict_loc_type to before drop; Done
