1.描述
问题描述:删除临时表空间时,会话Hangs挂起
SQL> drop tablespace TEMP_B including contents and datafiles; 
2.故障诊断思路
2.1查看alert日志:
Sun Apr  :: 

ORA- signalled during: drop tablespace TEMP_B including contents and datafiles...

Sun Apr  :: 

drop tablespace TEMP_B including contents and datafiles
 2.2查询会话等待事件:
 
select sid,program,status,blocking_session,event from v$session where type='USER'

   SID PROGRAM                          STATUS    BLOCKING_SESSION EVENT

---- ------------- ---------- ---------------- ------------------------------------------------

    sqlplus@enmo(TNS V1-V3)  ACTIVE                                  enq: TS - contention 

   oracle@enmo ( J001)          ACTIVE                                       jobq slave wait

   oracle@enmo (J000)           ACTIVE                                       jobq slave wait

   sqlplus@enmo(TNS V1-V3)ACTIVE                                     SQL*Net message to client

SID                       会话标识符

PROGRAM           操作系统程序名称

STATUS                正在执行的SQL会话:active

BLOCKING_SESSION  阻塞会话的标识符 sid

EVENT                       等待事件类型:

TYPE                          会话类型:用户 USER

#查询:会话id=13的信息:

SQL> select sid,program,status,blocking_session,event from v$session where sid=;

SID PROGRAM                         STATUS     BLOCKING_SESSION EVENT

---- ------------- ---------- ---------------- ------------------------------

   oracle@enmo ( SMON)    ACTIVE                      smon timer

2.3本次操作,sqlplus本地登录,查询spid

#查询spid

[oracle@enmo app]$ ps -ef|grep LOCAL=YES  本地连接会话的操作系统进程号

oracle       : ?        :: oracleENMO (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))

[oracle@enmo app]$ ps -ef|grep            查询父进程:为sqlplus工具 

UID      PID     PPID

oracle       : pts/    :: sqlplus   as sysdba

oracle       : ?        :: oracleENMO (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))

SQL> select sid,sql_id,status,event from v$session where paddr=(select addr from v$process where spid=);

       SID SQL_ID        STATUS                 EVENT

----------------------------------------------------------------

          5y9u0m6wv4mch ACTIVE     enq: TS - contention

2,4:oradebug跟踪进程:

SQL> oradebug setospid 15576

Oracle pid: 19, Unix process pid: 15576, image: oracle@enmo (TNS V1-V3)

SQL> oradebug unlimit

Statement processed.

SQL> oradebug dump systemstate 258

Statement processed.

SQL> oradebug dump systemstate 258

Statement processed.

SQL> exit

SQL>  show parameter user_dump

/u01/app/oracle/diag/rdbms/enmo/ENMO/trace

[oracle@enmo trace]$ ls -lrt

-rw-r----- 1 oracle oinstall 2127846 Apr  1 05:41 ENMO_ora_15576.trc

sftp> get ENMO_ora_15576.trc C:\Users\Administrator\Desktop\.
2.5:trace文件查看:
[oracle@enmo trace]$ more ENMO_ora_15576.trc

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0

- 64bit Production

Instance name: ENMO

Redo thread mounted by this instance: 1

Oracle process number: 19

Unix process pid: 15576, image: oracle@enmo (TNS V1-V3)

######根据spid查询没发现什么有效信息:

/ospid: 15576 

...skipping

    (latch info) wait_event=0 bits=0x0

    Process Group: DEFAULT, pseudo proc: 0x7ed5ac30

    O/S info: user: oracle, term: UNKNOWN, ospid: 15576

    OSD pid info: Unix process pid: 15576, image: oracle@e

nmo (TNS V1-V3)

#####根据:ospid: 14800 

----------------------------------------

SO: 0x7e892b40, type: 4, owner: 0x7ecc5220, flag: INIT/-/-/0x00 if: 0x3 c: 0x3

proc=0x7ecc5220, name=session, file=ksu.h LINE:12729, pg=0

(session) sid: 1 ser: 5 trans: 0x7ccb8a68, creator: 0x7ecc5220

flags: (0x41) USR/- flags_idl: (0x1) BSY/-/-/-/-/-

flags2: (0x48009) -/DDLT2/INC

DID: , short-term DID:

txn branch: (nil)

edition#: 100 oct: 41, prv: 0, sql: 0x7f76ef79fdf0, psql: 0x78f50ad0, user: 0/SYS

