
💡 절대로 수정하면 안되고 읽기만 해야하는 테이블들을 저장하는 테이블 스페이스를 생성할 때
create tablespace ts100
datafile '/home/oracle/ts100.dbf' size 2m;
SCOTT @ ora19dw > create table emp105
tablespace ts100
as
select *
from scott.emp;
테이블이 생성되었습니다.
alter tablespace ts100 read only;
select tablespace_name, status from dba_tablespaces;
SCOTT @ ora19dw > update emp105
2 set sal = 0;
update emp105
*
1행에 오류:
ORA-00372: 파일 12는 지금 수정될 수 없습니다 ORA-01110: 12
데이터 파일: '/home/oracle/ts100.dbf'
SCOTT @ ora19dw > drop table emp105;
테이블이 삭제되었습니다
💡 read only지만 되는 이유
: drop은 데이터 사전에서만 지우기 때문에 가능한 것
데이터 사전이 있는 테이블스페이스는 system 테이블스페이스에 있기 때문에 가능
SCOTT @ ora19dw > flashback table emp105 to before drop;
플래시백이 완료되었습니다.
alter tablespace ts100 read write;
select tablespace_name, status from dba_tablespaces;