---
title: "Oracle的ORA-02292报错：违反完整性约束，已找到子记录"
author: "lin358"
date: "2019-09-20T10:59:34Z"
tags: []
categories: ["数据库"]
slug: "oracle-ora-02292"
draft: false
lastmod: "2019-09-20T10:59:34Z"
id: 2470318
url: "https://lin358.iteye.com/blog/2470318"
---

第一步就是找到子表的记录：
select a.constraint_name, a.table_name, b.constraint_name 
from user_constraints a, user_constraints b
where a.constraint_type = 'R' 
and b.constraint_type = 'P' 
and a.r_constraint_name = b.constraint_name
and a.constraint_name = 'FKXXX' --提示的报错信息FK...填入这里。
第二步：
删除子表中的所有记录。 
第三步：
就可以轻松删除主表的记录啦。