
bigfile tablespace: 하나의 테이블 스페이스에 하나의 데이터 파일만 저장할 수 있고, 그 하나의 파일의 크기가 128 테라바이트까지 생성할 수 있음
small file tablespace: 하나의 테이블 스페이스에 여러개의 데이터 파일들을 생성할 수 있는 테이블 스페이스
SQL> ed ts.sql
SQL> !cat ts.sql
col tablespace_name for a10
col file_name for a55
col mb_size for 9999
select tablespace_name, file_name, bytes/1024/1024 mb_size
from dba_data_files
order by tablespace_name asc;
SQL> create tablespace ts04
datafile '/u01/app/oracle/oradata/ORA19/ts04a.dbf' size 10m,
'/u01/app/oracle/oradata/ORA19/ts04b.dbf' size 10m;
SQL> @ts
TABLESPACE FILE_NAME MB_SIZE
---------- ------------------------------------------------------- -------
SYSAUX /u01/app/oracle/oradata/ORA19/sysaux01.dbf 640
SYSTEM /u01/app/oracle/oradata/ORA19/system01.dbf 1330
TS01 /u01/app/oracle/oradata/ORA19/ts01b.dbf 30
TS01 /u01/app/oracle/oradata/ORA19/ts01.dbf 10
TS02 /u01/app/oracle/oradata/ORA19/ts02.dbf 20
TS02 /u01/app/oracle/oradata/ORA19/ts02b.dbf 20
TS03 /u01/app/oracle/oradata/ORA19/ts03.dbf 20
TS04 /u01/app/oracle/oradata/ORA19/ts04a.dbf 10
TS04 /u01/app/oracle/oradata/ORA19/ts04b.dbf 10
UNDOTBS1 /u01/app/oracle/oradata/ORA19/undotbs01.dbf 410
USERS /u01/app/oracle/oradata/ORA19/users01.dbf 110
11 행이 선택되었습니다.
SQL> create bigfile tablespace test_big
2 datafile '/u01/app/oracle/oradata/ORA19/test_big.dbf' size 10m;
테이블스페이스가 생성되었습니다.
SQL> select tablespace_name, bigfile
from dba_tablespaces;
TABLESPACE BIG
---------- ---
SYSTEM NO
SYSAUX NO
UNDOTBS1 NO
TEMP NO
USERS NO
TS01 NO
TS02 NO
TS03 NO
TS04 NO
TEST_BIG YES
SQL> alter tablespace ts04
add datafile '/u01/app/oracle/oradata/ORA19/ts04c.dbf' size 10m;
테이블스페이스가 변경되었습니다.
SQL>
SQL> @ts
TABLESPACE FILE_NAME MB_SIZE
---------- ------------------------------------------------------- -------
SYSAUX /u01/app/oracle/oradata/ORA19/sysaux01.dbf 640
SYSTEM /u01/app/oracle/oradata/ORA19/system01.dbf 1330
TEST_BIG /u01/app/oracle/oradata/ORA19/test_big.dbf 10
TS01 /u01/app/oracle/oradata/ORA19/ts01b.dbf 30
TS01 /u01/app/oracle/oradata/ORA19/ts01.dbf 10
TS02 /u01/app/oracle/oradata/ORA19/ts02.dbf 20
TS02 /u01/app/oracle/oradata/ORA19/ts02b.dbf 20
TS03 /u01/app/oracle/oradata/ORA19/ts03.dbf 20
TS04 /u01/app/oracle/oradata/ORA19/ts04c.dbf 10
TS04 /u01/app/oracle/oradata/ORA19/ts04a.dbf 10
TS04 /u01/app/oracle/oradata/ORA19/ts04b.dbf 10
UNDOTBS1 /u01/app/oracle/oradata/ORA19/undotbs01.dbf 410
USERS /u01/app/oracle/oradata/ORA19/users01.dbf 110
💡 small file 테이블 스페이스는 여러 개의 데이터 파일을 포함할 수 있음
--> bigfile 테이블 스페이스는 data file 추가 불가능
SQL> alter tablespace test_big
add datafile '/u01/app/oracle/oradata/ORA19/test_big02.dbf' size 10m;
alter tablespace test_big
*
1행에 오류:
ORA-32771: bigfile 테이블스페이스에 파일을 추가할 수 없음
SQL> alter database datafile
'/u01/app/oracle/oradata/ORA19/test_big.dbf' resize 20m;
데이타베이스가 변경되었습니다.
💡 bigfile 테이블 스페이스는 data file 추가는 불가능하지만,
사이즈를 늘리는 것(resize)은 가능