Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Create database link from inside a stored procedure

Re: Create database link from inside a stored procedure

From: DA Morgan <damorgan_at_psoug.org>
Date: Tue, 28 Mar 2006 09:11:05 -0800
Message-ID: <1143565857.296801@yasure.drizzle.com>


Jeremy wrote:
> Hi there - if an Oracle account that has privileges to create a database
> link tries to run a stored procedure owned by the same account and
> whilst connected to the same account, why should one get an
> "insufficient privileges" error / what privileges might be required?
>
> e.g.
>
> 15:49:22 SQL> create database link mylink
> 2 connect to a identified by b using 'c' ;
>
> Database link created.
>
>
> But the same statement in an "execute immediate" inside a stored
> procedure gets an ORA-01031: insufficient privileges
>
> Thanks for any pointers.

The system privilege to create a database link is granted as follows:

GRANT create database link TO <schema_name>;

However doing this within a stored procedure is a terrible idea by almost any definition. What is the business case that justifies such an activity in PL/SQL?

-- 
Daniel A. Morgan
http://www.psoug.org
damorgan_at_x.washington.edu
(replace x with u to respond)
Received on Tue Mar 28 2006 - 11:11:05 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US