Insufficient privileges when adding FK constraint (Oracle)

喜你入骨 提交于 2019-12-22 01:37:14

问题


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)

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?

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


回答1:


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.



来源:https://stackoverflow.com/questions/1262801/insufficient-privileges-when-adding-fk-constraint-oracle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!