Solved

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

Posted on 2009-07-16
14
2,212 Views
Last Modified: 2012-05-07
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
 

================================
 

SQL> BEGIN

  2  FOR i IN 1..1 LOOP

  3  INSERT /*+ APPEND */ INTO scott.s select i, lpad('REFORMAT',3092, 'R') from

 dual;

  4  commit ;

  5  END LOOP;

  6  END;

  7

  8  /

BEGIN

*

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

0
Comment
Question by:it-rex
  • 5
  • 5
  • 2
  • +1
14 Comments
 
LVL 40

Accepted Solution

by:
mrjoltcola earned 250 total points
ID: 24872968
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;
0
 
LVL 40

Expert Comment

by:mrjoltcola
ID: 24872996
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;

0
 
LVL 11

Author Comment

by:it-rex
ID: 24873028
mrjoltcola as you see the s table needs to be created in the sysaux TS to force format the corrupt blocks.
0
 
LVL 47

Assisted Solution

by:schwertner
schwertner earned 250 total points
ID: 24873159
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.
0
 
LVL 47

Expert Comment

by:schwertner
ID: 24873201
DBMS_REPAIR possibly will help you to repair.
0
 
LVL 11

Author Comment

by:it-rex
ID: 24873273
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.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 40

Expert Comment

by:mrjoltcola
ID: 24873336
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.
0
 
LVL 11

Author Comment

by:it-rex
ID: 24873383
Doc
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..
0
 
LVL 40

Expert Comment

by:mrjoltcola
ID: 24874403
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.
0
 
LVL 40

Expert Comment

by:mrjoltcola
ID: 24874409
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.
0
 
LVL 7

Expert Comment

by:vishal68
ID: 24877021
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.

HTH
Vishal
0
 
LVL 11

Author Comment

by:it-rex
ID: 24880176
vishal68:
it is in the 'C:\APP\MXA15\ORADATA\ORCL\SYSAUX01.DBF'  datafile
0
 
LVL 11

Author Comment

by:it-rex
ID: 24927229
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 .875
SYSAUX .8125
SYSAUX .75
SYSAUX .75
SYSAUX .6875
SYSAUX .6875
SYSAUX .625
SYSAUX .625
SYSAUX .625
SYSAUX .625
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
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows how to recover a database from a user managed backup

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now