添加FK约束时权限不足(Oracle) [英] Insufficient privileges when adding FK constraint (Oracle)

查看:170
本文介绍了添加FK约束时权限不足(Oracle)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ALTER TABLE LAB_ADMIN_USER.TEST_TEMPLATE_ABBR ADD (
   CONSTRAINT TEST_TEMPLATE_ABBR_R01 
FOREIGN KEY (test_template_id) 
REFERENCES LAB_ADMIN.TEST_TEMPLATE (test_template_id)
   ON DELETE CASCADE)

执行上述命令时,最可能导致"ORA = 01031:权限不足"的原因是什么?换句话说,LAB_ADMIN_USER最有可能没有什么权限?

What is the most likely cause of 'ORA=01031: insufficient privileges' when executing the command above? In other words, what permission does LAB_ADMIN_USER most likely not have?

我已经成功创建了表,并尝试将FK约束添加为LAB_ADMIN_USER.

I already created the table successfully and attempted to add the FK constraint as LAB_ADMIN_USER.

推荐答案

具有主键的表由另一个模式LAB_ADMIN拥有.该用户必须在TEST_TEMPLATE上向LAB_ADMIN_USER授予REFERENCES.

The table with the primary key is owned by a different schema - LAB_ADMIN. That user must grant REFERENCES on TEST_TEMPLATE to LAB_ADMIN_USER.

这篇关于添加FK约束时权限不足(Oracle)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