当前位置: 首页 > news >正文

表不存在,但是可以查询、删除(没有返回结果,一直hang住)

问题:用户log_user下用一张表存在如下情况:

C$_0JCZL_CB这张表在user_tables里不存在,查询不到 ,元数据也查不到,user_segments,user_extents都查不到这张表。

但是select * from log_user.C$_0JCZL_CB;或者drop这张表确实是可以执行的,只不过会被hang住。

一、做systemstate

SQL> oradebug setmypid
Statement processed.
SQL>  oradebug unlimit
Statement processed.
SQL> oradebug dump systemstate 10
Statement processed.
SQL> oradebug tracefile_name
/u01/app/oracle/diag/rdbms/ytyzx/ytyzx1/trace/ytyzx1_ora_76117.trc

#vi /u01/app/oracle/diag/rdbms/ytyzx/ytyzx1/trace/ytyzx1_ora_76117.trc

 Session Wait History:
        elapsed time of 0.000789 sec since current wait
     0: waited for 'pmon timer'
        duration=0x12c, =0x0, =0x0
        wait_id=2653893 seq_num=32496 snap_id=1
        wait times: snap=2.999524 sec, exc=2.999524 sec, total=2.999524 sec
        wait times: max=3.000000 sec
        wait counts: calls=1 os=1
        occurred after 0.000552 sec of elapsed time
     1: waited for 'pmon timer'
        duration=0x12c, =0x0, =0x0
        wait_id=2653892 seq_num=32495 snap_id=1
        wait times: snap=2.999279 sec, exc=2.999279 sec, total=2.999279 sec
        wait times: max=3.000000 sec
        wait counts: calls=1 os=1
        occurred after 0.000785 sec of elapsed time
     2: waited for 'pmon timer'
        duration=0x12c, =0x0, =0x0
        wait_id=2653891 seq_num=32494 snap_id=1
        wait times: snap=2.999487 sec, exc=2.999487 sec, total=2.999487 sec
        wait times: max=3.000000 sec
        wait counts: calls=1 os=1
        occurred after 0.000599 sec of elapsed time
     3: waited for 'pmon timer'
        duration=0x12c, =0x0, =0x0
        wait_id=2653890 seq_num=32493 snap_id=1
        wait times: snap=3.001268 sec, exc=3.001268 sec, total=3.001268 sec
        wait times: max=3.000000 sec
        wait counts: calls=4 os=4
        occurred after 0.000827 sec of elapsed time
     4: waited for 'pmon timer'
        duration=0x12c, =0x0, =0x0
        wait_id=2653889 seq_num=32492 snap_id=1
        wait times: snap=3.000434 sec, exc=3.000434 sec, total=3.000434 sec
        wait times: max=3.000000 sec
        wait counts: calls=1 os=1
        occurred after 0.000628 sec of elapsed time

    5: waited for 'pmon timer'
        duration=0x12c, =0x0, =0x0
        wait_id=2653888 seq_num=32491 snap_id=1
        wait times: snap=3.000275 sec, exc=3.000275 sec, total=3.000275 sec
        wait times: max=3.000000 sec
        wait counts: calls=1 os=1
        occurred after 0.000825 sec of elapsed time
     6: waited for 'pmon timer'
        duration=0x12c, =0x0, =0x0
        wait_id=2653887 seq_num=32490 snap_id=1
        wait times: snap=3.000400 sec, exc=3.000400 sec, total=3.000400 sec
        wait times: max=3.000000 sec
        wait counts: calls=1 os=1
        occurred after 0.000669 sec of elapsed time
     7: waited for 'pmon timer'
        duration=0x12c, =0x0, =0x0
        wait_id=2653886 seq_num=32489 snap_id=1
        wait times: snap=3.000020 sec, exc=3.000020 sec, total=3.000020 sec
        wait times: max=3.000000 sec
        wait counts: calls=1 os=1
        occurred after 0.011046 sec of elapsed time
     8: waited for 'pmon timer'
        duration=0x12c, =0x0, =0x0
        wait_id=2653885 seq_num=32488 snap_id=1
        wait times: snap=3.000554 sec, exc=3.000554 sec, total=3.000554 sec
        wait times: max=3.000000 sec
        wait counts: calls=1 os=1
        occurred after 0.000509 sec of elapsed time
     9: waited for 'pmon timer'
        duration=0x12c, =0x0, =0x0
        wait_id=2653884 seq_num=32487 snap_id=1
        wait times: snap=3.000333 sec, exc=3.000333 sec, total=3.000333 sec
        wait times: max=3.000000 sec
        wait counts: calls=1 os=1
        occurred after 0.000752 sec of elapsed time
    Sampled Session History of session 99 serial 1
    ---------------------------------------------------
    The sampled session history is constructed by sampling

    the target session every 1 second. The sampling process
    captures at each sample if the session is in a non-idle wait,
    an idle wait, or not in a wait. If the session is in a
    non-idle wait then one interval is shown for all the samples
    the session was in the same non-idle wait. If the
    session is in an idle wait or not in a wait for
    consecutive samples then one interval is shown for all
    the consecutive samples. Though we display these consecutive
    samples  in a single interval the session may NOT be continuously
    idle or not in a wait (the sampling process does not know).

    The history is displayed in reverse chronological order.

    sample interval: 1 sec, max history 120 sec
    ---------------------------------------------------
      [121 samples,                                        14:56:10 - 14:58:10]
        idle wait at each sample
    temporary object counter: 0
      ----------------------------------------
      Virtual Thread:
      kgskvt: 0x63ca2e7c8, sess: 0x6387044b0 sid: 99 ser: 1
      vc: (nil), proc: 0x63c6127f8, id: 99
      consumer group cur: _ORACLE_BACKGROUND_GROUP_ (upd? 0), mapped: _ORACLE_BACKGROUND_GROUP_, orig:
      vt_state: 0x100, vt_flags: 0x4030, blkrun: 0, numa: 1
      inwait: 0, posted_run=0
      location where insched last set: kgskthrexit
      location where insched last cleared: kgskthrexit3
      location where inwait last set: NULL
      location where inwait last cleared: NULL
      is_assigned: 0, in_sched: 0 (0)
      qcls: (nil), qlink: FALSE
      vt_active: 0 (pending: 0)
      vt_pq_active: 0, dop: 0
      used quanta: 0 (cg: 0) usec, num penalty: 0
      cpu start time: 0
      idle time: 0, active time: 0 (cg: 0)
      cpu yields: 0 (cg: 0), waits: 0 (cg: 0), wait time: 0 (cg: 0) usec
      io waits: 0 (cg: 0), wait time: 0 (cg: 0) usec
      ASL queued time outs: 0, time: 0 (cur 0, cg 0)
      PQQ queued time outs: 0, time: 0 (cur 0, cg 0)
      Queue timeout violation: 0
      calls aborted: 0, num est exec limit hit: 0
      undo current: 0k max: 0k
      I/O credits acquired:small=0 large=0
      I/O credits waiting for:small=0 large=0
      KTU Session Commit Cache Dump for IDLs:
      KTU Session Commit Cache Dump for Non-IDLs:
      ----------------------------------------

 二、分析

