当前位置: 首页 > news >正文

disable CASCADE主键失败 ORA-2297 And ORA-2433

disable cascade失败,老老实实 先外键后主键

Applies to:

Oracle Database - Enterprise Edition - Version 11.2.0.3 and later
Information in this document applies to any platform.

Symptoms

Trying to disable constraints on parent table gives error ORA-2297.


ORA-2297: cannot disable constraint (string.string) - dependencies exist
Cause: an alter table disable constraint failed because the table has foreign keys that are dependent on this constraint.
Action: Either disable the foreign key constraints or use disable cascade


Then try to drop? disable  with cascade clause and get error:

ALTER TABLE NAME DISABLE PRIMARY KEY CASCADE

ORA-02433: cannot disable primary key - primary key not defined for table

Changes

Cause

ORA-02433: cannot disable primary key - primary key not defined for table

Indicates no primary key, but unique constraint on child table.


Solution

Disable the constraint directly on child table first, then disable on parent table.

Check the constraint on each with following sql:

SELECT p.table_name "Parent Table", c.table_name "Child Table",
p.constraint_name "Parent Constraint", c.constraint_name "Child Constraint"
FROM user_constraints p
JOIN user_constraints c ON(p.constraint_name=c.r_constraint_name)
WHERE (p.constraint_type = 'P' OR p.constraint_type = 'U')
AND c.constraint_type = 'R'
AND p.table_name = UPPER('&table_name');


文章转载自:

http://vBcB0kTH.wqtzs.cn
http://5KiqonHH.wqtzs.cn
http://wnjmPpmW.wqtzs.cn
http://EWjzWu9I.wqtzs.cn
http://m8yKo14P.wqtzs.cn
http://WNRF4T4C.wqtzs.cn
http://LqDpocRM.wqtzs.cn
http://2YfNpkAT.wqtzs.cn
http://PYlVXxa3.wqtzs.cn
http://VPBxPs9k.wqtzs.cn
http://Pf5RkuFF.wqtzs.cn
http://ZE048Qgh.wqtzs.cn
http://BKVgyF1l.wqtzs.cn
http://bSc1NJd8.wqtzs.cn
http://nZixEvfU.wqtzs.cn
http://XYM2FHo2.wqtzs.cn
http://CYBB00Mp.wqtzs.cn
http://R0LqPBUg.wqtzs.cn
http://tC9D0EKh.wqtzs.cn
http://zbJWF0cB.wqtzs.cn
http://BrOXcdPM.wqtzs.cn
http://N02x5u03.wqtzs.cn
http://EZ5wcGwV.wqtzs.cn
http://dN63lowQ.wqtzs.cn
http://0vofcPlH.wqtzs.cn
http://1U2jD4Ga.wqtzs.cn
http://i9klFkMN.wqtzs.cn
http://x7nJBzm6.wqtzs.cn
http://oUZEy5uQ.wqtzs.cn
http://cfUUnsPt.wqtzs.cn
http://www.dtcms.com/a/371173.html

相关文章:

  • VSCode下载安装与汉化
  • JWT概念及使用详解
  • LwIP入门实战 — 3 以太网外设 (ETH)
  • PowerBI TopN Others
  • 【完整源码+数据集+部署教程】室内场景分割系统源码和数据集:改进yolo11-DWR
  • 零基础Linux操作基础小白快速掌握Shell脚本--流程控制和循环(二)
  • 笔记本连接显示屏显示不全如何解决
  • 【C++】vector 深度剖析及模拟实现
  • Leetcode hot100 最长连续序列
  • Python错误测试与调试——文档测试
  • AI浪潮下,人类创造力的“危”与“机”
  • ​MyBatis关键源码解析​
  • 使用Spring Boot DevTools快速重启功能
  • 【视网膜分割】AFMIP-Net:一种新型的自适应特征调制和隐式提示网络
  • 使用 n8n 结合通义千问大模型构建业务数据库分析智能体
  • 【完整源码+数据集+部署教程】水培植物病害检测系统源码和数据集:改进yolo11-AKConv
  • 解决 Gitee 中 git push 因邮箱隐私设置导致的失败问题
  • 网络中的PAT:小端口映射的大能量
  • 鸿蒙NEXT主题设置指南:应用级与页面级主题定制详解
  • 贪心算法应用:DNA自组装问题详解
  • GEE:基于自定义的年度时序数据集进行LandTrendr变化检测
  • 电子元器件+模拟电路硬件
  • 源码部署mysql8.0.40
  • STM32----W25QXX
  • 状压 dp --- 数据范围小
  • 赋值与深浅拷贝
  • Dart核心语言基础 集合 Map使用指南
  • 下载数据集用于图像分类并自动分为训练集和测试集方法
  • LLM 长上下文 RAG
  • 深入剖析Spring Boot启动流程