zl程序教程

您现在的位置是:首页 >  数据库

当前栏目

ORA-25158: Cannot specify RELY for foreign key if the associated primary key is NORELY ORACLE 报错 故障修复 远程处理

Oracle ORA 故障 处理 远程 报错 修复 for
2023-06-13 09:19:01 时间
ORA-25158: Cannot specify RELY for foreign key if the associated primary key is NORELY ORACLE 报错 故障修复 远程处理
文档解释

ORA-25158: Cannot specify RELY for foreign key if the associated primary key is NORELY

Cause: RELY is specified for the foreign key contraint, when the associated primary key constraint is NORELY.

Action: Change the option of the primary key also to RELY.

ORA-25158 错误指示不能为具有NORELY主键的外键指定RELY选项。

如果创建外键时主键属性为NORELY,则不能为外键设置RELY属性。所以要么让外键使用NORELY属性,要么让主键使用RELY属性。

当您使用以下语句创建外键时,将会出现这个错误:

ALTER TABLE child

ADD CONSTRAINT child_fk

FOREIGN KEY (parent_id)

REFERENCES parent (id);

一般处理方法及步骤

要解决这个错误,您可以为主键添加RELY属性:

ALTER TABLE parent

MODIFY id NOT NULL RELY;

或者您可以为外键添加NORELY属性:

ALTER TABLE child

ADD CONSTRAINT child_fk

FOREIGN KEY (parent_id)

REFERENCES parent (id)

NO RELY;


我想要获取技术服务或软件
服务范围:MySQL、ORACLE、SQLSERVER、MongoDB、PostgreSQL 、程序问题
服务方式:远程服务、电话支持、现场服务,沟通指定方式服务
技术标签:数据恢复、安装配置、数据迁移、集群容灾、异常处理、其它问题

本站部分文章参考或来源于网络,如有侵权请联系站长。
数据库远程运维 ORA-25158: Cannot specify RELY for foreign key if the associated primary key is NORELY ORACLE 报错 故障修复 远程处理