Current location - Health Preservation Learning Network - Slimming men and women - How to shrink oracle data files
How to shrink oracle data files
1. When there is no data in the tablespace:

alter database datafile '/data 1/Oracle/data _ 20 1708 . DBF ' resize 1G;

alter database tempfile '/u02/Oracle/oradata/orcl/temp 0 1 . DBF ' resize 1G;

2. Query which tablespaces and corresponding data files are available.

Column name format a50

Set the line size 200

Select a.name, b.name from v $ tablespace a, v $ datafile b where a. TS # = b. TS #

or

Column file name format a50

Select tablespace name, file name from dba_data_files order by tablespace name;