ORA-03297: file contains used data beyond requested RESIZE value
當我們回收資料庫空間時,常用的方法是:
ALTER DATABASE
DATAFILE '/oradata/ora9i/tools03.dbf' RESIZE 900M
但一執行報以下錯誤
ORA-03297: file contains used data beyond requested RESIZE value
ORA-03297 file contains used data beyond requested RESIZE value
Cause: Some portion of the file in the region to be trimmed is currently in use by a database object.
Action: Drop or move segments containing extents in this region prior to resizing the file, or choose a resize value such that only free space is in the trimmed.
使用如下指令碼可以獲得分配到高位top_blocks 的物件資訊
SQL> select distinct owner,segment_name,segment_type from dba_extents where file_id = &file_id and (block_id + &top_blocks) >(select max(block_id) from dba_extents where file_id=&file_id)
top_blocks 可以透過以下方法得出;
SQL>select file#,name from v$datafile;
SQL>select max(block_id) from dba_extents where file_id=12;
MAX(BLOCK_ID)
-------------
124553
SQL> show parameter db_block_size;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_block_size integer 8192
SQL> select 124553*8/1024 from dual;
124553*8/1024
-------------
973.0703125
該塊位於973M與974M之間
透過上面sql查出來的物件資訊
alter table t_obj move new_tablespace_name;
對於分割槽表資訊:
ALTER TABLE "TEST"."TB_ACCESS"
MOVE PARTITION "TB_ACCESS_P200608"
TABLESPACE "new_tablespace_name"
再進行回收表空間
整合出來的sql語句如下:
select distinct owner, segment_name, segment_type,tablespace_name
from dba_extents
where file_id =
(select file#
from v$datafile
where name = '/oradata/ora9i/GAME_LARGE_2006_4_1.dbf')
and (block_id + (select max(block_id)*8/1024 from dba_extents where file_id=(select file#
from v$datafile
where name = '/oradata/ora9i/GAME_LARGE_2006_4_1.dbf'))) >
(select max(block_id)
from dba_extents
where file_id =
(select file#
from v$datafile
where name = '/oradata/ora9i/GAME_LARGE_2006_4_1.dbf'));
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7199859/viewspace-193116/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Alter database datafile resize ORA-03297 原因解析Database
- 資料檔案Resize引起的ORA-03297報錯
- Oracle resize DBF報錯"ORA-03297"簡單介紹Oracle
- a control file contains informationAIORM
- RMAN-05517: temporary file conflicts with file used by target database(zt)Database
- Oracle 18.3 Resize operation completed for file#Oracle
- Default Data Type Mappings Used by Oracle SQL DeveloperAPPOracleSQLDeveloper
- contains a file system with errors, check forced解決方法AIError
- Mybatis Data truncation: Truncated incorrect DOUBLE value: '*'MyBatis
- 452 Error writing file: A file cannot be larger than the value set by ulimit.ErrorMIT
- goldengate extract abended unable to queue I/O, I/O beyond file sizeGo
- HP -Data Protector Restore file systemREST
- sqlldr Field in data file exceeds maximum lengthSQL
- 00017: Data frame has at least one annotation group that is enabled and contains graphicsASTAI
- 解決mybatis出現Mapped Statements collection already contains value for問題MyBatisAPPAI
- data file int write和db file sequential read個人想法
- python 報錯:raise IllegalCharacterError(f"{value} cannot be used in worksheets.") openpyxl.utils.exceptions.IllegalCharacterErrorPythonAIErrorException
- Unload data to a flat file from Oracle databaseOracleDatabase
- 資料檔案RESIZE導致查詢DBA_DATA_FILES被鎖
- ORA-27069: skgfdisp: attempt to do I/O beyond the range of the file問題解決
- Identify If A Disk/Part Is Still Used By ASM,Used by ASM Or Used by ASM_603210.1IDEASM
- Oracle ResizeOracle
- ELF file data encoding not little-endianEncoding
- HP -Data Protector Restore file system【Blog 搬家】REST
- [轉載]Oracle等待事件Data file init writeOracle事件
- mabatis報錯 Result Maps collection already contains value for gamedataserver.dao.one.ChargeRecordMapper.BaseResultMapBATAIGAMServerAPP
- Transactions and beyond it..
- The requested URL was not found on the serverServer
- oracle10g 資料檔案頭data file header(file header)OracleHeader
- GoldenGate replication using a data definition file and DEFGEN utilityGo
- Result Maps collection already contains value for xxx.xxx.dao.BaseResultMap錯誤AI
- JavaScript resize 事件JavaScript事件
- jQuery resize事件jQuery事件
- [GAUSS-51808] : The env file contains errmsg: {'Node[192.168.56.181]': 'Output:AI
- JavaScript contains()JavaScriptAI
- jQuery :contains()jQueryAI
- The innodb_system data file 'ibdata1' must be writable
- oracle 匯入報錯:field in data file exceeds maximum lengthOracle