How do you set table for read only access ?

If i am updating one record in a table at that time no other user can't able insert ,update the record in same table How is it possible

Questions by nitin_kumat   answers by nitin_kumat

Showing Answers 1 - 30 of 30 Answers

sandeep katta

  • Apr 20th, 2007
 

You can use view for this purpose because you can set view as read only.

  Was this answer useful?  Yes

sippsin

  • Jul 22nd, 2008
 

you can select the table for updation

for eg: select * from emp for update;

no you can do the update/insert anything you want...

any other user or session would be able to do any insert/update to the same table only after you release the table by commit or rollback.....

Art11

  • Sep 27th, 2011
 

Specify READ ONLY to put the table in read-only mode. When the table is in READ ONLY mode, you cannot issue any DML statements that affect the table or any SELECT ... FOR UPDATE statements. You can issue DDL statements as long as they do not modify any table data. Operations on indexes associated with the table are allowed when the table is in READ ONLY mode.
Specify READ WRITE to return a read-only table to read/write mode.

Read only:
ALTER TABLE SALES READ ONLY;

Back to read/write:
ALTER TABLE SALES READ WRITE;

  Was this answer useful?  Yes

velan

  • Sep 11th, 2012
 

There are couple of ways
1) If there are user other than owner accessing this table then you can "grant select on TABLE_NAME"
2) Otherwise you DBA can create a role which will have only the privillege to only create table and assign this role to the user then even the owner of the table cannot manipulate the table data.

  Was this answer useful?  Yes

Smruti R Das

  • Sep 26th, 2012
 

GRANT SELECT ON table_name TO user_name

  Was this answer useful?  Yes

Aditya

  • Feb 28th, 2018
 

Lock table < table name > in exclusive mode;

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions