Home » RDBMS Server » Server Administration » ORA-01031: insufficient privileges
ORA-01031: insufficient privileges [message #303277] Thu, 28 February 2008 11:19 Go to next message
caprikar
Messages: 226
Registered: March 2007
Senior Member
Hi,
I create a table and constraints in a schema REF with the following statments and granted access to INT user. And when I try to create a foreign key for a table in INT, I'm getting "ORA-01031: insufficient privileges"

CREATE TABLE REF.MTHD_LKUP (
       MTHD_CD         VARCHAR2(4 BYTE) NOT NULL,
       MTHD_DESC       VARCHAR2(60 BYTE) NULL,
       CREATE_DT       DATE DEFAULT sysdate NULL,
       CREATE_USER_ID  VARCHAR2(30 BYTE) DEFAULT user NULL,
       UPDATE_DT       DATE DEFAULT sysdate NULL,
       UPDATE_USER_ID  VARCHAR2(30 BYTE) DEFAULT user NULL,
       DEACTV_DT       DATE NULL
);

Table created.

ALTER TABLE REF.MTHD_LKUP
           ADD (
  CONSTRAINT PK_MTHD_LKUP
 PRIMARY KEY
 (MTHD_CD));

Table altered.

GRANT SELECT, UPDATE, INSERT, DELETE ON REF.MTHD_LKUP TO INT;

Grant succeeded.

CREATE TABLE INT.SRVC_SPCL (
 SRVC_NAME                               VARCHAR2(60),
 SRVC_DESC                               VARCHAR2(150),
 SRVC_LONG_DESC                          VARCHAR2(250),
 MTHD_CD                                 VARCHAR2(4)
);

Table created.

ALTER TABLE INT.SRVC_SPCL ADD (
  CONSTRAINT FK_SRVC_SPEC_MTHD 
 FOREIGN KEY (MTHD_CD) 
 REFERENCES REF.MTHD_LKUP(MTHD_CD)
    ON DELETE SET NULL);
 REFERENCES REF.MTHD_LKUP(MTHD_CD)
                *
ERROR at line 4:
ORA-01031: insufficient privileges




-can anyone tell me what could be the problem?

Thanks,
GK


Re: ORA-01031: insufficient privileges [message #303278 is a reply to message #303277] Thu, 28 February 2008 11:33 Go to previous messageGo to next message
varu123
Messages: 754
Registered: October 2007
Senior Member
grant references (MTHD_CD) on REF.MTHD_LKUP to INT;

Re: ORA-01031: insufficient privileges [message #303285 is a reply to message #303277] Thu, 28 February 2008 12:22 Go to previous message
caprikar
Messages: 226
Registered: March 2007
Senior Member
Thanks, that worked.
Previous Topic: Buffer Busy wait
Next Topic: Character set conversion
Goto Forum:
  


Current Time: Fri Dec 02 23:03:21 CST 2016

Total time taken to generate the page: 0.09677 seconds