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

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