SOLVED
Resolving "Unable to extend / create" errors with non-contiguous free space below high water mark
Asked by ahmedalhedewy••45 views•oracle
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
Summary
Getting unable to extend errors like ORA-1653, ORA-1654, ORA-1658, ORA-1688, ORA-1659, ORA-1683, ORA-3233, ORA-3234, ORA-1692, ORA-1691, ORA-3238 as there is no free space found above high water mark.
EXAMPLE ERRORS
ORA-1653: unable to extend table %s.%s by %s in tablespace %s
Cause: Failed to allocate an extent of the required number of blocks for a table segment in the tablespace indicated.
Action: Use ALTER TABLESPACE ADD DATAFILE statement to add one or more files to the tablespace indicated.
ORA-1654: unable to extend index %s.%s by %s in tablespace %s
Cause: Failed to allocate an extent of the required number of blocks for an index segment in the tablespace indicated.
Action: Use ALTER TABLESPACE ADD DATAFILE statement to add one or more files to the tablespace indicated.
ORA-1655: unable to extend cluster %s.%s by %s for tablespace %s
Cause: Failed to allocate an extent of the required number of blocks for a cluster segment in tablespace indicated.
Action: Use ALTER TABLESPACE ADD DATAFILE statement to add one or more files to the tablespace indicated.
ORA-1658: unable to create INITIAL extent for segment in tablespace %s
Cause: Failed to find sufficient contiguous space to allocate INITIAL extent for segment being created.
Action: Use ALTER TABLESPACE ADD DATAFILE to add additional space to the tablespace or retry with a smaller value for INITIAL
ORA-1659 unable to allocate MINEXTENTS beyond %s in tablespace %s
Cause: Failed to find sufficient contiguous space to allocate MINEXTENTS for the segment being created.
Action: Use ALTER TABLESPACE ADD DATAFILE to add additional space to the tablespace or retry with smaller value for MINEXTENTS, NEXT or PCTINCREASE
ORA-1683: unable to extend index %s.%s partition %s by %s in tablespace %s
Cause: Failed to allocate an extent of the required number of blocks for index segment in the tablespace indicated.
Action: Use ALTER TABLESPACE ADD DATAFILE statement to add one or more files to the tablespace indicated.
ORA-1688: unable to extend table %s.%s partition %s by %s in tablespace %s
Cause: Failed to allocate an extent of the required number of blocks for table segment in the tablespace indicated.
Action: Use ALTER TABLESPACE ADD DATAFILE statement to add one or more files to the tablespace indicated.
ORA-1691: unable to extend lob segment %s.%s by %s in tablespace %s
Cause: Failed to allocate an extent of the required number of blocks for LOB segment in the tablespace indicated.
Action: Use ALTER TABLESPACE ADD DATAFILE statement to add one or more files to the tablespace indicated.
ORA-1692: unable to extend lob segment %s.%s partition %s by %s in tablespace %s
Cause: Failed to allocate an extent of the required number of blocks for LOB segment in the tablespace indicated.
Action: Use ALTER TABLESPACE ADD DATAFILE statement to add one or more files to the tablespace indicated.
ORA-3233: unable to extend table %s.%s subpartition %s by %s in tablespace %s
Cause: Failed to allocate an extent for table subpartition segment in tablespace.
Action: Use ALTER TABLESPACE ADD DATAFILE statement to add one or more files to the tablespace indicated.
ORA-3234: unable to extend index %s.%s subpartition %s by %s in tablespace %s
Cause: Failed to allocate an extent for index subpartition segment in tablespace.
Action: Use ALTER TABLESPACE ADD DATAFILE statement to add one or more files to the tablespace indicated.
ORA-3238: unable to extend LOB segment %s.%s subpartition %s by %s in tablespace %s
Cause: An attempt was made to allocate an extent for LOB subpartition segment in tablespace, but the extent could not be allocated because there is not enough space in the tablespace indicated.
Action: Use the ALTER TABLESPACE ADD DATAFILE statement to add one or more files to the tablespace indicated.
Free space found below high water mark.
set pagesize 60
set newpage 0
set echo off
ttitle center 'Contiguous Extents Report' skip 3
break on "TABLESPACE NAME" skip page duplicate
spool contig_free_space.lis
rem
column "CONTIGUOUS BYTES" format 999,999,999
column "COUNT" format 999
column "TOTAL BYTES" format 999,999,999
column "TODAY" noprint new_value new_today format a1
rem
with a
as
(
SELECT tablespace_name,file_id,block_id,bytes,blocks,LEVEL,CONNECT_BY_ROOT block_id as root,
count(*) over(partition by tablespace_name, file_id, CONNECT_BY_ROOT block_id) as EXTENTS,
sum(bytes) over(partition by tablespace_name, file_id, CONNECT_BY_ROOT block_id) as CONTIGUOUS_BYTES
FROM dba_free_space
CONNECT BY PRIOR (block_id+blocks) = block_id
and PRIOR tablespace_name = tablespace_name
and PRIOR file_id = file_id
)
select TABLESPACE_NAME "TABLESPACE NAME",
CONTIGUOUS_BYTES "CONTIGUOUS BYTES"
from a
where (tablespace_name, file_id, block_id) in
(select tablespace_name, file_id, block_id from
a
group by tablespace_name, file_id, block_id
having count(*)=1
)
order by 1,2 desc;
with a
as
(
SELECT tablespace_name,file_id,block_id,bytes,blocks,LEVEL,CONNECT_BY_ROOT block_id as root,
count(*) over(partition by tablespace_name, file_id, CONNECT_BY_ROOT block_id) as EXTENTS,
sum(bytes) over(partition by tablespace_name, file_id, CONNECT_BY_ROOT block_id) as CONTIGUOUS_BYTES
FROM dba_free_space
CONNECT BY PRIOR (block_id+blocks) = block_id
and PRIOR tablespace_name = tablespace_name
and PRIOR file_id = file_id
)
select tablespace_name,count(*) "# OF EXTENTS",sum(CONTIGUOUS_BYTES) "TOTAL BYTES"
from a
where (tablespace_name, file_id, block_id) in
(select tablespace_name, file_id, block_id from
a
group by tablespace_name, file_id, block_id
having count(*)=1
)
group by tablespace_name;