ORA-02266: unique/primary keys in table referenced by enabled foreign keys
来源:互联网 发布:自行车软件 编辑:程序博客网 时间:2024/05/17 01:36
SQL> truncate table alert_store;truncate table alert_store *ERROR at line 1:ORA-02266: unique/primary keys in table referenced by enabled foreign keys
SQL> SET PAGESIZE 1000SQL> select c1.table_name as org_table_name, 2 c1.constraint_name as org_constraint_name, 3 c1.constraint_type as org_constriant_type, 4 n1.column_name as org_colun_name, 5 c2.table_name as ref_table_name, 6 c2.constraint_type as ref_constraint_type, 7 c2.constraint_name as ref_constraint_name, 8 n2.column_name as ref_column_name 9 from dba_constraints c1, 10 dba_constraints c2, 11 dba_cons_columns n1, 12 dba_cons_columns n2 13 where c1.owner = 'AVSYS' 14 and c1.table_name = 'ALERT_STORE' 15 and n1.constraint_name = c1.constraint_name 16 and n1.owner = c1.owner 17 and c2.constraint_type = 'R' 18 and c2.r_constraint_name = c1.constraint_name 19 and n2.owner = c2.owner 20 and n2.constraint_name = c2.constraint_name; ORG_TABLE_NAME ORG_CONSTRAINT_NAME O------------------------------ ------------------------------ -ORG_COLUN_NAME--------------------------------------------------------------------------------REF_TABLE_NAME R REF_CONSTRAINT_NAME------------------------------ - ------------------------------REF_COLUMN_NAME--------------------------------------------------------------------------------ALERT_STORE ALERT_STORE_PK PALERT_IDALERT_NOTE R ALERT_NOTE_ALERT_STORE_FKALERT_IDALERT_STORE ALERT_STORE_PK PALERT_IDALERT_EMAIL_JOB R ALRT_EMAIL_JOB_ALRT_STORE_FKALERT_IDALERT_STORE ALERT_STORE_PK PALERT_IDALERT_TROUBLETICKET_JOB R ALRT_TTKT_JOB_ALRT_STORE_FKALERT_IDSQL> ALTER TABLE AVSYS.ALERT_STORE DISABLE PRIMARY KEY CASCADE;Table altered.SQL> truncate table alert_store; Table truncated.SQL> ALTER TABLE AVSYS.ALERT_STORE enable PRIMARY KEY ;Table altered.SQL> ALTER TABLE AVSYS.ALERT_STORE enable PRIMARY CONSTRAINT ALERT_NOTE_ALERT_STORE_FK; ALTER TABLE AVSYS.ALERT_STORE enable PRIMARY CONSTRAINT ALERT_NOTE_ALERT_STORE_FK *ERROR at line 1:ORA-00905: missing keywordSQL> ALTER TABLE AVSYS.ALERT_STORE enable CONSTRAINT ALERT_NOTE_ALERT_STORE_FK; ALTER TABLE AVSYS.ALERT_STORE enable CONSTRAINT ALERT_NOTE_ALERT_STORE_FK*ERROR at line 1:ORA-02430: cannot enable constraint (ALERT_NOTE_ALERT_STORE_FK) - no suchconstraintSQL> ALTER TABLE AVSYS.ALERT_NOTE enable CONSTRAINT ALERT_NOTE_ALERT_STORE_FK;Table altered.SQL> ALTER TABLE AVSYS.ALERT_EMAIL_JOB enable CONSTRAINT ALRT_EMAIL_JOB_ALRT_STORE_FK;Table altered.SQL> ALTER TABLE AVSYS.ALERT_TROUBLETICKET_JOB enable CONSTRAINT ALRT_TTKT_JOB_ALRT_STORE_FK;Table altered.SQL>
0 0
- truncate table 错误 ORA-02266: unique/primary keys in table referenced by enabled foreign keys
- ORA-02266: unique/primary keys in table referenced by enabled foreign keys
- ORA-02266: unique/primary keys in table referenced by enabled foreign keys
- ORA-02449: unique/primary keys in table referenced by foreign keys
- Adding Primary Keys and Foreign Keys to a Table
- Partitioning Keys, Primary Keys, and Unique Keys
- SQL Server Error Messages - Msg 1776 : There are no primary or candidate keys in the referenced Table
- 添加外键出现There are no primary or candidate keys in the referenced table ×××××的错误
- 19.6.1 Partitioning Keys, Primary Keys, and Unique Keys 分区键,主键,和唯一健
- Ticket Servers: Distributed Unique Primary Keys on the Cheap
- Ticket Servers: Distributed Unique Primary Keys on the Cheap
- Oracle/PLSQL: Foreign Keys
- Oracle/PLSQL: Foreign Keys
- ruby sum values in array by keys
- Unique Encryption Keys
- ORA-01452: cannot CREATE UNIQUE INDEX; duplicate keys found
- Keys
- keys
- man 3 stat函数翻译
- 产品经理最好用的工具都在这里了
- ANDROID L - Material Design详解(UI控件)
- 数据分析
- CPU和SoC的关系和区别
- ORA-02266: unique/primary keys in table referenced by enabled foreign keys
- 设备管理员功能介绍
- MySQL timestamp 的一个坑
- Win7右键没有新建Word、excel、powerpoint
- Android学习笔记之Fast Json的使用
- PHP版本--HTTP session cookie原理及应用
- 监控工具TCPMon的使用方法
- iOS 截取整个uiscrolview内容
- Android canvas.save()和canvas.restore()的理解