查看等待事件都有waited for 'pmon timer' -->竟然是等待PMON TIMER,想想PMON 进程监视器,主要作用1.清理与实例非法断开的server_procese残留的资源 非正常终止的用户进程产生的垃圾资源2.负责重启以外死掉的调度器(网络监听中使用的) 3.将实例的信息注册到监听程序。初步怀疑是资源没有清理干净。

在没有人连接log_user用户情况下,查看连接状态

SQL>select a.username,a.sid ,a.serial#,b.spid  from v$session a,v$process b where a.paddr=b.addr and a.username='LOG_USER';

USERNAME                  SID    SERIAL# SPID
------------------------------ ---------- ---------- ------------------------
LOG_USER                  248      47495 24190
LOG_USER                  857      52515 76015
LOG_USER                 1054      22901 76017
LOG_USER                 1251      31647 76012
LOG_USER                 1443      47651 76021
LOG_USER                9    3375 76002
LOG_USER                  258      56833 76023
LOG_USER                 1109      32727 52422
LOG_USER                 1133      20557 75990
LOG_USER                 1249    7221 76008
LOG_USER                 1107      55071 32057

.......足足36个残存的资源没有清理。


The database iswaiting for pmon to clean up processes, but pmon is unable to clean them. Theclient connections to the server are causing the shutdown immediate or normalto hang.  Killing them allows pmon toclean up and release the associated Oracle processes and resources.

