Solved

ORA-01654: unable to extend index error

Posted on 2004-10-07
13
15,473 Views
Last Modified: 2011-08-18
i have running Oracle 8 on Linux, it gives following error

 ORA-01654: unable to extend index abc.TRANSACTION_INDEX by 12144 in tablespace SYSTEM

i also want to change the default tablespaces of my user.

can i change default tablespaces in running system



0
Comment
Question by:pak_slm
  • 4
  • 4
  • 4
  • +1
13 Comments
 
LVL 23

Expert Comment

by:seazodiac
Comment Utility
No offense, it's really bad to put indexes on SYSTEM tablespace.

i see the change of user default tablespace is long overdue...


SQL>alter user <user_name> default tablespace <tablespace_name> quota unlimited on <tablespace_name>;
0
 
LVL 23

Expert Comment

by:seazodiac
Comment Utility
before rebuilding this index, you can workaround that ORA-1654 error,
by increasing the size of SYSTEM tablespace

alter database datafile '<system file path>' resize <a higher size>M;

0
 
LVL 10

Expert Comment

by:SDutta
Comment Utility
You can rebuild the index on a running system without any ill effects. If the table is locked by another process it will give you a "resource busy" error and you can try it again later.

ALTER INDEX ABC.TRANSACTION_INDEX REBUILD TABLESPACE new_tablespace STORAGE (INITIAL 1M NEXT 1M PCTINCREASE 50);

You could increase the size of INITIAL and NEXT to larger values if the table has a lot of data in it. If you do increase it to larger values, you may be better off with PCTINCREASE 0.

Of course you should also follow the guidelines suggested by seazodiac so that you dont have this problem in future.
0
 
LVL 23

Expert Comment

by:seazodiac
Comment Utility
No, you cannot do that in Oracle8.

you have to drop the old index and build a new one after you change the default tablespace of the user
0
 
LVL 10

Expert Comment

by:SDutta
Comment Utility
@seazodiac

You can definitely do ALTER INDEX REBUILD in Oracle 8.
Maybe you are thinking of ALTER TABLE MOVE ... which was not allowed in 8.0
0
 
LVL 1

Author Comment

by:pak_slm
Comment Utility
SDutta
tell me one thing more
if i give command create table table2 as select * from a table1 in new tablespaces
then drop table1 and rename table2 as table1
it is possible? if yes then tell me rename table command otherwise i try ALTER INDEX REBUILD

what is time comparison




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 10

Expert Comment

by:SDutta
Comment Utility
Yes you can do it but as soon as you rename the old table its dependent objects may become invalid and have to be recompiled.

You can do "create table table2 as select * from a table1" with storage clause specifying new tablespace name.
Then you can :
RENAME TABLE1 TO TABLE1_BKUP; -- drop it later after you are absolutely sure
RENAME TABLE2 TO TABLE1;

Then create the indexes etc. check for invalid dependents and make them valid.
0
 
LVL 1

Author Comment

by:pak_slm
Comment Utility
is it better procedure or tell another procedure to change the tablespaces of a table

Actually i want to change the tablespaces of some tables
0
 
LVL 1

Author Comment

by:pak_slm
Comment Utility
SDutta

i execute ALTER INDEX REBUILD
it run successfully without error

Please tell command like ALTER INDEX REBUILD  to alter tablespaces of a table  
0
 
LVL 34

Expert Comment

by:Mark Geerlings
Comment Utility
Oracle8.1.5 (and higher) supports this command:
alter table [table_name] move [new_tablespace_name];

If you have Oracle8.0.x, that may not be supported.

It is a **BAD** idea to have user tables or indexes in the SYSTEM tablespace!  The problem is, you cannot defragment the SYSTEM tablespace unless you are willing to export the entire database, shut it down, drop the database, create a new database, then run a full import.  Of course, you should never do this unless you take a full backup before you drop it!

All of your tables and indexes that belong to schemas other than SYS and SYSTEM should be in other tablespaces, since you can defragment them, if necessary, with much less risk and effort.
0
 
LVL 23

Expert Comment

by:seazodiac
Comment Utility
---->?Please tell command like ALTER INDEX REBUILD  to alter tablespaces of a table

You should re-create table in the new tablespace, drop the old one.
0
 
LVL 1

Author Comment

by:pak_slm
Comment Utility

if i create table by create table as command then what about
as per SDutta

Yes you can do it but as soon as you rename the old table its dependent objects may become invalid and have to be recompiled.

i do not understand recompiled dependent objects.

tell the procedure if i followed this way
0
 
LVL 10

Accepted Solution

by:
SDutta earned 250 total points
Comment Utility
@pak_slm

You cannot change the tablespace of a TABLE with ALTER INDEX REBUILD. It can be used to change the tablespace of an INDEX.

The error you reported was :
ORA-01654: unable to extend index abc.TRANSACTION_INDEX by 12144 in tablespace SYSTEM

Which specifically says the problem is with the INDEX not the TABLE (that could be a problem too but is out of this context).

I thought I had already mentioned in my first post the command to change the tablespace of the index by : ALTER INDEX ABC.TRANSACTION_INDEX REBUILD TABLESPACE new_tablespace STORAGE (INITIAL 1M NEXT 1M PCTINCREASE 50);

If you want to change the tablespace of a TABLE you cannot do it so easily in 8.0, the best options are : EXPORT/IMPORT or CREATE NEW_TBL AS SELECT * FROM OLD_TBL (and drop OLD_TBL).
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

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

762 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

13 Experts available now in Live!

Get 1:1 Help Now