Saturday, January 19, 2013

Oracle 11.1 and above read-only tables

In Oracle 11.1 and above you can use alter table clause to change table to read-only or read-write mode.

Change table to read-only:
SQL> alter table test_table read only;

After this users can't run deletes, inserts or updates for changed table.

Change table to read-write:

SQL> alter table test_table read write;

After this users can again run deletes, inserts or updates for this table.

You can check table mode from user_tables, all_tables or dba_tables views (check the READ_ONLY column).

No comments:

Post a Comment