Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2323131
  • 博文数量: 535
  • 博客积分: 8689
  • 博客等级: 中将
  • 技术积分: 7066
  • 用 户 组: 普通用户
  • 注册时间: 2010-11-26 10:00
文章分类

全部博文(535)

文章存档

2024年(4)

2023年(4)

2022年(16)

2014年(90)

2013年(76)

2012年(125)

2011年(184)

2010年(37)

分类: Oracle

2014-03-13 15:26:20




有很多类似下面的操作,都是在inert或delete      tf_balance这个表。
有大量的IO及锁。不可能不慢。重启没有用了。会做undo,等这些操作做完吧。


SQL> select sql_text from v$sql where sql_id='fy6yjwtwpykj3';

SQL_TEXT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
insert into tf_balance(fterm,fdate,fsetcode,facctcode,fstartbal,fjje,fdje,fdebit,fcredit,faccdebit,facccredit,fendbal,fbstartbal,fbjje,fbdje,fbdebit,fbcredit,fbaccdebit,fbacccredit,fbendbal,fastartbal
,fjsl,fdsl,fadebit,facredit,faaccdebit,faacccredit,faendbal) select 201311,to_date('2013-11-24','yyyy-MM-dd'),225,a.facctcode,NVL(b.fendbal,0) as fstartbal,NVL(c.jfbal,0) as fjje,NVL(c.dfbal,0) as fdj
e,NVL(b.fdebit,0)+NVL(c.jfbal,0) as fdebit,NVL(b.fcredit,0)+NVL(c.dfbal,0) as fcredit,NVL(b.faccdebit,0)+NVL(c.jfbal,0) as faccdebit,NVL(b.facccredit,0)+NVL(c.dfbal,0) as facccredit,NVL(b.fendbal,0)+N
VL(c.jfbal,0)-NVL(c.dfbal,0) as fendbal,NVL(b.fbendbal,0) as fbstartbal,NVL(c.jfbbal,0) as fbjje,NVL(c.dfbbal,0) as fbdje,NVL(b.fbdebit,0)+NVL(c.jfbbal,0) as fbdebit,NVL(b.fbcredit,0)+NVL(c.dfbbal,0)
as fbcredit,NVL(b.fbaccdebit,0)+NVL(c.jfbbal,0) as fbaccdebit,NVL(b.fbacccredit,0)+NVL(c.dfbbal,0) as fbacccredit,NVL(b.fbendbal,0)+NVL(c.jfbbal,0)-NVL(c.dfbbal,0) as fbendbal,NVL(b.faendbal,0) as fas


SQL> select sql_text from v$sql where sql_id='cx7sxk891r782';

SQL_TEXT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
insert into tf_balance(fterm,fdate,fsetcode,facctcode,fstartbal,fjje,fdje,fdebit,fcredit,faccdebit,facccredit,fendbal,fbstartbal,fbjje,fbdje,fbdebit,fbcredit,fbaccdebit,fbacccredit,fbendbal,fastartbal
,fjsl,fdsl,fadebit,facredit,faaccdebit,faacccredit,faendbal) select 201312,to_date('2013-12-02','yyyy-MM-dd'),262,a.facctcode,NVL(b.fendbal,0) as fstartbal,NVL(c.jfbal,0) as fjje,NVL(c.dfbal,0) as fdj
e,NVL(b.fdebit,0)+NVL(c.jfbal,0) as fdebit,NVL(b.fcredit,0)+NVL(c.dfbal,0) as fcredit,NVL(b.faccdebit,0)+NVL(c.jfbal,0) as faccdebit,NVL(b.facccredit,0)+NVL(c.dfbal,0) as facccredit,NVL(b.fendbal,0)+N
VL(c.jfbal,0)-NVL(c.dfbal,0) as fendbal,NVL(b.fbendbal,0) as fbstartbal,NVL(c.jfbbal,0) as fbjje,NVL(c.dfbbal,0) as fbdje,NVL(b.fbdebit,0)+NVL(c.jfbbal,0) as fbdebit,NVL(b.fbcredit,0)+NVL(c.dfbbal,0)
as fbcredit,NVL(b.fbaccdebit,0)+NVL(c.jfbbal,0) as fbaccdebit,NVL(b.fbacccredit,0)+NVL(c.dfbbal,0) as fbacccredit,NVL(b.fbendbal,0)+NVL(c.jfbbal,0)-NVL(c.dfbbal,0) as fbendbal,NVL(b.faendbal,0) as fas


