Home » RDBMS Server » Server Administration » Grant Syntax (Oracle 10g)
Grant Syntax [message #453662] Fri, 30 April 2010 03:54 Go to next message
mjkreddy1927
Messages: 20
Registered: February 2007
Junior Member
Hi i have a senario, where i need to give the privilage to user on the table in a schema.

Now there is a table which already has certain privilages to the user, so now i need to give the same all privilages to the other newly created table to the particular table.

Sample query:
Table X and Y.
X has some 1,2,3,4...10 privileges to ABC user.
Now i created new table Y and i want to give the same all privilages to the ABC user.

is there any syntax which can do so.
Which can acquire all the privilages same X does.

please help me out.

[EDITED by LF: fixed topic title typo]

[Updated on: Fri, 30 April 2010 04:27] by Moderator

Report message to a moderator

Re: Grant Syantax [message #453664 is a reply to message #453662] Fri, 30 April 2010 04:11 Go to previous messageGo to next message
Its_me_ved
Messages: 979
Registered: October 2009
Location: India
Senior Member
Please go through the link


The Syntax for the GRANT command is:
GRANT privilege_name
ON object_name
TO {user_name |PUBLIC |role_name}
[WITH GRANT OPTION];
/*Be careful while using WITH GRANT OPTION [Please follow the doc link ] */



For Eample: GRANT SELECT ON employee TO user1;This command grants a SELECT permission on employee table to user1.You should use the WITH GRANT option carefully because for example if you GRANT SELECT privilege on employee table to user1 using the WITH GRANT option, then user1 can GRANT SELECT privilege on employee table to another user, such as user2 etc. Later, if you REVOKE the SELECT privilege on employee from user1, still user2 will have SELECT privilege on employee table.

You can also have a look at the table user_tab_privs

Thanks
Ved

[Updated on: Fri, 30 April 2010 04:21]

Report message to a moderator

Re: Grant Syntax [message #453667 is a reply to message #453662] Fri, 30 April 2010 04:29 Go to previous messageGo to next message
Littlefoot
Messages: 21809
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
You could perhaps consider creating a role, grant privileges to that role, and - finally - grant role to every new user that requires those privileges.
Re: Grant Syntax [message #455512 is a reply to message #453667] Tue, 11 May 2010 23:48 Go to previous message
rahulvb
Messages: 924
Registered: October 2009
Location: Somewhere Near Equator.
Senior Member
Follow the link Role
Previous Topic: difficulty in comprehension of different logs
Next Topic: why RBS need 2 atleast extents
Goto Forum:
  


Current Time: Sun May 19 15:37:11 CDT 2024