TABLESPACE 관련된 명령어는 모두 SYS 계정을 통하여 쿼리문을 실행


- tablespace 목록 조회

1
2
3
4
5
6
7
8
9
09:20:28 SQL> SELECT TABLESPACE_NAME, STATUS, CONTENTS FROM DBA_TABLESPACES;
 
TABLESPACE_NAME                                              STATUS             CONTENTS
------------------------------------------------------------ ------------------ ------------------
SYSTEM                                                       ONLINE             PERMANENT
SYSAUX                                                       ONLINE             PERMANENT
UNDOTBS1                                                     ONLINE             UNDO
TEMP                                                         ONLINE             TEMPORARY
USERS                                                        ONLINE             PERMANENT
cs



- tablespace 저장된 파일 목록 조회

1
09:24:05 SQL> SELECT FILE_NAME, TABLESPACE_NAME, BYTES, STATUS FROM DBA_DATA_FILES;
cs



- tablespace 남은 공간 크기 조회

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
09:24:06 SQL> SELECT TABLESPACE_NAME, BYTES, BLOCKS FROM DBA_FREE_SPACE;
 
TABLESPACE_NAME                                                   BYTES     BLOCKS
------------------------------------------------------------ ---------- ----------
SYSTEM                                                        193593344      23632
SYSAUX                                                            65536          8
SYSAUX                                                            65536          8
SYSAUX                                                           196608         24
SYSAUX                                                           720896         88
SYSAUX                                                           131072         16
SYSAUX                                                            65536          8
SYSAUX                                                            65536          8
SYSAUX                                                            65536          8
SYSAUX                                                           262144         32
SYSAUX                                                           720896         88
 
TABLESPACE_NAME                                                   BYTES     BLOCKS
------------------------------------------------------------ ---------- ----------
SYSAUX                                                         33554432       4096
UNDOTBS1                                                          65536          8
UNDOTBS1                                                         655360         80
UNDOTBS1                                                         262144         32
UNDOTBS1                                                         327680         40
UNDOTBS1                                                         655360         80
UNDOTBS1                                                       61865984       7552
UNDOTBS1                                                        1048576        128
UNDOTBS1                                                      316669952      38656
USERS                                                         102170624      12472
cs



- tablespace 삭제

1
2
3
09:26:16 SQL> DROP TABLESPACE (TABLESPACE-NAME) INCLUDING CONTENTS AND DATAFILES CASCADE CONSTRAINTS;
 
Tablespace dropped.
cs



Posted by doubler
,