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: ORA-01031: Create User in Procedure

Re: ORA-01031: Create User in Procedure

From: Chris Victor <cmv13_at_hotmail.com>
Date: 4 Dec 2001 10:30:38 -0800
Message-ID: <eafb3b45.0112041030.2e779f53@posting.google.com>


Does the proc creator have CREATE USER privs? The way you've got your proc defined, it's going to use its creator's privs to attempt to do the create user.

Gregory A. Castle <gcastle_at_email.usps.gov> wrote in message news:<c20b19b250725904347d32bf4cbd2817_at_spamfreenews.com>...
> [This followup was posted to comp.databases.oracle.server and a copy was
> sent to the cited author.]
>
> I have the following procedure that is executed from an insert trigger
> on an employee table. This procedure works correctly if I insert the
> data logged in as sys and with sysdba rights. With any other user, I
> receive ORA-01031: insufficent privileges. I can execute the statement
> in the procedure directly as another user without any problem. Any
> suggestions as to what privilege I need to have to run this procedure.
>
> create or replace procedure cr8user (cuser IN varchar2, cpass IN
> varchar2) is
> begin
>
> execute immediate 'create user ' || cuser || ' profile default
> identified by ' || cpass || ' default tablespace users temporary
> tablespace temp account unlock';
>
> end cr8user;
>
> cuser and cpass are passed by the insert trigger. I am using Oracle 8i,
> 8.1.5.
>
> Thanks in Advance for any help.
>
> Greg
Received on Tue Dec 04 2001 - 12:30:38 CST

Original text of this message

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