当前位置:  数据库>oracle

ORA-1652 临时表空间满了导致新会话数据不能入库诊断案例

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

    本文导语: 1.联通现场状态时间:2012年8月17日数据库版本:Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi操作系统平台:HP-UX告警日志: more   alert_mdsoss.log 2.定位问题报错现象:Fri Aug 17 13:37:39 EAT 2012ORA-1652: unable to extend temp segment by 128 i...

1.联通现场状态
时间:2012年8月17日
数据库版本:Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
操作系统平台:HP-UX
告警日志: more   alert_mdsoss.log



2.定位问题
报错现象:
Fri Aug 17 13:37:39 EAT 2012
ORA-1652: unable to extend temp segment by 128 in tablespace    MDSTEMP     显示不能扩展临时段,说明临时表空间已经被使用满了,空间不够。
说明:从metalink上官方解释,没有更多的空闲区分给这个临时段了,可以给表空间添加数据文件的方式来解决此问题,表面上是这样,我们更加的深入了解,是什么原因导致的临时段没有空间了呢,我们都知道临时段是记录排序和数据迁移的,现在深层次问题不是空间不够,过一会再执行sql可能就不报错了。是sql语句不够优化。因为当sql在批量DML操作的时候,会突发性占用大量临时空间排序,就会报临时段不够用,新数据此时不能入库!过一会空间释放后又可以入库了,要想解决此问题就需要sql优化。
The below is from metalink:
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.
select * from gnwebbrw12081720;  此时是有数据的,说明空间已经释放了
colfile_name for a35
selectfile_name,file_id,bytes/1024/1024,status,autoextensible TABLESPACE_NAME from DBA_TEMP_FILES;
FILE_NAME                              FILE_ID BYTES/1024/1024 STATUS    TAB
----------------------------------- ---------- --------------- --------- ---
/oradata/mdsoss/temp01.dbf        1           24671          AVAILABLE   YES 
/oradata/mdsoss/mdstmp.dbf       2           20000          AVAILABLE   NO    MDSTEMP  不是自动扩展,如果是就没有上述问题了,但我们不建议使用数据文件自动扩展功能,不容易监控。看 24G + 20G 空间是没有问题的,一般都是sql写的不够好导致不必要排序。
 
3.解决方案
(1)重启实例,7*24  重启实例 smon进程可以释放sort段,但我们的库是不能down的
(2)增加数据文件,我的空间很紧张,不可以
(3)配置合理sort_area大小  已经配置完毕了,现PGA 4G  sort_area_size 208M
(4)sql optimization   最佳方案
(5)总结哪些操作会导致临时表空间暴涨呢
什么操作在使用temp
- 索引创建或重建.
- ORDER BY or GROUP BY
- DISTINCT 操作.
- UNION & INTERSECT & MINUS
- Sort-Merge joins.
- Analyze 操作
- 有些异常将会引起temp暴涨
当处理以上操作时候呢,dba需要加倍关注temp使用情况?我们现在来看看谁使用这些临时段。
(5)临时表空间使用情况
select tablespace_name,current_users,total_blocks,used_blocks,free_blocks from v$sort_segment;
TABLESPACE_NAME     CURRENT_USERS TOTAL_BLOCKS USED_BLOCKS FREE_BLOCKS
------------------- ------------- ------------ ----------- -----------
TEMP                            1      3157760         128     3157632
MDSTEMP                        24      2559872     2337152      222720      已经使用了92%








































(6)谁在使用这些sort段
select username,session_addr,sqladdr,sqlhash from v$sort_usage;
USERNAME                       SESSION_ADDR     SQLADDR             SQLHASH
------------------------------ ---------------- ---------------- ----------
MDSOSS                         C0000008483ECFB8 C0000008512150B8 3342809064
SABOCOUSR                   C00000084B405E50 C00000033F867510  141205382
MDSOSS                         C00000084740E988 C0000008508AB1C0  409467952
MDSOSS                         C0000008483DE390 C00000033B8914F0 2951877480
MDSOSS                         C00000084A404460 C0000003404007A0 2584373469
MDSOSS                         C0000008483F5088 C00000033FA63E18 2245874020
MDSOSS                         C0000008483FFC48 C00000084D5B5F98 3000467390
MDSOSS                         C0000008483F5088 C00000033FA63E18 2245874020
MDSOSS                         C000000852404A60 C00000084DD6F598 1491833069
MDSOSS                         C0000008483EBA40 C00000084DE28990 1530468420
MDSOSS                         C0000008483FD158 C00000084E13A648 3459409074
MDSOSS                         C000000852404A60 C00000084DD6F598 1491833069
MDSOSS                         C000000852404A60 C00000084DD6F598 1491833069
MDSOSS                         C000000852404A60 C00000084DD6F598 1491833069
MDSOSS                         C0000008523DDBC8 C000000850AE75E0 2349095001
MDSOSS                         C0000008474068B8 C00000084CCC7790 2982079417
MDSOSS                         C0000008494501E0 C00000085098B400 3836056470
MDSOSS                         C00000084B3E5B10 C00000084DA9B990  719858768
MDSOSS                         C0000008523F3348 C00000084D96F830 2434343698
MDSOSS                         C00000084740D410 C0000008174B3540 2103182003
 