--数据库等待PMON 进程清理这些LOCAL=NO的进程,但是PMON 进程不能清理他们,表的操作就会hang住,kill 掉这些进程,然后让PMON 来清理和释放其他的数据库进程和资源,完成数据库关闭操作。

三、解决办法

就是将这些残存的会话,PMON没有清理掉的会话kill掉。

SQL>set lines 250

SQL>set pages 100

SQL> select 'alter system kill session '||chr(39)||SID||','||SERIAL#||chr(39)||' ;' from v$session where username='LOG_USER'; 

alter system kill session '9,3375' ;
alter system kill session '171,21175' ;
alter system kill session '179,16085' ;
alter system kill session '221,53417' ;
alter system kill session '226,16347' ;
alter system kill session '258,56833' ;
alter system kill session '269,38591' ;
alter system kill session '274,699' ;
alter system kill session '471,3245' ;
alter system kill session '547,42781' ;
alter system kill session '590,40265' ;
alter system kill session '616,14941' ;
alter system kill session '662,52641' ;
alter system kill session '816,51301' ;
alter system kill session '849,11757' ;
alter system kill session '857,52515' ;
alter system kill session '909,21525' ;

......

因为会话多所以这样写,直接执行下生成的脚本就可以了。

这回查询 select a.username,a.logon_time,a.status,a.sid ,a.serial#,b.spid  from v$session a,v$process b where a.paddr=b.addr and a.username='LOG_USER';

发现已经清理完毕。

在处理那个C$_0JCZL_CB这张表,发现就正常了。


http://www.taodudu.cc/news/show-6117783.html

相关文章:

  • 【physx/wasm】在physx中添加自定义接口并重新编译wasm
  • excel---常用操作
  • Lora训练Windows[笔记]
  • linux基础指令讲解(ls、pwd、cd、touch、mkdir)
  • InnoDB 事务处理机制
  • 启明云端ESP32 C3 模组WT32C3通过 MQTT 连接 AWS
  • 四元数与旋转——学习笔记(一)
  • oracle去掉0x00,Oracle O001 / O00n 进程 100% CPU资源耗用
  • Tp5自动加载创建admin和index文件夹
  • thinkphp5调用shell脚本_ThinkPHP 5.x远程命令执行测试工具(可getshell)
  • php 微信支付 回调处理,TP微信支付(回调处理)
  • 2008 mysql 本地安全_apache在windows2003或win2008环境中的安全设置
  • lnmp 一键安装包 安装tp5.1 404,500等相关问题
  • 解决Apache/2.4.39 (Win64) PHP/7.2.18 Server at localhost Port 80问题
  • php phpstudy虚拟域名配置
  • TP-Admin 一个拥有站群功能的多功能CMS基础系统
  • 创意编程/小学组(4-6年级)-图形化创意
  • 【品牌营销策划方案】2020碧桂园x江小白创意引爆策略方案【白酒】【IP】【创意营销】
  • 渐变多彩创意双十二活动方案主题PPT
  • 视频批量剪辑:如何给视频添加特效,比如:色彩变幻效果特效,怎么制作?
  • 如何给视频添加特效字幕?分享一个简单好用的办法
  • 剪辑视频怎么加音效 视频音效常用都有哪些类型
  • 视频编辑工具:添加水印、特效、音乐、导出视频、视频转gif
  • 谁知道下面这个视频中的特效是用什么软件做的?
  • 有哪些能给视频加特效字幕的软件?试试这几种简单方法
  • 求分享如何给短视频加特效
  • 4500m a8 amd_amd a8 4500m等同什么intel
  • R7 4800U对比R5 4600U性能差距
  • 锐龙4750u和4800u的区别
  • html4和html5的区别
  • PHP的apcu是什么,opcache又是什么?
  • 全志H3停产,A40I/T3更胜一筹--CoM-X40I核心模块来了
  • i5 6600 HD530联想扬天S5250黑苹果
  • 全志科技A40i国产开发板——性能参数综合测试
  • 全志A40i开发板(4核ARM CortexA7)测评合集——存储介质读写测试
  • 全国产!全志A40i+Logos FPGA核心板(4核ARM Cortex-A7)硬件说明