DYNAMIC SQL - Create DATABASE LINK, ORA-1031

From: SAM <u4immsm9_at_cpc25.usace.army.mil>
Date: 1997/04/25
Message-ID: <3360FCBD.A74_at_cpc25.usace.army.mil>#1/1


My server version is Oracle 7.2.3. I'm running under Solaris 2.5.

I created a Procedure for dynamically execute sql statements in a dba schema. It is failing with ORA-01031 [insufficient privilege] when executing the procedure to creating database link, but I can drop database link.

When I create the procedure in sys schema it works, but it creates the db-link in sys schema. )

The same procedure worked on another database with same configuration .

  • eg: EXE_SQL('create database link tmp using ''tmp''');

create or Replace PROCEDURE
EXE_SQL (SQL_CMD in varchar2 ) IS
cur1 integer := DBMS_SQL.open_cursor;
ret1 integer;
V7 integer := 1;
begin

   DBMS_SQL.PARSE(cur1,SQL_CMD,V7);
   ret1 := DBMS_SQL.execute(cur1);
DBMS_SQL.close_cursor(cur1);
END; Advice or assistance of any sort would be greatly appreciated.

Thanking you in advance,

(Sam Mathews) Received on Fri Apr 25 1997 - 00:00:00 CEST

Original text of this message