양치치의 아카이브

데이터베이스 테이블 용량 늘리기 본문

코린이의 데이터베이스 일기장

데이터베이스 테이블 용량 늘리기

넥타르 2022. 11. 1. 15:56

select  
       a.tablespace_name "TS NAME", 
       a.bytes "TOTAL SIZE(MB)",
       (a.bytes-b.bytes) "USED SIZE(MB)",
       b.bytes "FREE SIZE(MB)",  
       (a.bytes-b.bytes)/(a.bytes)*100 "USED(%)"
from ( select sum(bytes)/1024/1024 bytes, tablespace_name
       from dba_data_files
       group by tablespace_name ) a,
     ( select nvl(sum(bytes)/1024/1024,0) bytes, nvl(max(bytes)/1024/1024,0) max_free, tablespace_name
       from dba_free_space
       group by tablespace_name )  b
where a.tablespace_name = b.tablespace_name(+)
order by a.tablespace_name

 

 

용량 확인

 

alter tablespace SYSTEM add datafile 'C:/oraclexe/app/oracle/oradata/XE/USERS2.DBF' size 1000m;

 

사이즈 변경

'코린이의 데이터베이스 일기장' 카테고리의 다른 글

계층형쿼리 (Start with Connect by)  (0) 2022.12.23
oracle 반복문(insert) Loop 사용  (0) 2022.11.07
데이터베이스 정규화  (0) 2022.07.18
where 1 = 1  (0) 2022.07.06
SQL문 연습  (0) 2022.06.14
Comments