New in Oracle 11g: Read Only Tables

In Oracle 11g database it is possible to make a table really read only, also for the owner of that table. Until now a table could only be made read only to other users, by granting only the select privilege to these users. But the owner of the table was always able to do updates and inserts. With the new statement: alter table <table name> read only the table is really read only. And you can reverse it again with: alter table <table name> read write. A small example: ....

SQL> alter table emp read only;

Table altered.

SQL> update emp
2  set comm = comm * 1.1;
update emp
*ERROR at line 1:ORA-12081: update operation not allowed on table "JURGEN"."EMP"

SQL> alter table emp read write;

Table altered.

SQL> update emp
2  set comm = comm * 1.1;

14 rows updated.

SQL>

3 Comments

  1. Awnings Durban September 9, 2011
  2. Asif Momen September 17, 2007
  3. Pete_S August 7, 2007