CodePudding user response:
You directly delete this situation must be no good, there are two ways toNow is a table space all objects remove to other table space, and then delete this table space directly,
2 it is, not to delete the data files, only do the resize, give you a reference script
SELECT
A.f ile_id,
A.f ile_name
File_name,
CEIL (NVL (HWM, 1) * blksize)/1024/1024) smallest,
CEIL (blocks * blksize/1024/1024) currsize,
CEIL (blocks * blksize/1024/1024) -
CEIL (NVL (HWM, 1) * blksize)/1024/1024) savings,
'the alter database datafile "' | | file_name | | ' 'resize' | |
CEIL (NVL (HWM, 1) * blksize)/1024/1024) | | 'm; 'CMD
The FROM
DBA_DATA_FILES a,
(
The SELECT file_id, MAX (block_id + blocks - 1) HWM
The FROM DBA_EXTENTS
GROUP BY file_id
B), and
(
The SELECT TO_NUMBER (value) blksize
The FROM V $PARAMETER
WHERE name='db_block_size'
)
WHERE
A.f ile_id=b. ile_id (+)
AND
CEIL (blocks * blksize/1024/1024) - CEIL ((NVL (HWM, 1) * blksize)/1024/1024) & gt; 0
ORDER BY 5 desc
CodePudding user response:
Under the contract, don't delete,To delete or move the data file on all objects, to delete,
CodePudding user response:
For information, can be directly to do so?The alter in tablespace tablespace_name drop datafile ';
CodePudding user response: