Home » RDBMS Server » Server Administration » Grants of Select Privilege Thru Stored Procedure (Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.21.0.0.0)
Grants of Select Privilege Thru Stored Procedure [message #689527] |
Mon, 05 February 2024 10:05  |
wtolentino
Messages: 422 Registered: March 2005
|
Senior Member |
|
|
I have this procedure
SQL> create or replace procedure sqldba.proc_test_grant as
2 begin
3 execute immediate 'grant SELECT on TEST1.TEST_SEQUENCE_10 to DMMCODEOWNER';
4 end;
5 /
Procedure created.
When run the procedure is run by other schema
SQL> select user from dual;
USER
--------------------------------------------------------------------------------
DMMCODEOWNER
SQL> exec sqldba.proc_test_grant;
BEGIN sqldba.proc_test_grant; END;
*
ERROR at line 1:
ORA-01031: insufficient privileges
ORA-06512: at "SQLDBA.PROC_TEST_GRANT", line 3
ORA-06512: at line 1
SQL
But when run direclty by the schema who owned the procedure it is working fine
SQL> select user from dual;
USER
--------------------------------------------------------------------------------
SQLDBA
SQL> grant SELECT on TEST1.TEST_SEQUENCE_10 to DMMCODEOWNER;
Grant succeeded.
SQL>
I thinkI am missing something. Please advise. Thank you.
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Sat May 03 13:49:27 CDT 2025
|