the size of the Oracle query table, the usage of the table space, the default table space
The size of the Oracle query table, the usage of the table space, the default table space
--View a table takes up disk space (table name capitalization)
Select segment_name,sum (bytes)/1024/1024 from User_extents Group by segment_name have segment_name= ' table name ';
View user default table null is that
Select Username,default_tablespace from dba_users where username= ' SCOTT ';
--Table Space Idle
Select Tablespace_name, sum (bytes)/(1024*1024) as Free_space
From Dba_free_space
Group BY Tablespace_name;
--View the usage of the database table space
Select B.file_name Physical file name,
B.tablespace_name table Space,
b.bytes/1024/1024 size M,
(B.bytes-sum (NVL (a.bytes, 0))/1024/1024 used M,
SUBSTR ((B.bytes-sum (NVL (a.bytes, 0))/(b.bytes) * 100, 1, 5) utilization
From Dba_free_space A, dba_data_files b
where a.file_id = b.file_id
Group by B.tablespace_name, B.file_name, b.bytes
ORDER BY B.tablespace_name
--Edit the table space to enlarge the table space to 2M
ALTER DATABASE datafile '/ORADATA/RSZPDB/TEST1.DBF ' resize 2m;
If you do not know the address of '/oradata/rszpdb/test1.dbf ',
You can use the statement query:
Select B.file_name physical file name from Dba_free_space A, dba_data_files b
where a.file_id = b.file_id and b.tablespace_name = ' Table space name '
Group by B.tablespace_name, B.file_name, b.bytes
--Expand the tablespace by enlarging the data file to enlarge the table space by 1G (rcmt_test)
Alter tablespace rcmt_test add datafile '/oradata/rszpdb/rcmt_test2.dbf ' size 1G;
/ORADATA/RSZPDB/RCMT_TEST2.DBF: cannot be the same as the original data file name (original:/ORADATA/RSZPDB/RCMT_TEST1.DBF)
Rcmt_test: Table Space
1 g: Enlarge 1G
After the original data file rcmt_test1.dbf has been used, the space of RCMT_TEST2.DBF is automatically used.
The size of the Oracle query table, the usage of the table space, the default table space