Oracle tablespace management is still unfamiliar to many new users who are new to oracle databases. The following describes how to manage tablespaces in oracle for your reference.
-- View table space usage
Select upper (F. TABLESPACE_NAME) "tablespace name ",
D. TOT_GROOTTE_MB "tablespace size (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 ),
'1970. 99') "usage ratio ",
F. TOTAL_BYTES "Idle space (M )",
F. MAX_BYTES "maximum block (M )"
FROM (SELECT TABLESPACE_NAME,
ROUND (SUM (BYTES)/(1024*1024), 2) TOTAL_BYTES,
ROUND (MAX (BYTES)/(1024*1024), 2) MAX_BYTES
From sys. DBA_FREE_SPACE
Group by TABLESPACE_NAME) F,
(Select dd. TABLESPACE_NAME,
ROUND (SUM (DD. BYTES)/(1024*1024), 2) TOT_GROOTTE_MB
From sys. DBA_DATA_FILES DD
Group by dd. TABLESPACE_NAME) D
Where d. TABLESPACE_NAME = F. TABLESPACE_NAME
Order by 4 DESC
-- Adjust the data file size
Alter database datafile 'd:/PAM/pam_base1.dbf' resize 5000 m;
-- Modify the auto-increment of Files
Alter databasedatafile '/u07/oracle/oradata/train/media01.dbf' autoextend on next 100 m maxsize unlimited;
---- Modify Table space auto-Growth
Alter tablespace media autoextend on next 100 m maxsize unlimited;
-- Add data files
Alter tablespace name add datafile
''-- Path
Size ??? M -- size
The preceding section describes how to manage tablespaces in oracle.
Delete unused services in oracle service items
How to start Oracle databases in Linux
Implementation of Oracle redo log
How to modify the size of Oracle archive logs
Oracle Log File Management