要調整Oracle表空間的大小,可以按照以下步驟操作:
SELECT tablespace_name FROM dba_tablespaces;
SELECT tablespace_name, SUM(bytes)/1024/1024 AS "Total(MB)", SUM(bytes)/1024/1024 - SUM(used_bytes)/1024/1024 AS "Free(MB)", SUM(used_bytes)/1024/1024 AS "Used(MB)" FROM dba_free_space WHERE tablespace_name = 'your_tablespace_name' GROUP BY tablespace_name;
ALTER TABLESPACE your_tablespace_name RESIZE 100M; --將表空間大小調整為100MB
SELECT tablespace_name, SUM(bytes)/1024/1024 AS "Total(MB)", SUM(bytes)/1024/1024 - SUM(used_bytes)/1024/1024 AS "Free(MB)", SUM(used_bytes)/1024/1024 AS "Used(MB)" FROM dba_free_space WHERE tablespace_name = 'your_tablespace_name' GROUP BY tablespace_name;
注意:在調整表空間大小之前,請確保有足夠的磁盤空間可用,并且謹慎操作以避免數據丟失或數據庫不可用的情況發生。