you can set your datafile size up to HWM_BYTES columns or you can resize your HWM through alter table move + rebuild index or export and import.SQL> select bytes/1024 from dba_data_files where file_id = 6;BYTES/1024---------- 7168SQL> select sum(bytes/1024) from dba_segments where tablespace_name = 'EXAMPLE';SUM(BYTES/1024)--------------- 5440SQL> alter database datafile 'c:\oracle\product\10.1.0\oradata\db02\example01.dbf' resize 5500k;alter database*ERROR at line 1:ORA-03297: file contains used data beyond requested RESIZE valueYou can resize your datafile upto the HWM_BYTES column valueSQL> edWrote file afiedt.buf select a.file_name, a.bytes file_size_in_bytes, (c.block_id+(c.blocks-1)) * &BLOCK_SIZE HWM_BYTES, a.bytes - ((c.block_id+(c.blocks-1)) * &BLOCK_SIZE) SAVING from dba_data_files a, (select file_id,max(block_id) maximum from dba_extents group by file_id) b, dba_extents c where a.file_id = b.file_id and c.file_id = b.file_id and c.block_id = b.maximum and c.tablespace_name = 'EXAMPLE'SQL> /Enter value for _block_size: 8192old 4: (c.block_id+(c.blocks-1)) * &BLOCK_SIZE HWM_BYTES,new 4: (c.block_id+(c.blocks-1)) * 8192 HWM_BYTES,Enter value for _block_size: 8192old 5: a.bytes - ((c.block_id+(c.blocks-1)) * &BLOCK_SIZE) SAVINGnew 5: a.bytes - ((c.block_id+(c.blocks-1)) * 8192) SAVINGFILE_NAME FILE_SIZE_IN_BYTES HWM_BYTES SAVING-------------------------------- ------------------ ---------- ----------C:\ORACLE\PRODUCT\10.1.0\ORADATA\DB02\EXAMPLE01.DBF 7340032 6356992 983040SQL> alter database datafile 'c:\oracle\product\10.1.0\oradata\db02\example01.dbf' resize 6356992;Database altered. |
Friday, July 15, 2011
ORA-03297: file contains used data beyond requested RESIZE value
Labels:
DATABASE
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment