Wednesday 6 March 2013

Ora-01652 : Unable to extend temp segment by 128 in tablespace USERS

That error occurs when failed to allocate an extent of the required number of blocks for a temporary segment in the tablespace indicated.
So we can this in two ways.

1.
Check the datafiles sizes..
SQL> select FILE_NAME,TABLESPACE_NAME,BYTES/1024/1024 from dba_data_files;
FILE_NAME    TABLESPACE_NAME                BYTES/1024/1024
/u01/app/oracle/oradata/dev/users01.dbf       
USERS                                  32767.5
/u01/app/oracle/oradata/dev/undotbs01.dbf
UNDOTBS1                                  8025
/u01/app/oracle/oradata/dev/sysaux01.dbf
SYSAUX                                    1340
/u01/app/oracle/oradata/dev/system01.dbf
SYSTEM                                    1150

/u01/app/oracle/oradata/dev/APEX_1344701438996813.dbf
APEX_1344701438996813                   5.0625
/u01/app/oracle/oradata/dev/BIAS1_mds.dbf
BIAS1_MDS                                  100
/u01/app/oracle/oradata/dev/BIAS1_biplatform.dbf
BIAS1_BIPLATFORM                            64
/u01/app/oracle/oradata/dev/BIAS2_odi_user.dbf
BIAS2_ODI_USER                             200
/u01/app/oracle/oradata/dev/DEV_biplatform.dbf
DEV_BIPLATFORM                              64
/u01/app/oracle/oradata/dev/DEV_mds.dbf
DEV_MDS                                    100
/u01/app/oracle/oradata/dev/ggs_data01.dbf
GGS_DATA                                   200
11 rows selected.
Then resize your datafile or add a new datafile to current tablespace
Resizing Datafile :
ALTER DATABASE DATAFILE ‘/u01/app/oracle/oradata/users.dbf‘ RESIZE *M;
Addind Datafile to existing Tablespace:

ALTER TABLESPACE USERS ADD DATAFILE ‘/u01/app/oracle/oradata/user_2.dbf SIZE 100M;

2.
Change the user’s default tablespace to a bigger one :)
SELECT * FROM Dba_Users;
  USERNAME USER_ID ACCOUNT_STATUS  DEFAULT_TABLESPACE
1 ASD         36     OPEN              SYSTEM
2 SYS          0     OPEN              SYSTEM
3 SYSTEM       5     OPEN              SYSTEM
4 ANONYMOUS   28     OPEN              SYSAUX   
ALTER USER asd DEFAULT TABLESPACE users;
It changes “asd” schema’s default tablespace to USERS tablespace.
SELECT * FROM Dba_Users;
USERNAME USER_ID  ACCOUNT_STATUS  DEFAULT_TABLESPACE
1 ASD       36        OPEN             USERS
2 SYS        0        OPEN             SYSTEM
3 SYSTEM     5        OPEN             SYSTEM
4 ANONYMOUS 28        OPEN             SYSAUX  
You can also do this per object :  “alter table table_name move tablespace users; ”
You can also select the tablespace in the create script of the object.


No comments:

Post a Comment