当前位置:  数据库>oracle

ORA-01659,ORA-01652错误

    来源: 互联网  发布时间:2017-06-01

    本文导语: 数据库一张表进行insert时,出现ORA-01659错误ERROR at line 1:ORA-01659: unable to allocate MINEXTENTS beyond 56 in tablespace USER01同时后台alert 日志出现ORA-1652: unable to extend temp segment by 8192 in tablespace                USER01刚开始以为是user01表空间...

数据库一张表进行insert时,出现ORA-01659错误
ERROR at line 1:
ORA-01659: unable to allocate MINEXTENTS beyond 56 in tablespace USER01
同时后台alert 日志出现
ORA-1652: unable to extend temp segment by 8192 in tablespace                USER01
刚开始以为是user01表空间不足导致,可是查询表空间使用率很低,也就可以排除因空间不足的原因了。
我新建了一张测试表 ,对表进行insert 和update 均没有任何问题,于是感觉可能是由于表的自身问题所致。
查看表的建表语句:
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"

这里可以看到STORAGE(INITIAL 4294967296 NEXT 1048576) 这个参数特别大,默认是65536.
我把建表语句放到另一个库里执行,想新建一张同样的表,结果出现了和之前一样的报错信息。
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
由此可以确认此错是初始化存储参数过大导致,于是重新建表 并修改初始化存储参数,于是问题解决。
 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"
以下是引述Oracle 文档对此错误的解释:

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.


    
 
 
 
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。












  • 相关文章推荐
  • 如何得到带有ora的行的下一行
  • 如何配置 linux 下 oracle 的 listener .ora 和
  • 浅析如何在tnsnames.ora中配置监听
  • Orcle的package中访问其它Schema的表报错ORA-00942解决方法
  • oracle远程连接服务器出现 ORA-12170 TNS:连接超时 解决办法
  • [Oracle] 浅析令人抓狂的ORA-01555问题
  • 解决报错ora-32035的方法分析
  • aq.executeQuery: ORA-00020: maximum number of processes (59) exceeded
  • ORA-00947:Not enough values (没有足够的值)的深入分析
  • solaris10 安装 ora9.2.0.1 时报错
  • 在UNIX下,我的ORA817该怎么样才可以自己启动呀?
  • 基于ORA-12170 TNS 连接超时解决办法详解
  • 安装oracle出现error:ora-01031:insufficient privilleges的解决
  • 谁能帮忙解释一下: ORA-01000 : maximun open cursors exceeded
  • 关于Oracle游标的问题(ORA-01000: maximum open cursors exceeded)
  • 操作系统 iis7站长之家
  • zilong28提问:Tomcat3.2报错内容是Error occurs when connecting DB: ORA-00020: maximum number of processes(59) exceeded 我应该如何解决,先谢了
  • ORA-28002 Oracle 11g存在密码过期问题解决方案
  • Oracle ORA-22908(NULL表值的参考)异常分析与解决方法
  • oracle报错(ORA-00600)问题处理


  • 站内导航:


    特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

    ©2012-2021,