ksuxds FALSE at location: 0

service name: SYS$USERS

client details:

O/S info: user: oracle, term: pts/1, ospid: 14800

machine: enmo program: sqlplus@enmo (TNS V1-V3)

application name: sqlplus@enmo (TNS V1-V3), hash value=1501019605

Current Wait Stack:

0: waiting for 'enq: TS - contention'

name|mode=0x54530006, tablespace ID=0x1c, dba=0x1

wait_id=14569 seq_num=14571 snap_id=1

wait times: snap=7 min 28 sec, exc=7 min 28 sec, total=7 min 28 sec

wait times: max=infinite, heur=7 min 28 sec

wait counts: calls=151 os=151

in_wait=1 iflags=0x15a0

#  有一个会话被阻塞

There are 1 sessions blocked by this session.

Dumping one waiter:

inst: 1, sid: 39, ser: 153         

#等待事件

wait event: 'enq: TT - contention'

#############################根据:会话ID,查询操作系统进程号####

SQL> select spid from v$process where addr=(select paddr from v$session where sid=13);

SPID

------------------------

15542

#############根据操系统进程查询:SMON进程#####################

[root@enmo ~]# ps -ef|grep 15542

oracle   15542     1  0 03:27 ?        00:00:01 ora_smon_ENMO

p1: 'name|mode'=0x54540004

p2: 'tablespace ID'=0x1a

p3: 'operation'=0x0

row_wait_obj#: 4294967295, block#: 0, row#: 0, file# 0

min_blocked_time: 232 secs, waiter_cache_ver: 2576

Wait State:

fixed_waits=0 flags=0x2b boundary=0x7e894a28/0

Session Wait History:

elapsed time of 25375533 min 56 sec since current wait

0: waited for 'ksdxexeotherwait'

=0x0, =0x0, =0x0

wait_id=14585 seq_num=14587 snap_id=1

等待时间

wait times: snap=0.042447 sec, exc=0.042447 sec, total=0.042447 sec

wait times: max=30.000000 sec

wait counts: calls=0 os=0

在经过时间:s后发生

occurred after 0.000000 sec of elapsed time

等待:

1: waited for 'ksdxexeotherwait'

=0x0, =0x0, =0x0

wait_id=14584 seq_num=14586 snap_id=1

wait times: snap=0.045086 sec, exc=0.045086 sec, total=0.045086 sec

wait times: max=30.000000 sec

wait counts: calls=0 os=0

occurred after 0.000000 sec of elapsed time

2: waited for 'ksdxexeotherwait'

=0x0, =0x0, =0x0

wait_id=14583 seq_num=14585 snap_id=1

wait times: snap=0.030094 sec, exc=0.030094 sec, total=0.030094 sec

wait times: max=29.990000 sec

wait counts: calls=0 os=0

occurred after 0.000000 sec of elapsed time

3: waited for 'ksdxexeotherwait'

=0x0, =0x0, =0x0

wait_id=14582 seq_num=14584 snap_id=1

wait times: snap=0.030958 sec, exc=0.030958 sec, total=0.030958 sec

wait times: max=30.000000 sec

wait counts: calls=0 os=0

occurred after 0.000000 sec of elapsed time

4: waited for 'ksdxexeotherwait'

=0x0, =0x0, =0x0

wait_id=14581 seq_num=14583 snap_id=1

wait times: snap=0.033920 sec, exc=0.033920 sec, total=0.033920 sec

wait times: max=30.000000 sec

wait counts: calls=0 os=0

occurred after 0.000000 sec of elapsed time

5: waited for 'ksdxexeotherwait'

=0x0, =0x0, =0x0

wait_id=14580 seq_num=14582 snap_id=1

wait times: snap=0.029040 sec, exc=0.029040 sec, total=0.029040 sec

wait times: max=30.000000 sec

wait counts: calls=0 os=0

occurred after 0.000000 sec of elapsed time

6: waited for 'ksdxexeotherwait'

=0x0, =0x0, =0x0

wait_id=14579 seq_num=14581 snap_id=1

wait times: snap=0.031045 sec, exc=0.031045 sec, total=0.031045 sec

wait times: max=29.990000 sec

wait counts: calls=0 os=0

occurred after 0.000000 sec of elapsed time

7: waited for 'ksdxexeotherwait'

=0x0, =0x0, =0x0