SQL> select sql_text from v$sql where sql_id='9gxn427t91gzb';

SQL_TEXT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
delete from tf_balance where fsetcode=262 and fdate=to_date('2013-04-29','yyyy-MM-dd')



SQL> select sql_id ,username,status,event from v$session;

SQL_ID        USERNAME                       STATUS   EVENT
------------- ------------------------------ -------- ------------------------------------------------------------
                                             ACTIVE   rdbms ipc message
              PAFUND                         INACTIVE SQL*Net message from client
              PAFUND                         INACTIVE SQL*Net message from client
fy6yjwtwpykj3 PAFUND                         ACTIVE   db file sequential read
5ht24qddjd1qu PAFUND                         ACTIVE   library cache: mutex X
              PAFUND                         INACTIVE SQL*Net message from client
                                             ACTIVE   rdbms ipc message
              PAFUND                         INACTIVE SQL*Net message from client
b7j4fgwndf8xy PAFUND                         ACTIVE   latch: row cache objects
1kugvnpnutfs3 PAFUND                         ACTIVE   db file sequential read
cs8fu38yrb3yk PAFUND                         ACTIVE   db file sequential read

SQL_ID        USERNAME                       STATUS   EVENT
------------- ------------------------------ -------- ------------------------------------------------------------
              PAFUND                         INACTIVE SQL*Net message from client
                                             ACTIVE   pmon timer
g4j0gppyv1zrk PAFUND                         ACTIVE   db file sequential read
5997s0qscqayf PAFUND                         ACTIVE   db file sequential read
              PAFUND                         INACTIVE SQL*Net message from client
0t9s6jqqwch5p PAFUND                         ACTIVE   SQL*Net message from client
              PAFUND                         INACTIVE SQL*Net message from client
                                             ACTIVE   rdbms ipc message
                                             ACTIVE   Streams AQ: qmn slave idle wait
b7s3syk5czac6 PAFUND                         ACTIVE   library cache: mutex X
c0d52902puynn PAFUND                         ACTIVE   buffer busy waits

SQL_ID        USERNAME                       STATUS   EVENT
------------- ------------------------------ -------- ------------------------------------------------------------
7nw46570522zr PAFUND                         ACTIVE   SQL*Net more data from client
6xjwq1cs38pu1 PAFUND                         ACTIVE   SQL*Net more data from client
                                             ACTIVE   VKTM Logical Idle Wait
                                             ACTIVE   Streams AQ: qmn coordinator idle wait
              PAFUND                         INACTIVE SQL*Net message from client
0zdj2w3puat6x PAFUND                         ACTIVE   db file scattered read
              PAFUND                         INACTIVE SQL*Net message from client
4awr95jytj8ad PAFUND                         ACTIVE   db file sequential read
                                             ACTIVE   Space Manager: slave idle wait
                                             ACTIVE   rdbms ipc message
                                             ACTIVE   Streams AQ: waiting for time management or cleanup tasks

SQL_ID        USERNAME                       STATUS   EVENT
------------- ------------------------------ -------- ------------------------------------------------------------
              PAFUND                         INACTIVE SQL*Net message from client
g9htcx5j80tn4 PAFUND                         ACTIVE   enq: TX - row lock contention
2t0pjzx74gwan PAFUND                         ACTIVE   enq: TX - row lock contention
7z5fcxmm7ur3x PAFUND                         INACTIVE SQL*Net message from client
                                             ACTIVE   DIAG idle wait
                                             ACTIVE   rdbms ipc message
              PAFUND                         INACTIVE SQL*Net message from client
5x98ghym2mayz PAFUND                         ACTIVE   SQL*Net message from client
7zh03rajctwhr PAFUND                         ACTIVE   latch: undo global data
7z5fcxmm7ur3x PAFUND                         INACTIVE SQL*Net message from client
              SYS                            INACTIVE SQL*Net message from client

SQL_ID        USERNAME                       STATUS   EVENT
------------- ------------------------------ -------- ------------------------------------------------------------
                                             ACTIVE   rdbms ipc message
              PAFUND                         INACTIVE SQL*Net message from client
              PAFUND                         INACTIVE SQL*Net message from client
60v2wyuyx0v1j PAFUND                         ACTIVE   latch: cache buffers chains
              PAFUND                         INACTIVE SQL*Net message to client
7z5fcxmm7ur3x PAFUND                         INACTIVE SQL*Net message from client
              PAFUND                         INACTIVE SQL*Net message from client
                                             ACTIVE   DIAG idle wait
              PAFUND                         INACTIVE SQL*Net message from client
