The total size of the lookup table space, the remaining table space, used space, occupied by the size of the table, one day occupy the size of the

Reference: http: //blog.csdn.net/cosio/article/details/3978747, https://zhidao.baidu.com/question/628524115699308364.html

block block
extent region
segment section

--增加USERS表空间500M空间
alter tablespace USERS add datafile '/data01/oradata/bidb96/USER_test30.bdf' size 500M;
select file_name , tablespace_name, t.* from dba_data_files t where tablespace_name = 'USERS' order by file_id;


- each table space occupied by the
SELECT segment_name, SUM (bytes) / 1024/1024/1024 GB
from user_segments --where segment_name = 'TR_GOV_WJ_XNH_D'
Group by segment_name;


--20,190,530 day TW layer footprint
SELECT COUNT (DISTINCT segment_name) tb_cnt, SUM (bytes) / (1024 * 1024 * 1024) GB
from user_segments T
WHERE partition_name = 'P_20190530'
and segment_name like '% TW';

---- See Table remaining space Summary
SELECT t1 tablespace, z total tablespaces, zs table has space, s remaining tablespace, ROUND ((zs) / z * 100,2) " Usage%"
the From (the Select tablespace_name T1, the Sum (bytes) / (1024 * 1024 * 1024) S
 the From DBA_FREE_SPACE Group by tablespace_name),
 (the Select tablespace_name T2, the Sum (bytes) / (1024 * 1024 * 1024) Z
 the From the DBA_DATA_FILES Group by tablespace_name) the Where T1 = t2;


--- tablespace total space  
select tablespace_name, sum (bytes) / (1024 * 1024 * 1024 ) from GB dba_data_files
Group by tablespace_name
;
- tablespace remaining space
select tablespace_name, sum (bytes) / (1024 * 1024 * 1024 ) from GB user_free_space
Group by tablespace_name
;
- physical footprint (table, partition, index, etc.) the space occupied by the table space tablespace and all the objects that it is the same size DBA_DATA_FILES
select tablespace_name, sum (bytes) / (1024 * 1024 * 1024) from GB user_segments
Group by tablespace_name
;

---- Table actual size of the sum of this size must be <size DBA_DATA_FILES, because only the table, this seemingly does not update
select table_name, (num_rows * avg_row_len) / (1024 * 1024 * 1024) The table size GB
from USER_TABLES 
the WHERE table_name = 'table uppercase' --672699 of data 0.306965947151184GB
Order by desc 2

Guess you like

Origin www.cnblogs.com/jiangqingfeng/p/10956749.html