// Check the table space case
SELECT Upper (F.TABLESPACE_NAME) "table space",
D.TOT_GROOTTE_MB "table space (M)",
D.TOT_GROOTTE_MB - F.TOTAL_BYTES "used space (M)",
To_char (Round ((D.TOT_GROOTTE_MB - F.TOTAL_BYTES) / D.TOT_GROOTTE_MB * 100, 2), '990.99')
|| '%' "use than",
F.TOTAL_BYTES "free space (M)",
F.MAX_BYTES "maximum block (M)"
the FROM (the SELECT TABLESPACE_NAME,
Round (the Sum (BYTES) / (1024 * 1024), 2) TOTAL_BYTES,
Round (Max (BYTES) / (1024 * 1024), 2) MAX_BYTES
the FROM SYS.DBA_FREE_SPACE
the GROUP BY TABLESPACE_NAME) F.,
(the SELECT DD .TABLESPACE_NAME,
Round (the Sum (DD.BYTES) / (1024 * 1024), 2) TOT_GROOTTE_MB
the FROM DD SYS.DBA_DATA_FILES
the GROUP BY DD.TABLESPACE_NAME) D
the WHERE D.TABLESPACE_NAME = F.TABLESPACE_NAME
ORDER BY 1
// lookup table space file location
select tablespace_name, file_id, file_name,round(bytes/(1024*1024),0) total_space from dba_data_files order by tablespace_name
// Add the statement table space
The ALTER TABLESPACE tablespace name the ADD DATAFILE ' + datadg / ORCL / datafile / SP07_05.dbf ' SIZE 30720M; - - file path tablespace '+ DATADG / orcl / datafile / SP07_05.dbf'
Create a new table space and a new user instances:
create TABLESPACE ssdev DATAFILE 'E:\APP\WUJJ\ORADATA\ORCL\SSDEV.DBF' SIZE 100M; create user ssdev identified by wujingjun default tablespace ssdev; grant connect,resource to ssdev; grant create session to ssdev;
Reproduced in: https: //www.cnblogs.com/tuanz/p/6874185.html