fkxcq41h3vav2 PAFUND                         ACTIVE   enq: TX - row lock contention
bv7zfzkdxwscf PAFUND                         ACTIVE   library cache: mutex X

SQL_ID        USERNAME                       STATUS   EVENT
------------- ------------------------------ -------- ------------------------------------------------------------
7z5fcxmm7ur3x PAFUND                         INACTIVE SQL*Net message from client
              SYS                            INACTIVE SQL*Net message from client
                                             ACTIVE   rdbms ipc message
              PAFUND                         INACTIVE SQL*Net message from client
gv6pj9gjq62cn PAFUND                         ACTIVE   latch: undo global data
9gxn427t91gzb PAFUND                         ACTIVE   enq: TX - row lock contention
425c9h4ab25m6 PAFUND                         ACTIVE   SQL*Net message from client
7z5fcxmm7ur3x PAFUND                         INACTIVE SQL*Net message from client
93dny9fpmwu2j SYS                            ACTIVE   SQL*Net message to client
                                             ACTIVE   rdbms ipc message
c7vamay4rv18f PAFUND                         ACTIVE   db file scattered read

SQL_ID        USERNAME                       STATUS   EVENT
------------- ------------------------------ -------- ------------------------------------------------------------
7qztsnd2nzf2h PAFUND                         ACTIVE   SQL*Net more data from client
g3s1qnqqhncbs PAFUND                         ACTIVE   db file sequential read
9kd59hp4nym6u PAFUND                         ACTIVE   buffer busy waits
7z5fcxmm7ur3x PAFUND                         INACTIVE SQL*Net message from client
87bjcsn6h52nn PAFUND                         ACTIVE   buffer busy waits
                                             ACTIVE   rdbms ipc message
4pxxn019rac4d PAFUND                         ACTIVE   library cache: mutex X
64mtd1zxrcz79 PAFUND                         ACTIVE   SQL*Net more data from client
100dzmtana2dq PAFUND                         ACTIVE   library cache: mutex X
7z5fcxmm7ur3x PAFUND                         INACTIVE SQL*Net message from client
                                             ACTIVE   rdbms ipc message

SQL_ID        USERNAME                       STATUS   EVENT
------------- ------------------------------ -------- ------------------------------------------------------------
b1dyyha2wmw7m PAFUND                         ACTIVE   library cache: mutex X
fzpj35pnk4b6k PAFUND                         ACTIVE   latch: row cache objects
fsghtrm14jpvz PAFUND                         ACTIVE   latch: shared pool
0x22zh3rbcy2q PAFUND                         ACTIVE   enq: TX - row lock contention
7z5fcxmm7ur3x PAFUND                         INACTIVE SQL*Net message from client
                                             ACTIVE   rdbms ipc message
02nfv07p9kw3j PAFUND                         ACTIVE   SQL*Net more data from client
7z5fcxmm7ur3x PAFUND                         ACTIVE   direct path write temp
              PAFUND                         INACTIVE SQL*Net message from client
2t0pjzx74gwan PAFUND                         ACTIVE   enq: TX - row lock contention
7z5fcxmm7ur3x PAFUND                         INACTIVE SQL*Net message from client

SQL_ID        USERNAME                       STATUS   EVENT
------------- ------------------------------ -------- ------------------------------------------------------------
                                             ACTIVE   smon timer
f9rnznf7jxynz PAFUND                         ACTIVE   SQL*Net more data from client
3ubgz22y6yjzr PAFUND                         ACTIVE   buffer busy waits
8f1sjvfxuup9w PAFUND                         INACTIVE SQL*Net message from client
c0zuz6khfdvxh PAFUND                         ACTIVE   SQL*Net more data from client
7z5fcxmm7ur3x PAFUND                         INACTIVE SQL*Net message from client
                                             ACTIVE   rdbms ipc message
              PAFUND                         INACTIVE SQL*Net message from client
cx7sxk891r782 PAFUND                         ACTIVE   library cache: mutex X
              PAFUND                         INACTIVE SQL*Net message from client
              PAFUND                         INACTIVE SQL*Net message from client

SQL_ID        USERNAME                       STATUS   EVENT
------------- ------------------------------ -------- ------------------------------------------------------------
3vjq7y0npprw2 PAFUND                         ACTIVE   latch: shared pool


10.14.51.90 CPU 占用高



阅读(2779) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~