SQL>COLUMN SHRINK_DATAFILES FORMAT A75 WORD_WRAPPED
SQL>COLUMN VALUE NEW_VAL BLKSIZE
SQL>SELECT VALUE FROM V$PARAMETER WHERE NAME = 'DB_BLOCK_SIZE'
/
SQL>SELECT 'ALTER DATABASE DATAFILE ''' FILE_NAME ''' RESIZE ' CEIL( (NVL(HWM,1)*&&BLKSIZE)/1024/1024 ) 'M;' SHRINK_DATAFILES FROM DBA_DATA_FILES DBADF,(SELECT FILE_ID, MAX(BLOCK_ID+BLOCKS-1) HWM FROM DBA_EXTENTS GROUP BY FILE_ID ) DBAFS WHERE DBADF.FILE_ID = DBAFS.FILE_ID(+) AND CEIL(BLOCKS*&&BLKSIZE/1024/1024)- CEIL((NVL(HWM,1)* &&BLKSIZE)/1024/1024 ) > 0
/
No comments:
Post a Comment