ITPub博客

首页 > 数据库 > Oracle > ORA-01652: unable to extend temp segment by 128 in tablespace TEMP01

ORA-01652: unable to extend temp segment by 128 in tablespace TEMP01

Oracle 作者:pyzwj 时间:2015-06-11 10:49:58 0 删除 编辑
  1. 我今天在impdp导入数据,当导入索引时,一直卡在那里。
  2. 去查看alter日志,发现: ORA-01652: unable to extend temp segment by 128 in tablespace TMPGRP
  3. 于是增加临时文件的大小解决该问题。
  4. 另外,导入过程中,还有一个报错:

  5. 这个是统计信息的报错,本来导出了统计信息,无法导入,就忽略导入统计信息,
  6. 如下:
  7. impdp system/oracle@prod1 directory=dir1 dumpfile=dir1:vpm20150610.dmp schemas=VPM exclude=statistics

  8. 收集数据库信息时候报ORA-01652错 如下  
  9.   
  10.   
  11. SQL> EXEC DBMS_STATS.gather_database_stats;  
  12.   
  13. BEGIN DBMS_STATS.gather_database_stats; END;  
  14. *  
  15. ERROR at line 1:  
  16. ORA-01652: unable to extend temp segment by 128 in tablespace TEMP01  
  17. ORA-06512: at "SYS.DBMS_STATS", line 13210  
  18. ORA-06512: at "SYS.DBMS_STATS", line 13556  
  19. ORA-06512: at "SYS.DBMS_STATS", line 13700  
  20. ORA-06512: at "SYS.DBMS_STATS", line 13664  
  21. ORA-06512: at line 1  
  22.   
  23.   
  24. 原因是我的temp01表空间过小,而且没有自动扩展,因此无法完成数据库信息收集  
  25.   
  26. SQL>select file_name,bytes/1024/1024 "MB",autoextensible,tablespace_name from dba_temp_files  
  27.   
  28. FILE_NAME                                                   MB  AUT    TABLESPACE_NAME  
  29. -------------------------------------------------------- ----- -----  ------------------  
  30. /u01/app/oracle/product/10.2.0/db_1/dbs/temp01.dbf         512  NO     TEMP01  
  31.   
  32.   
  33. 需要对表空间进行重建,新建一个数据库的临时表空间temp02  
  34.   
  35.   
  36. SQL> create temporary tablespace TEMP02   
  37.      TEMPFILE '/u01/app/oracle/product/10.2.0/db_1/dbs/temp02.dbf' SIZE 512M   
  38.      REUSE AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED;   
  39.   
  40. Tablespace created.  
  41.   
  42.   
  43. 更改数据库的默认临时表空间为temp02  
  44.   
  45. SQL> alter database default temporary tablespace temp02;  
  46.   
  47. Database altered.  
  48.   
  49. 删除原来的默认临时表空间TEMP01  
  50.   
  51. SQL> drop tablespace temp01 including contents and datafiles;  
  52.   
  53. Tablespace dropped.  
  54.   
  55. 创建新的临时表空间TEMP01  
  56. SQL> create temporary tablespace TEMP01   
  57. TEMPFILE '/u01/app/oracle/product/10.2.0/db_1/dbs/temp01.dbf' SIZE 512M   
  58. REUSE AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED;  
  59.   
  60. Tablespace created.  
  61.   
  62. 更改数据库的默认临时表空间为TEMP01  
  63.   
  64. SQL> alter database default temporary tablespace temp01;  
  65.   
  66. Database altered.  
  67.   
  68. 删除临时表空间TEMP02  
  69.   
  70. SQL> drop tablespace temp02 including contents and datafiles;  
  71.   
  72. Tablespace dropped.  
  73.   
  74. 查询新建的临时表空间TEMP01信息,自动扩展已经为“YES”  
  75. SQL>select file_name,bytes/1024/1024 "MB",autoextensible,tablespace_name from dba_temp_files  
  76.   
  77. FILE_NAME                                                   MB  AUT    TABLESPACE_NAME  
  78. -------------------------------------------------------- ----- -----  ------------------  
  79. /u01/app/oracle/product/10.2.0/db_1/dbs/temp01.dbf         512  YES     TEMP01  
  80.   
  81. 此时再收集数据库信息,收集完毕  
  82.   
  83. SQL> EXEC DBMS_STATS.gather_database_stats;  
  84.   
  85. PL/SQL procedure successfully completed.  
  86.   
  87.   
  88.   
  89.   
  90. 临时表空间常用操作  
  91.   
  92. 更改临时表空间大小  
  93.   
  94. SQL>alter database tempfile '/u01/app/oracle/product/10.2.0/db_1/dbs/temp01.dbf' RESIZE 1000m;  
  95.   
  96. 查看临时表空间大小  
  97. SQL>select file_name,bytes/1024/1024 "MB",autoextensible,tablespace_name from dba_temp_files 

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/28194062/viewspace-1695355/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: REDO log 并行机制
请登录后发表评论 登录
全部评论

注册时间:2012-09-25

  • 博文量
    63
  • 访问量
    303308