USERNAME                       SESSION_ADDR     SQLADDR             SQLHASH
------------------------------ ---------------- ---------------- ----------
MDSOSS                         C00000084A3FD908 C00000084C944888 3846639713
MDSOSS                         C0000008523D5AF8 C00000084DC6BB30 3158920754
MDSOSS                         C0000008483FA668 C00000032FCDF3D8 1691040305
MDSOSS                         C00000084943BFD8 C00000084CE4CA70 2036150049
MDSOSS                         C00000084A4170F0 C00000084D75FF68 2058192145
MDSOSS                         C0000008483CF768 C00000084DC096B8 3375505524
MDSOSS                         C000000849452CD0 C00000031E5A32F8  346930689
MDSOSS                         C000000849433F08 C000000340106C48 2344782277
MDSOSS                         C0000008484067A0 C000000344414D88 4097260861
MDSOSS                         C00000084B3C57D0 C000000850BF8528 3690121153
MDSOSS                         C00000084740D410 C0000008174B3540 2103182003
MDSOSS                         C0000008523DDBC8 C000000850AE75E0 2349095001
MDSOSS                         C0000008483EBA40 C00000084DE28990 1530468420
MDSOSS                         C0000008483FD158 C00000084E13A648 3459409074
MDSOSS                         C00000084B3CC328 C00000084D2185C8  497018778
MDSOSS                         C0000008523F73B0 C00000034046B670 3944536657
MDSOSS                         C00000084B3CC328 C00000084D2185C8  497018778
MDSOSS                         C00000084B3CC328 C00000084D2185C8  497018778
MDSOSS                         C0000008473E3A88 C00000084F13BD98 1450489357
MDSOSS                         C0000008473E2510 C0000008518A3DA0 2446627624
MDSOSS                         C0000008473E2510 C0000008518A3DA0 2446627624
 
USERNAME                       SESSION_ADDR     SQLADDR             SQLHASH
------------------------------ ---------------- ---------------- ----------
MDSOSS                         C0000008473E2510 C0000008518A3DA0 2446627624
MDSOSS                         C0000008523DDBC8 C000000850AE75E0 2349095001
MDSOSS                         C0000008523DDBC8 C000000850AE75E0 2349095001
MDSOSS                         C0000008473E2510 C0000008518A3DA0 2446627624
MDSOSS                         C0000008473E2510 C0000008518A3DA0 2446627624
MDSOSS                         C00000084B3CC328 C00000084D2185C8  497018778
MDSOSS                         C00000084A3F98A0 C00000030871D7E0 1117602678
MDSOSS                         C00000084941A720 C00000084F2EB838 1495689429
MDSOSS                         C00000084A3F98A0 C00000030871D7E0 1117602678
MDSOSS                         C00000084A3F98A0 C00000030871D7E0 1117602678
MDSOSS                         C00000084941A720 C00000084F2EB838 1495689429
MDSOSS                         C00000084941A720 C00000084F2EB838 1495689429
MDSOSS                         C00000084B3CC328 C00000084D2185C8  497018778
MDSOSS                         C00000084941A720 C00000084F2EB838 1495689429
MDSOSS                         C00000084941A720 C00000084F2EB838 1495689429
MDSOSS                         C00000084A3F98A0 C00000030871D7E0 1117602678
MDSOSS                         C00000084A3F98A0 C00000030871D7E0 1117602678
MDSOSS                         C00000084A3F8328 C000000851A28740   87302580
MDSOSS                         C00000084A3F8328 C000000851A28740   87302580
MDSOSS                         C00000084A3F8328 C000000851A28740   87302580
 
61 rows selected
此时我们知道MDSOSS用户的sql是导致临时段爆满的罪魁祸首









































































    
 
 

您可能感兴趣的文章:

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












  • 相关文章推荐
  • 出现ORA-01401和ORA-01008错误?
  • Eclipse连接Oracle数据库的ORA-00604 ORA-12705错误
  • oracle ORA-01114、ORA-27067错误解决方法
  • Oracle不能删除表 ORA-00604 ORA-01422 错误
  • 如何得到带有ora的行的下一行
  • ORA-12514及ORA-28547错误解决方案
  • 如何配置 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
  • Oracle 数据库闪回功能设置出现ORA-19809和ORA-19804错误
  • ORA-00947:Not enough values (没有足够的值)的深入分析
  • solaris10 安装 ora9.2.0.1 时报错
  • 在UNIX下,我的ORA817该怎么样才可以自己启动呀?
  • 基于ORA-12170 TNS 连接超时解决办法详解
  • plsql连接oracle数据库报ora 12154错误解决方法
  • 安装oracle出现error:ora-01031:insufficient privilleges的解决


  • 站内导航:


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

    ©2012-2021,