두가지 형태에 임시테이블이 있으며 ms-sql처럼 스키마까지 없어지지는 않는다.
필요없게되면 drop을 시켜야 함.
오라클은 (1)세션동안에만 존재하는 테이블/(2)트랜젝션동안에만 존재하는 테이블이 있음
(1) 세션을 기동하고 테이블을 생성하여 사용하며 그 세션을 종료하면 데이타가 사라지는 테이블.
create global temporary table table_name (컬럼...)
on commit preserve rows;
또는
create global temporary table table_name
on commit preserve rows
as select * from table;
(2)트랜젝션에서만 존재하는 즉 commit문을 만나면 데이타가 사라지는 테이블.
create global temporary table table_name (컬럼...)
on commit delete rows;
또는
create global temporary table table_name
on commit delete rows
as select * from table;
'DB' 카테고리의 다른 글
MongoDB Query (0) | 2022.08.26 |
---|---|
MongoDB (0) | 2022.08.26 |
Oracle SQL 튜닝 (0) | 2022.08.26 |
Oracle Hint (0) | 2022.08.26 |
Oracle Hot Backup Cold Backup (0) | 2022.08.26 |