oracle表空間無限擴容

2021-10-07 21:55:21 字數 770 閱讀 4295

查詢空間使用率:

select a.tablespace_name "表空間名",

total / 1024 / 1024 "表空間大小單位m",

free / 1024 / 1024 "表空間剩餘大小單位m",

(total - free) / 1024 / 1024 "表空間使用大小單位m",

round((total - free) / total, 4) * 100 "使用率   [[%]]"from

(select tablespace_name, sum(bytes) free

from dba_free_space

group by tablespace_name) a,

(select tablespace_name,

sum(bytes) total

from dba_data_files

group by tablespace_name) b where a.tablespace_name = b.tablespace_name;

檢視空間路徑以及空間名稱

select  * from dba_data_files;

已建立空間達到最大限度則停止擴容,下面是擴容語句,建立新檔案,並且無限擴容:

alter tablespace shr_data add datafile 'g:\oraclespace\shr\sh_data3.dbf' 

size 500m  autoextend on next 100m  maxsize unlimited ;

oracle表空間擴容

1 查詢當前表空間使用情況 col file name format a50 col space name format a15 select b.file name file name,b.tablespace name space name,b.bytes 1024 1024 munm,b.by...

Oracle 表空間擴容

查詢表空間的磁碟路徑sql select from dba data files 查詢表空間的大小sql m單位 select t.tablespace name,round sum bytes 1024 1024 0 ts size from dba tablespaces t,dba data ...

Oracle表空間擴容

oracle表空間擴容 首先檢視表空間所生的記憶體 select a.tablespace name,round a.total size total size mb round a.total size round b.free size,3 used size mb round b.free s...