ORA-01659, ORA-01652 Error

Source: Internet
Author: User

A ORA-01659 error occurs when an insert operation is performed on a table in the database.
ERROR at line 1:
ORA-01659: unable to allocate MINEXTENTS beyond 56 in tablespace USER01
At the same time, the background alert Log appears
ORA-1652: unable to extend temp segment by 8192 in tablespace USER01
At first, I thought it was caused by insufficient table space in user01. However, the query table space usage is very low, and the reason for insufficient space can be ruled out.
I have created a new test table, and there is no problem with the insert and update operations on the table, so it may be caused by the table's own problems.
View the table creation statement:
Select dbms_metadata.get_ddl ('table', 't2') from dual;
------------------------
Create table scott. t2
("ID" VARCHAR2 (50) not null enable,
"MOBILENO" VARCHAR2 (11 ))
SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
NOCOMPRESS LOGGING
STORAGE (INITIAL 4294967296 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 freelist groups 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "USER01"

The STORAGE (INITIAL 4294967296 NEXT 1048576) parameter is very large. The default value is 65536.
I put the table creation statement in another database for execution. I want to create a new table with the same error message as before.
Orcl @ SCOTT> create table scott. t2
2 ("ID" VARCHAR2 (50) not null enable,
3 "MOBILENO" VARCHAR2 (11 ))
4 STORAGE (INITIAL 4294967296 NEXT 8192 MINEXTENTS 1)
5 TABLESPACE "USER01 ";
Create table scott. t2
*
ERROR at line 1:
ORA-01659: unable to allocate MINEXTENTS beyond 5 in tablespace USER01
It can be confirmed that this error is caused by too many storage parameters for initialization. Therefore, the problem is solved by re-creating the table and modifying the storage parameters for initialization.
1 create table scott. t2
2 ("ID" VARCHAR2 (50) not null enable,
3 "MOBILENO" VARCHAR2 (11 ))
4 STORAGE (INITIAL 65536 NEXT 8192 MINEXTENTS 1)
5 * TABLESPACE "USER01"
The Oracle document is quoted as an explanation of this error:

Error: ORA-1652
Text: unable to extend temp segment by % s in tablespace % s
------------------------------------------------------------------------------
Cause: Failed to allocate an extent for temp segment in tablespace.
Action: Use alter tablespace add datafile statement to add one or more
Files to the tablespace indicated or create the object in another
Tablespace.

* ** Important: The notes below are for experienced users-See Note: 22080.1


Explanation:
This error is fairly self explanatory-we cannot get enough space for a temporary segment.
The size reported in the error message is the number of contiguous free Oracle blocks that cannot be found in the listed tablespace.

NOTE: A "temp segment" is not necessarily a SORT segment in a temporary tablespace.
It is also used for temporary situations while creating or dropping objects like tables and indexes in permanent tablespaces.
Eg: When you perform a create index a TEMP segment is created to hold what will be the final permanent index data.
This TEMP segment is converted to a real INDEX segment in the dictionary at the end of the create index operation.
It remains a temp segment for the duration of the create index operation and so failures to extend it report ORA-1652 rather than an INDEX related space error.

A temporary segment may be from:

A SORT Used for a SELECT or for DML/DDL
CREATE INDEX The index create performs a SORT in the users default TEMP tablespace and ALSO uses a TEMP segment to build the final index in the INDEX tablespace. Once the index build is complete the segment type is changed.
CREATE PK CONSTRAINT  
ENABLE CONSTRAINT  
CREATE TABLE New tables start out as TEMPORARY segments.
Eg: If MINEXTENTS is> 1 or you issue CREATE table as SELECT.
Accessing a GLOBAL TEMPORARY TABLE When you access a global temporary table a TEMP segment is instantiated to hold the temporary data.

It is worth making sure the TEMP tablespace PCTINCREASE is 0 and that it has a sensible (large) storage clause to prevent fragmentation.
For TEMPORARY temp tablespaces make sure both INITIAL and NEXT are set to large values as extent sizes are taken from the NEXT clause and not the INITIAL clause.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.