You are on page 1of 9

Read-Only Tables in Oracle 11g

- Sagar T

Read-Only Table

A Read-Only table is a normal data storage table, which restricts any transactional action on it i.e. no user including the owner can perform DDL* or DML actions on it

Before Oracle 11g

READ-ONLY mode could only be associated with the database and tablespace. A table could be made read-only by granting only SELECT on it to users other than the owner of the table. Possible way to impose restriction on transactions was through check constraint method or through triggers

Imposing restrictions before 11g

Using Trigger

Using Constraint

Disadvantage: Implementation overhead

Read Only in Oracle 11g

With 11g release, a table can be established in READ-ONLY mode. The mode restricts all DML operations and DDL operations (TRUNCATE and ALTER). Advantage

enhances security at table level.

Working with Read Only tables


Altering table to Read only mode ALTER TABLE <table_name> READ ONLY;

A table in READ-ONLY mode can be switched back to READ WRITE mode: ALTER TABLE <table_name> READ WRITE;

Restricted Actions on Read Only Tables

Permitted Actions on Read-only Table


CREATE/ ALTER/ DROP INDEX
ALTER TABLE ADD/ MODIFY/ DROP/ ENABLE/ DISABLE CONSTRAINT

SELECT
PERMITTED ACTIONS ON READ-ONLY TABLE

DROP TABLE

ALTER TABLE DROP UNUSED COLUMNS

THANK YOU !