READ-ONLY TABLE IN 11G

posted Feb 1, 2012, 4:54 PM by Sachchida Ojha
In 11G , ALTER TABLE Command can be used to make a table READ-ONLY. A new column in the [DBA/ALL/USER]_TABLES view, READ_ONLY, has been added to help you determine if a table is READ-ERITE or READ-ONLY.

SQL> create table emp(id number(10), first_name varchar(32), last_name varchar(32));

Table created.

SQL> insert into emp values(1,'Sachchida', 'Ojha');

1 row created.

SQL>
SQL> commit;

Commit complete.

SQL> delete from emp;

1 row deleted.

SQL>
SQL> rollback;

Rollback complete.

SQL> commit;

Commit complete.

SQL> alter table emp read only;

Table altered.

SQL> delete from emp;
delete from emp
            *
ERROR at line 1:
ORA-12081: update operation not allowed on table "DBAREF"."EMP"


SQL>


Comments