wait_id=14578 seq_num=14580 snap_id=1

wait times: snap=0.027048 sec, exc=0.027048 sec, total=0.027048 sec

wait times: max=30.000000 sec

wait counts: calls=0 os=0

occurred after 0.000000 sec of elapsed time

8: waited for 'ksdxexeotherwait'

=0x0, =0x0, =0x0

wait_id=14577 seq_num=14579 snap_id=1

wait times: snap=0.029306 sec, exc=0.029306 sec, total=0.029306 sec

wait times: max=30.000000 sec

wait counts: calls=0 os=0

occurred after 0.000000 sec of elapsed time

9: waited for 'ksdxexeotherwait'

=0x0, =0x0, =0x0

wait_id=14576 seq_num=14578 snap_id=1

wait times: snap=0.031989 sec, exc=0.031989 sec, total=0.031989 sec

wait times: max=30.000000 sec

wait counts: calls=0 os=0

occurred after 0.000000 sec of elapsed time

#会话1,序列号5的采样会话历史记录

Sampled Session History of session 1 serial 5

---------------------------------------------------
匹配:
mos文章SMON Blocking Drop Temporary Tablespace (文档 ID 1500044.1)描述的现象符合
This seems to be caused by Bug 13028161:
DROP TEMP TABLESPACE HANGS DUE TO TS ENQUEUE CONTENTION which was closed as duplicate of Bug 15913577 : 
MAIN_LINUX.X64 LRG9H8 RUNS WILL BE SUSPENDED 12/02/12; TOO MANY HANGS 
#提示:是一个BUG,查询文章:SMON进程堵塞了drop tempfile的会话,会话当前等待
 
SMON Blocking Drop Temporary Tablespace (文档 ID 1500044.1)
The following steps have been performed successfully:
- Create a new temporary tablespace
- Declare as the new default temp
- Make sure that no users have the old temp as their default
 
 
#匹配
Now trying to drop the old temporary tablespace, the session hangs.

Analyzing the problem shows the following:

- Tracing the session using 10046 shows that the session is waiting for event "enq: TS - contention'"

- System state dump shows that the session is blocked by SMON

- SMON is waiting for event "SMON TIMER"

drop old temporary tablespace,session hangs故障现象符合

等待事件: TS - contention 符合

10046:跟踪,查询堵塞进程 SMON 符合
#故障解释说明
由bug13028161引起的:由于TS ENQUEUE CONTENTION 导致DROP TEMP TABLESPACE HANGS被关闭为Bug 15913577的副本:MAIN_LINUX.X64 LRG9H8 RUNS将暂停12/02/12; TOO MANY HANGS

#建议

如果可用于您的平台或使用以下解决方法,请安装修补程序15913577

#解决

检查前提条件是否满足:创建新的临时表空间,指定新临时表空间为默认值,确保没有用户分配使用旧临时表空间

EXIT 退出SQL*PLUS,重新登录执行
#涉及版本、操作系统:11.2.0.3以上,大部分操作系统都符合
Range of versions believed to be affected    Versions BELOW 12.2

Versions confirmed as being affected    

11.2.0.4

11.2.0.3

Platforms affected    Generic (all / most platforms affected)Fixed:

###建议操作

#如果有历史会话,使用旧的临时表空间,如下sql,找出会话信息,kill

-Change temporary tablespace of all the users to different temporary tablespace (If not yet done)

SQL> SELECT s.username,sid,serial#,contents,sql_address,extents,last_call_et

    FROM v$session s,v$tempseg_usage t;

WHERE s.saddr = t.session_addr;

-Kill those sessions:

alter system kill session '< sid >, < Serial# >';
#实际操作:
 
exit
[oracle@enmo ~]$ sqlplus / as sysdba
SQL> drop tablespace TEMP_B including contents and datafiles;  [OK]
 
#记录人生中遇到的第一个bug 开心

