getting ORA-01653: unable to extend table SCOTT.S by 128 in tablespace SYSAUX; despite there is still free 49 mb

I am trying to imlment fixes mentioned bt metalink doc id 336133.1
to force format a corruopt block not used by any segments.
these blocks are in the sysaux TS which still has 49 mb but we are failing to insert any more rows please advise
SQL> alter table scott.s
  2       allocate extent (DATAFILE 'C:\APP\MXA15\ORADATA\ORCL\SYSAUX01.DBF' SIZ
E 1M);
alter table scott.s
ERROR at line 1:
ORA-01653: unable to extend table SCOTT.S by 128 in tablespace SYSAUX
SQL> select df.tablespace_name tspace,
  2         decode(df.maxbytes,
  3                 0,
  4                 df.bytes/(1024*1024),
  5                 df.maxbytes/(1024*1024)) tot_ts_size,
  6         decode(df.maxbytes,
  7                 0,
  8                 sum(fs.bytes)/(1024*1024),
  9                 (df.maxbytes-(df.bytes-sum(fs.bytes) ) )
 10                         /(1024*1024)) free_ts_size,
 11         decode(df.maxbytes,
 12                 0,
 13                 round(sum(fs.bytes)*100/df.bytes),
 14                 round( (df.maxbytes-(df.bytes-sum(fs.bytes) ) )
 15                         *100/df.maxbytes)) ts_pct,
 16         decode(df.maxbytes,
 17                 0,
 18                 round( (df.bytes-sum(fs.bytes))*100/df.bytes),
 19                 round( (df.maxbytes-(df.maxbytes-(df.bytes-sum(fs.bytes) ) )
 20                         *100/df.maxbytes)) ts_pct1
 21  from dba_free_space fs inner join
 22         (select
 23                 tablespace_name,
 24                 sum(bytes) bytes,
 25                 sum(decode(maxbytes,0,bytes,maxbytes))  maxbytes
 26          from dba_data_files
 27          group by tablespace_name ) df
 28  on fs.tablespace_name = df.tablespace_name
 29  where df.tablespace_name='SYSAUX'
 30  group by df.tablespace_name,df.maxbytes,df.bytes;
TSPACE                         TOT_TS_SIZE FREE_TS_SIZE     TS_PCT    TS_PCT1
------------------------------ ----------- ------------ ---------- ----------
SYSAUX                                1132       48.375          4         96
  2  FOR i IN 1..1 LOOP
  3  INSERT /*+ APPEND */ INTO scott.s select i, lpad('REFORMAT',3092, 'R') from
  4  commit ;
  5  END LOOP;
  6  END;
  8  /
ERROR at line 1:
ORA-01653: unable to extend table SCOTT.S by 128 in tablespace SYSAUX
ORA-06512: at line 3

Open in new window

LVL 11
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Which tablespace is SCOTT's schema in?

It appears you've incorrectly created the SCOTT user in SYSAUX. It should really be in USERS or another tablespace.

You need to export it, drop the user and recreate it, or either move the tables.

alter table scott.s move tablespace users;

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Secondly, the ways to extend tablespace or add space is to do one of:

1) alter database tablespace sysaux resize <size>;  -- to a larger size
2) alter tablespace sysaux add datafile ...
3) Or turn on autoextend on the datafile:
   alter database datafile '....' autoextend on;

it-rexAuthor Commented:
mrjoltcola as you see the s table needs to be created in the sysaux TS to force format the corrupt blocks.
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

The correct way to allow growt of a tablespace is to increase maxsize with a number of bytes, to set it autoincrement and make maxsize unlimited OR to add new file to the tablespace.
This what you do is unusual approach and I am afraid this causes the mess at the DB.
Use simple and proven methods.

I will also kindly advise do not publish the whole texts of documents that are proprietary of american companies and under restriction. This can cause you troubles and if i were you I will ask this post to be deleted. There are many other sources that could be cited and because you are not object of hate nobody will make you troubles. But the decission is in your hands, I only advise.
DBMS_REPAIR possibly will help you to repair.
it-rexAuthor Commented:
Ok thanks I never knew that.
metalink is advising to format corrupt blocks which do not belong to any segment by creating a dummy table in the tS with coruuption and keep filling it with rows till the blocks get forammted by a new insertion.
I understand. No worries. :)

Since I, schwertner, sdstuder and most of the top Oracle guys here have Metalink accounts, you can provide the Metalink article # we can read for ourselves.

I would follow schwertner's advice to see if you can use DBMS_REPAIR to mark those blocks for skipping and then run RMAN again to see if it still reports.

After that, you may want to open an SR with Oracle.
it-rexAuthor Commented:
ID: 336133.1
mrjoltcola the issue I have here is that i can see that there is still free space like 49 mb but i recieve
ORA-01653: unable to extend table SCOTT.S by 128 in tablespace SYSAUX
the common solution for this ora is usually incease the space ,add data file or turn on auto extend ,
which is exactly defying what I need to do as I need to force the insertion into the remaining space.

I do not think DBMS_REPAIR will do anything here..
I read the Metalink article, and it did say it _may_ work but did not guarantee. At this point I would either consider recovering the SYSAUX tablespace, or opening an SR with Oracle. You might open an SR anyway just to see what they say prior.
Given there are 2 inconsistent issues with the tablespace:

1) Reporting bad blocks from an unallocated segment
2) Reporting 49mb free but failing with ORA-01653

I think the tablespace may have some corruption and you should open the SR.
You are tryimg to allocate space from a specific data file. Questions

Does the SYSAUX tablespace hae more than one datafile?
If yes, than it may be that th 49mb free space is available in other datafiles and not in SYSAUX01 datafile.
Try checking how much space is available in SYSAUX01 datafile.

it-rexAuthor Commented:
it is in the 'C:\APP\MXA15\ORADATA\ORCL\SYSAUX01.DBF'  datafile
it-rexAuthor Commented:
SQL> SELECT tablespace_name, bytes/1024/1024 tssize
 FROM dba_free_space
 WHERE tablespace_name='SYSAUX'
 ORDER BY 2 desc;

shows that
SYSAUX .9375
SYSAUX .8125
SYSAUX .6875
SYSAUX .6875
SYSAUX .5625
SYSAUX .5625
SYSAUX .5625

DBA_FREE_SPACE shows that around 48MB of free space is available with in SYSAUX tablespace but this free spac
e is splitted into around 150 chunks and the max free chunk available is just 1.
5 MB of size. So it seems that there is no big enough extent available that can
be allocated to table SCOTT.S'. Also the datafile is not autoextensible which is
not allowing the extent to be allocated.

hence the option to limit sysaux TS and insert to force format theblock will not work;

I did drop the em repo and then recreate it and it did fix the corruption problem.

thanks all
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.