oracle表空间不足



查询所有的表空间

SELECT tablespace_name, block_size, initial_extent, next_extent, min_extents, max_extents, status, contents, logging, allocation_type, extent_management, segment_space_management FROM dba_tablespaces; SELECT tablespace_name,–表空间名称 file_id,–文件ID file_name,–文件名 round( bytes / ( 1024 * 1024 ), 0 ) total_space –数据文件大小(M) FROM dba_data_files WHERE tablespace_name = ‘TSP_DPSTAR’ ORDER BY tablespace_name; –查询表空间文件 ALTER database datafile ‘/u01/app/oracle/product/11.2.0/dbhome_1/dbs/dpstar_temp01.dbf’ r esize 32000M; –修改已有数据文件大小 根据用户查询所在表空间 select default_tablespace from dba_users where username=‘DATA_PLATFORM’; select a.tablespace_name as “表空间名” , a.bytes / 1024 / 1024 as “表空间大小(M)” , (a.bytes - b.bytes) / 1024 / 1024 as “已使用空间(M)” , b.bytes / 1024 / 1024 “空闲空间(M)” , round(((a.bytes - b.bytes) / a.bytes) * 100, 2) “使用比” from ( select tablespace_name, sum (bytes) bytes from dba_data_files group by tablespace_name) a, ( select tablespace_name, sum (bytes) bytes, max (bytes) largest from dba_free_space group by tablespace_name) b where a.tablespace_name = b.tablespace_name

order by ((a.bytes - b.bytes) / a.bytes) desc ;