Now trying to drop the old temporary tablespace, the session hangs.的更多相关文章

  1. Oracle中的Temporary tablespace的作用

    临时表空间主要用途是在数据库进行排序运算[如创建索引.order by及group by.distinct.union/intersect/minus/.sort-merge及join.analyze ...

  2. [Oracle] 中的Temporary tablespace的作用

    临时表空间主要用途是在数据库进行排序运算[如创建索引.order by及group by.distinct.union/intersect/minus/.sort-merge及join.analyze ...

  3. ORA-25153: Temporary Tablespace is Empty

    在一测试环境做测试的时候发生以下错误: SQL> exec dbms_stats.gather_table_stats(ownname=>'SYS',tabname=>'TT',me ...

  4. ORA-25153: Temporary Tablespace is Empty解决方法

    SQL> @/tmp/4.txt create table huang_1 (deptno number,dname varchar2(19),loc varchar2(20)) * ERROR ...

  5. ORA-10922 Temporary tablespace group is empty错误

    错误--练习查询,发现报错: SQL>  select * from range_list_part_tab where id=100000Execution Plan------------- ...

  6. Temporary Segments: What Happens When a Sort Occurs (文档 ID 102339.1)

    APPLIES TO: Oracle Database - Enterprise Edition - Version 8.1.7.4 to 11.2.0.1 [Release 8.1.7 to 11. ...

  7. Oracle Study Note : Tablespace and Data Files

    1.how to create a tablespace that employs the most common features create tablespace tb_name #create ...

  8. Oracle 临时事务表 全局临时表_global temporary table

    所有的操作都在一个事务里,事务提交后,此表清空,特别适合做插入删除频率特别高的临时表操作,比如插入完数据就开始查询,查询完就删掉等,用完就扔! 临时表分事务级临时表和会话级临时表. 事务级临时表只对当 ...

  9. 创建表空间tablespace,删除

    在plsql工具中执行以下语句,可建立Oracle表空间. /*分为四步 *//*第1步:创建临时表空间  */create temporary tablespace yuhang_temp temp ...

随机推荐

  1. 面试:Handler 的工作原理是怎样的?

    面试场景 平时开发用到其他线程吗?都是如何处理的? 基本都用 RxJava 的线程调度切换,嗯对,就是那个 observeOn 和 subscribeOn 可以直接处理,比如网络操作,RxJava 提 ...

  2. Laravel 中缓存驱动的速度比较

    缓存是web开发中重要的一部分,我相信很多人和我一样,经常忽略这个问题. 随着工作经验的累积,我已经意识到缓存是多么的重要,这里我通过 Scotch 来解释一下它的重要性. 通过观察发现,Scotch ...

  3. IDEA2017注册码

    1. 到网站 http://idea.lanyus.com/ 获取注册码. 2.填入下面的license server: http://intellij.mandroid.cn/ http://ide ...

  4. 关于Netty的入门使用

    Netty介绍: Netty是一个提供异步事件驱动的网络应用框架,用以快速开发高性能.高可靠性的网络服务器和客户端程序. 换句话说,Netty是一个NIO框架,使用它可以简单快速地开发网络应用程序,比 ...

  5. Java基础学习笔记四 Java基础语法

    数组 数组的需求 现在需要统计某公司员工的工资情况,例如计算平均工资.最高工资等.假设该公司有50名员工,用前面所学的知识完成,那么程序首先需要声明50个变量来分别记住每位员工的工资,这样做会显得很麻 ...

  6. 2018上C语言程序设计(高级)博客作业样例

    要求一(20分) 完成PTA中题目集名为<usth-C语言高级-第1次作业>中的所有题目. 要求二 PTA作业的总结(20分+30分) 将PTA第1次作业作业中以下2道题的解题思路按照规定 ...

  7. Alpha第三天

    Alpha第三天 听说 031502543 周龙荣(队长) 031502615 李家鹏 031502632 伍晨薇 031502637 张柽 031502639 郑秦 1.前言 任务分配是VV.ZQ. ...

  8. 【Swift】Runtime动态性分析

    Swift是苹果2014年发布的编程开发语言,可与Objective-C共同运行于Mac OS和iOS平台,用于搭建基于苹果平台的应用程序.Swift已经开源,目前最新版本为2.2.我们知道Objec ...

  9. Python 实现火车票查询工具

    注意:由于 12306 的接口经常变化,课程内容可能很快过期,如果遇到接口问题,需要根据最新的接口对代码进行适当修改才可以完成实验. 一.实验简介 当你想查询一下火车票信息的时候,你还在上 12306 ...

  10. 算法第四版学习笔记之优先队列--Priority Queues

    软件:DrJava 参考书:算法(第四版) 章节:2.4优先队列(以下截图是算法配套视频所讲内容截图) 1:API 与初级实现 2:堆得定义 3:堆排序 4:事件驱动的仿真 优先队列最重要的操作就是删 ...