Home » RDBMS Server » Server Administration » Assigning privilege
Assigning privilege [message #264637] Tue, 04 September 2007 01:25 Go to next message
M.Shakeel Azeem
Messages: 226
Registered: September 2006
Senior Member
Dear All,

I want to write a procedure that will assign the same privilege on one to another user
for example
i want to assign the same privilege to user2 as user1 by using a procedure

can please help me in this regard?

[Updated on: Wed, 05 September 2007 08:08] by Moderator

Report message to a moderator

Re: Assigning privilege [message #264639 is a reply to message #264637] Tue, 04 September 2007 01:32 Go to previous messageGo to next message
Michel Cadot
Messages: 64121
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
dba_role_privs
dba_sys_privs
dba_tab_privs
dba_col_privs

Regards
Michel
Re: Assigning privilege [message #264684 is a reply to message #264637] Tue, 04 September 2007 03:22 Go to previous messageGo to next message
Mohammad Taj
Messages: 2412
Registered: September 2006
Location: Dubai, UAE
Senior Member

Hi,

YOu can Create One ROLE and assign privs what you want to grant every user then grant ROLE to each user.


Regards
Taj
Re: Assigning privilege [message #264991 is a reply to message #264637] Wed, 05 September 2007 03:37 Go to previous messageGo to next message
ora_zhp
Messages: 10
Registered: September 2007
Junior Member
you can try :
grant execute on proc_name to user2;
grant alter any procedure to user2;
Re: Assigning privilege [message #264999 is a reply to message #264991] Wed, 05 September 2007 04:04 Go to previous messageGo to next message
Michel Cadot
Messages: 64121
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
How is this related to the question?
How does this grant the same privilege to a user as to another user?

Regards
Michel
Re: Assigning privilege [message #265153 is a reply to message #264639] Wed, 05 September 2007 09:59 Go to previous messageGo to next message
DreamzZ
Messages: 1666
Registered: May 2007
Location: Dreamzland
Senior Member
Quote:

i want to assign the same privilege to user2 as user1 by using a procedure


Through procedure

Quote:
grant execute on proc_name to user2;
grant alter any procedure to user2;


not on procedure.
Re: Assigning privilege [message #287520 is a reply to message #265153] Wed, 12 December 2007 08:53 Go to previous messageGo to next message
ora_zhp
Messages: 10
Registered: September 2007
Junior Member
like this???
CREATE OR REPLACE PROCEDURE p_test AS
BEGIN
EXECUTE IMMEDIATE 'grant execute on <proc_name> to <another_username>';
END ;
Re: Assigning privilege [message #287522 is a reply to message #287520] Wed, 12 December 2007 08:57 Go to previous message
ora_zhp
Messages: 10
Registered: September 2007
Junior Member
CREATE OR REPLACE PROCEDURE p_test(user_name VARCHAR2,proc_name VARCHAR2) AS
BEGIN
EXECUTE IMMEDIATE 'grant execute on '||proc_name ||' to '||user_name;
END ;
Previous Topic: how we can track daily inserted record in tables
Next Topic: Different between ROLLBACK and COMMIT
Goto Forum:
  


Current Time: Wed Dec 07 02:45:33 CST 2016

Total time taken to generate the page: 0.10222 seconds