??????????????????????????????????????????????????????????????????DBMS?У?????????????????????????????????????????????κ????????????????????????????????е????????????????????????????????????????м???????
????Oracle????????????????????????Σ??????????μ????????????????????????????????????????????????????????????????????????????????????????????????Ч???????????????????????????С???????Oracle??????У???????????????Щ??????????????????????????????????????
????????????????
???????????Oracle 11gR2???в????????汾???11.2.0.4??
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE      11.2.0.4.0     Production
TNS for 64-bit Windows: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 – Production
?????????????Prim??Child????????????
SQL> create table prim (v_id number(3)?? v_name varchar2(100));
Table created
SQL> alter table prim add constraint pk_prim primary key (v_id);
Table altered
SQL> create table child (c_id number(3)?? v_id number(3)?? c_name varchar2(100));
Table created
SQL> alter table child add constraint pk_child primary key (c_id);
Table altered
?????????????????
???????????????????????????
????SQL> alter table CHILD
????2    add constraint FK_CHILD_PRIM foreign key (V_ID)
????3    references prim (V_ID)
????4  ;
????????ж???????????????£?Oracle????????????????????????
????--????????????£???????????????
????SQL> delete prim where v_id=2;
????delete prim where v_id=2
????ORA-02292:Υ?????????????(A.FK_CHILD_PRIM) - ?????????
????--??????????????£?????????????
????SQL> update prim set v_id=4 where v_id=2;
????update prim set v_id=4 where v_id=2
????ORA-02292:Υ?????????????(A.FK_CHILD_PRIM) - ?????????
????--????????
????SQL> update child set v_id=5 where v_id=2;
????update child set v_id=5 where v_id=2
????ORA-02291: Υ????????????? (A.FK_CHILD_PRIM) - δ???????????
??????????????????????Oracle????????????£??????????????????????????????????????????????????????????????????