|
|
原帖由 liqy103 于 2008-7-3 18:09 发表 ![]()
SQL> alter database datafile '/prx016/oradata/TEST/tools06.dbf' resize 100M;
alter database datafile '/prx016/oradata/TEST/tools06.dbf' resize 100M
*
ERROR at line 1:
ORA-03297: file contains used data beyond requested RESIZE value
减小文件size 时,如何确定是受限于哪个segment的HWM ?
自己从metalink Note:1029252.6 找到答案
FINDEXT.SQL
Script to find database object locations for a given datafile.
-----------CUT-----------------CUT-----------------CUT--------
REM findext.sql
REM
REM This script prompts user for a datafile ID number, and
REM then lists all the segments contained in that datafile,
REM the blockid where it starts, and how many blocks the
REM segment contains. It shows the owner, segment name, and
REM segment type.
REM
REM Janet Robinson Stern April 2, 1997
REM variation on Cary Millsap's script
REM
SET ECHO OFF
ttitle -
center 'Segment Extent Summary' skip 2
col ownr format a8 heading 'Owner' justify c
col type format a8 heading 'Type' justify c trunc
col name format a28 heading 'Segment Name' justify c
col exid format 990 heading 'Extent#' justify c
col fiid format 9990 heading 'File#' justify c
col blid format 99990 heading 'Block#' justify c
col blks format 999,990 heading 'Blocks' justify c
select
owner ownr,
segment_name name,
segment_type type,
extent_id exid,
file_id fiid,
block_id blid,
blocks blks
from
dba_extents
where
file_id = &file_id
order by
block_id
/
-----------------CUT--------------CUT---------------CUT------
Example Output:
SQL> @findext.sql
Enter value for file_id: 5
old 12: file_id = &file_id
new 12: file_id = 5
Segment Extent Summary
Owner Segment Name Type Extent# File# Block# Blocks
-------- ------------ -------- ------- ------ ------- --------
USER EMP TABLE 0 5 2 5
USER TAB3 TABLE 0 5 108 5
USER TEST TABLE 0 5 348 5
USER PK_EMP INDEX 0 5 483 5
USER EMP TABLE 1 5 433 5
USER EMP TABLE 2 5 438 10
USER PK_EMP INDEX 1 5 488 10 |
|