Grant Select Permission [message #245439] |
Sun, 17 June 2007 04:13 |
Arju
Messages: 1554 Registered: June 2007 Location: Dhaka,Bangladesh. Mobile:...
|
Senior Member |
|
|
I want to give permission to user 'arju' only select permission. Under user arju there are 300 tablse. I want to give only select permission to user arju to all these 300 tables. How I can do this
at a time without explicitly giving individual table (select) permission .
[Updated on: Sun, 17 June 2007 04:14] Report message to a moderator
|
|
|
|
Re: Grant Select Permission [message #245443 is a reply to message #245439] |
Sun, 17 June 2007 04:41 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Quote: | Under user arju there are 300 tables. I want to give only select permission to user arju to all these 300 tables.
|
If ARJU owns those tables, he can do anything with them - query them, update, insert records into them, even drop them.
If you'd like to have only SELECT privilege, you'll have to create another user and grant SELECT explicitly for every single table, one by one.
Of course, you won't do that by typing all 300 lines in editor, but use a script which will do that for you; something like this:SELECT 'GRANT SELECT ON ' || table_name || ' TO newly_created_user;'
FROM user_tables;
Spool the result of the query into a file and run it at the SQL*Plus prompt.
|
|
|
|
|
|
|
|
|