[20190402]關於semtimedop函數調用2.txt

来源:https://www.cnblogs.com/lfree/archive/2019/04/02/10641442.html
-Advertisement-
Play Games

[20190402]關於semtimedop函數調用2.txt--//前幾天做了sql語句在mutexes上的探究.今天看看_mutex_wait_time設置很大的情況下是否semtimedop會喚醒.1.環境:SYS@book> @ hide mutexNAME DESCRIPTION DEFA ...


[20190402]關於semtimedop函數調用2.txt

--//前幾天做了sql語句在mutexes上的探究.今天看看_mutex_wait_time設置很大的情況下是否semtimedop會喚醒.

1.環境:
SYS@book> @ hide mutex
NAME                DESCRIPTION        DEFAULT_VALUE SESSION_VALUE SYSTEM_VALUE
------------------- ------------------ ------------- ------------- ------------
_mutex_spin_count   Mutex spin count   TRUE          255           255
_mutex_wait_scheme  Mutex wait scheme  TRUE          2             2
_mutex_wait_time    Mutex wait time    TRUE          1             1

--//註:_mutex_wait_time=1,相當1釐秒.
SCOTT@book> @ ver1
PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

$ cat m2.txt
set verify off
column a noprint new_value v_a;
--select mod ( &&3 ,3) a  from dual ;
--alter session set optimizer_index_cost_adj= &&3;
host sleep $(echo &&3/50| bc -l )
insert into job_times values ( sys_context ('userenv', 'sid') ,dbms_utility.get_time ,'&&2') ;
commit ;
declare
v_id number;
v_d date;
begin
    for i in 1 .. &&1 loop
        --select  1 into v_id from dual ;
        --select  sysdate into v_d from dual ;
        select deptno into v_id from dept where deptno=10;
    end loop;
end ;
/
update job_times set time_ela = dbms_utility.get_time - time_ela where sid=sys_context ('userenv', 'sid') and method='&&2';
commit;
--quit

$ seq 150 | xargs -I {}  -P 150 bash -c  "sqlplus -s -l scott/book @m2.txt 1e6 f2_150 {} >/dev/null"

SYS@book> @ mutexy 6 a31kd5tkdvvmm
      HASH SUM_SLEEPS   SUM_GETS LOCATION                       MUTEX_TYPE           MUTEX_ADDR       SQLID         KGLNAOWN C100
---------- ---------- ---------- ------------------------------ -------------------- ---------------- ------------- -------- ---------------------------------------
1692266099    2263154 4.6431E+10 kksLockDelete [KKSCHLPIN6]     Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099    2183544 4.4733E+10 kksfbc [KKSCHLFSP2]            Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099       5256  600010918 kksfbc [KKSCHLPIN1]            Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099          6   45955498 kksHeapReadUnlock [KKSCHLRDUP] Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10

--//MUTEX_ADDR=000000007C88E330.

2.測試:
--//session 1:
SCOTT@book> @ spid
       SID    SERIAL# PROCESS                  SERVER    SPID       PID  P_SERIAL# C50
---------- ---------- ------------------------ --------- ------ ------- ---------- --------------------------------------------------
       295          5 65222                    DEDICATED 65223       21          3 alter system kill session '295,5' immediate;

--//session 2:
SYS@book> alter system set "_mutex_wait_scheme"=2 scope=memory;
System altered.

SYS@book> alter system set "_mutex_wait_time"=100000;
alter system set "_mutex_wait_time"=100000
*
ERROR at line 1:
ORA-00068: invalid value 100000 for parameter _mutex_wait_time, must be between 0 and 65535
--//在0-65536之間.

SYS@book> alter system set "_mutex_wait_time"=1000;
System altered.
--//相當於10秒.

--//session 2:       
SYS@book> oradebug setmypid
Statement processed.

SYS@book> oradebug peek 0x000000007C88E330 8
[07C88E330, 07C88E338) = 00000000 00000000

SYS@book> oradebug poke 0x000000007C88E330 8 0x0000000200000127
BEFORE: [07C88E330, 07C88E338) = 00000000 00000000
AFTER:  [07C88E330, 07C88E338) = 00000127 00000002

--//session 1:
SCOTT@book> @ m2.txt 1 c1 0
1 row created.
Commit complete.
--//掛起!!

3.監測:
$ strace -frT -p 65223
....
     4.001032 getrusage(RUSAGE_SELF, {ru_utime={521, 748682}, ru_stime={54, 729679}, ...}) = 0 <0.000065>
     0.000156 getrusage(RUSAGE_SELF, {ru_utime={521, 748682}, ru_stime={54, 729679}, ...}) = 0 <0.000022>
     0.000122 semtimedop(309952512, 0x7fff28087160, 1, {3, 0}) = -1 EAGAIN (Resource temporarily unavailable) <3.000687>
     3.000815 semtimedop(309952512, 0x7fff28087160, 1, {3, 0}) = -1 EAGAIN (Resource temporarily unavailable) <3.001003>
     3.001148 semtimedop(309952512, 0x7fff28087160, 1, {4, 0}) = -1 EAGAIN (Resource temporarily unavailable) <4.000630>
     4.000734 getrusage(RUSAGE_SELF, {ru_utime={521, 748682}, ru_stime={54, 729679}, ...}) = 0 <0.000064>
     0.000156 getrusage(RUSAGE_SELF, {ru_utime={521, 748682}, ru_stime={54, 729679}, ...}) = 0 <0.000022>
     0.000122 semtimedop(309952512, 0x7fff28087160, 1, {3, 0}) = -1 EAGAIN (Resource temporarily unavailable) <3.000950>
     3.001082 semtimedop(309952512, 0x7fff28087160, 1, {3, 0}) = -1 EAGAIN (Resource temporarily unavailable) <3.000722>
     3.000865 semtimedop(309952512, 0x7fff28087160, 1, {4, 0}) = -1 EAGAIN (Resource temporarily unavailable) <4.000592>
     4.000697 getrusage(RUSAGE_SELF, {ru_utime={521, 748682}, ru_stime={54, 729679}, ...}) = 0 <0.000061>
     0.000152 getrusage(RUSAGE_SELF, {ru_utime={521, 748682}, ru_stime={54, 729679}, ...}) = 0 <0.000022>
     0.000121 semtimedop(309952512, 0x7fff28087160, 1, {3, 0}) = -1 EAGAIN (Resource temporarily unavailable) <3.000734>
     3.000862 semtimedop(309952512, 0x7fff28087160, 1, {3, 0}) = -1 EAGAIN (Resource temporarily unavailable) <3.001028>
     3.001176 semtimedop(309952512, 0x7fff28087160, 1, {4, 0}) = -1 EAGAIN (Resource temporarily unavailable) <4.000716>
--//可以看出非常像dbms_lock.sleep調用,被拆分3,3,4秒分別執行.
--//但是我並沒有看解除阻塞後喚醒的情況,我測試多次.
SYS@book> oradebug poke 0x000000007C88E330 8 0x0000000200000127
BEFORE: [07C88E330, 07C88E338) = 00000000 00000000
AFTER:  [07C88E330, 07C88E338) = 00000127 00000002
-----------------------------------
     4.000819 getrusage(RUSAGE_SELF, {ru_utime={521, 748682}, ru_stime={54, 729679}, ...}) = 0 <0.000062>
     0.000153 getrusage(RUSAGE_SELF, {ru_utime={521, 748682}, ru_stime={54, 729679}, ...}) = 0 <0.000022>
     0.000124 getrusage(RUSAGE_SELF, {ru_utime={521, 748682}, ru_stime={54, 729679}, ...}) = 0 <0.000019>
     0.000087 times({tms_utime=52174, tms_stime=5472, tms_cutime=0, tms_cstime=0}) = 10874034811 <0.000019>
     0.000076 getrusage(RUSAGE_SELF, {ru_utime={521, 748682}, ru_stime={54, 729679}, ...}) = 0 <0.000020>
     0.000097 getrusage(RUSAGE_SELF, {ru_utime={521, 748682}, ru_stime={54, 729679}, ...}) = 0 <0.000017>
     0.000087 getrusage(RUSAGE_SELF, {ru_utime={521, 748682}, ru_stime={54, 729679}, ...}) = 0 <0.000020>
     0.000134 getrusage(RUSAGE_SELF, {ru_utime={521, 749681}, ru_stime={54, 729679}, ...}) = 0 <0.000020>

--//另外我註意一個細節,如果設置_mutex_wait_time>1的情況下,就會出現指數回退的情況,以下是10秒的情況.
_mutex_wait_scheme = 0                        – Always YIELD
_mutex_wait_scheme = 1 & _mutex_wait_time = t – Always SLEEP for t milli-seconds (default)
_mutex_wait_scheme = 2 & _mutex_wait_time = t – EXP BACKOFF with maximum sleep
---------------------
$ strace -frT -p 65223 -e semtimedop,getrusage
Process 65223 attached - interrupt to quit
     0.000000 getrusage(RUSAGE_SELF, {ru_utime={521, 774678}, ru_stime={54, 741678}, ...}) = 0 <0.000036>
     0.000250 getrusage(RUSAGE_SELF, {ru_utime={521, 774678}, ru_stime={54, 741678}, ...}) = 0 <0.000017>
     0.000096 getrusage(RUSAGE_SELF, {ru_utime={521, 774678}, ru_stime={54, 741678}, ...}) = 0 <0.000017>
     0.000199 getrusage(RUSAGE_SELF, {ru_utime={521, 774678}, ru_stime={54, 741678}, ...}) = 0 <0.000018>
     0.000155 getrusage(RUSAGE_SELF, {ru_utime={521, 774678}, ru_stime={54, 741678}, ...}) = 0 <0.000016>
     0.000152 getrusage(RUSAGE_SELF, {ru_utime={521, 774678}, ru_stime={54, 741678}, ...}) = 0 <0.000016>
     0.000131 getrusage(RUSAGE_SELF, {ru_utime={521, 774678}, ru_stime={54, 741678}, ...}) = 0 <0.000017>
     0.000201 getrusage(RUSAGE_SELF, {ru_utime={521, 774678}, ru_stime={54, 741678}, ...}) = 0 <0.000016>
     0.000108 getrusage(RUSAGE_SELF, {ru_utime={521, 774678}, ru_stime={54, 741678}, ...}) = 0 <0.000017>
     0.000100 getrusage(RUSAGE_SELF, {ru_utime={521, 774678}, ru_stime={54, 741678}, ...}) = 0 <0.000016>
     0.000703 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000020>
     0.000227 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000018>
     0.000109 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000016>
     0.000478 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000018>
     0.000177 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000017>
     0.000106 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000016>
     0.000149 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000016>
     0.000145 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000016>
     0.000155 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000017>
     0.000108 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000017>
     0.000136 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000016>
     0.000104 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000017>
     0.000106 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000016>
     0.000109 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000016>
     0.000342 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000019>
     0.000205 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000016>
     0.000123 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000017>
     0.000106 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000016>
     0.000968 getrusage(RUSAGE_SELF, {ru_utime={521, 776677}, ru_stime={54, 741678}, ...}) = 0 <0.000028>
     0.000243 getrusage(RUSAGE_SELF, {ru_utime={521, 776677}, ru_stime={54, 741678}, ...}) = 0 <0.000026>
     0.000128 getrusage(RUSAGE_SELF, {ru_utime={521, 776677}, ru_stime={54, 741678}, ...}) = 0 <0.000022>
     0.000173 getrusage(RUSAGE_SELF, {ru_utime={521, 776677}, ru_stime={54, 741678}, ...}) = 0 <0.000022>
     0.000172 getrusage(RUSAGE_SELF, {ru_utime={521, 776677}, ru_stime={54, 741678}, ...}) = 0 <0.000022>
     0.000164 getrusage(RUSAGE_SELF, {ru_utime={521, 776677}, ru_stime={54, 741678}, ...}) = 0 <0.000023>
     0.000160 getrusage(RUSAGE_SELF, {ru_utime={521, 776677}, ru_stime={54, 741678}, ...}) = 0 <0.000023>
     0.000176 getrusage(RUSAGE_SELF, {ru_utime={521, 776677}, ru_stime={54, 741678}, ...}) = 0 <0.000021>
     0.000122 getrusage(RUSAGE_SELF, {ru_utime={521, 776677}, ru_stime={54, 741678}, ...}) = 0 <0.000022>
     0.000117 getrusage(RUSAGE_SELF, {ru_utime={521, 776677}, ru_stime={54, 741678}, ...}) = 0 <0.000022>
     0.000206 getrusage(RUSAGE_SELF, {ru_utime={521, 776677}, ru_stime={54, 741678}, ...}) = 0 <0.000023>
     0.000129 getrusage(RUSAGE_SELF, {ru_utime={521, 776677}, ru_stime={54, 741678}, ...}) = 0 <0.000021>
     0.000160 getrusage(RUSAGE_SELF, {ru_utime={521, 776677}, ru_stime={54, 741678}, ...}) = 0 <0.000022>
     0.000309 semtimedop(309952512, 0x7fff28087160, 1, {0, 10000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.010902>
     0.011073 semtimedop(309952512, 0x7fff28087160, 1, {0, 10000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.010790>
     0.010927 semtimedop(309952512, 0x7fff28087160, 1, {0, 30000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.030891>
     0.031029 semtimedop(309952512, 0x7fff28087160, 1, {0, 70000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.070846>
     0.070985 semtimedop(309952512, 0x7fff28087160, 1, {0, 120000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.120839>
     0.120948 semtimedop(309952512, 0x7fff28087160, 1, {0, 110000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.110910>
     0.111058 semtimedop(309952512, 0x7fff28087160, 1, {0, 200000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.200888>
     0.201025 semtimedop(309952512, 0x7fff28087160, 1, {0, 150000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.150867>
     0.151005 semtimedop(309952512, 0x7fff28087160, 1, {0, 320000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.320891>
     0.321029 semtimedop(309952512, 0x7fff28087160, 1, {0, 310000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.310879>
--//實際上阻塞的情況下.睡眠的時間間隔開始一直在增加.從1,1,3,7,12,11,20,15,32,31cs增加.
     0.311003 getrusage(RUSAGE_SELF, {ru_utime={521, 777677}, ru_stime={54, 741678}, ...}) = 0 <0.000032>
     0.311003 getrusage(RUSAGE_SELF, {ru_utime={521, 777677}, ru_stime={54, 741678}, ...}) = 0 <0.000032>
     0.000157 getrusage(RUSAGE_SELF, {ru_utime={521, 777677}, ru_stime={54, 741678}, ...}) = 0 <0.000027>
     0.000187 semtimedop(309952512, 0x7fff28087160, 1, {0, 640000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.640510>
     0.640646 semtimedop(309952512, 0x7fff28087160, 1, {0, 670000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.670902>
     0.671039 semtimedop(309952512, 0x7fff28087160, 1, {1, 320000000}) = -1 EAGAIN (Resource temporarily unavailable) <1.320895>
--//這裡也是 64,67,132
     1.321017 getrusage(RUSAGE_SELF, {ru_utime={521, 777677}, ru_stime={54, 741678}, ...}) = 0 <0.000028>
     0.000148 getrusage(RUSAGE_SELF, {ru_utime={521, 777677}, ru_stime={54, 741678}, ...}) = 0 <0.000026>
     0.000152 semtimedop(309952512, 0x7fff28087160, 1, {1, 310000000}) = -1 EAGAIN (Resource temporarily unavailable) <1.310542>
--//這裡也是 131 ,後面還有.
     1.310665 getrusage(RUSAGE_SELF, {ru_utime={521, 777677}, ru_stime={54, 741678}, ...}) = 0 <0.000028>
     0.000145 getrusage(RUSAGE_SELF, {ru_utime={521, 777677}, ru_stime={54, 741678}, ...}) = 0 <0.000027>
     0.000149 semtimedop(309952512, 0x7fff28087160, 1, {2, 600000000}) = -1 EAGAIN (Resource temporarily unavailable) <2.600601>
     2.600719 getrusage(RUSAGE_SELF, {ru_utime={521, 777677}, ru_stime={54, 741678}, ...}) = 0 <0.000028>
     0.000131 getrusage(RUSAGE_SELF, {ru_utime={521, 777677}, ru_stime={54, 741678}, ...}) = 0 <0.000027>
     0.000149 semtimedop(309952512, 0x7fff28087160, 1, {2, 710000000}) = -1 EAGAIN (Resource temporarily unavailable) <2.710794>
     2.710915 getrusage(RUSAGE_SELF, {ru_utime={521, 778677}, ru_stime={54, 741678}, ...}) = 0 <0.000029>
     0.000147 getrusage(RUSAGE_SELF, {ru_utime={521, 778677}, ru_stime={54, 741678}, ...}) = 0 <0.000025>
     0.000156 semtimedop(309952512, 0x7fff28087160, 1, {5, 280000000}) = -1 EAGAIN (Resource temporarily unavailable) <5.280287>
     5.280409 getrusage(RUSAGE_SELF, {ru_utime={521, 778677}, ru_stime={54, 741678}, ...}) = 0 <0.000028>
     0.000151 getrusage(RUSAGE_SELF, {ru_utime={521, 778677}, ru_stime={54, 741678}, ...}) = 0 <0.000026>
     0.000151 semtimedop(309952512, 0x7fff28087160, 1, {5, 270000000}) = -1 EAGAIN (Resource temporarily unavailable) <5.270622>
--//527cs
     5.270746 getrusage(RUSAGE_SELF, {ru_utime={521, 778677}, ru_stime={54, 741678}, ...}) = 0 <0.000032>
     0.000153 getrusage(RUSAGE_SELF, {ru_utime={521, 778677}, ru_stime={54, 741678}, ...}) = 0 <0.000026>
     0.000151 semtimedop(309952512, 0x7fff28087160, 1, {3, 0}) = -1 EAGAIN (Resource temporarily unavailable) <3.000675>
     3.000791 semtimedop(309952512, 0x7fff28087160, 1, {3, 0}) = -1 EAGAIN (Resource temporarily unavailable) <3.000792>
     3.000935 semtimedop(309952512, 0x7fff28087160, 1, {4, 0}) = -1 EAGAIN (Resource temporarily unavailable) <4.001177>
--//從這裡開始等10秒pin 255次.    
     4.001331 getrusage(RUSAGE_SELF, {ru_utime={521, 778677}, ru_stime={54, 741678}, ...}) = 0 <0.000027>
     0.000151 getrusage(RUSAGE_SELF, {ru_utime={521, 778677}, ru_stime={54, 741678}, ...}) = 0 <0.000025>
     0.000161 semtimedop(309952512, 0x7fff28087160, 1, {3, 0}) = -1 EAGAIN (Resource temporarily unavailable) <3.000379>
     3.000496 semtimedop(309952512, 0x7fff28087160, 1, {3, 0}) = -1 EAGAIN (Resource temporarily unavailable) <3.000744>
     3.000882 semtimedop(309952512, 0x7fff28087160, 1, {4, 0}) = -1 EAGAIN (Resource temporarily unavailable) <4.000976>
     4.001137 getrusage(RUSAGE_SELF, {ru_utime={521, 778677}, ru_stime={54, 741678}, ...}) = 0 <0.000029>
     0.000157 getrusage(RUSAGE_SELF, {ru_utime={521, 778677}, ru_stime={54, 741678}, ...}) = 0 <0.000025>
     0.000159 semtimedop(309952512, 0x7fff28087160, 1, {3, 0}) = -1 EAGAIN (Resource temporarily unavailable) <3.000474>
     3.000592 semtimedop(309952512, 0x7fff28087160, 1, {3, 0}) = -1 EAGAIN (Resource temporarily unavailable) <3.000800>
     3.000943 semtimedop(309952512, 0x7fff28087160, 1, {4, 0}) = -1 EAGAIN (Resource temporarily unavailable) <4.001361>
     4.001510 getrusage(RUSAGE_SELF, {ru_utime={521, 778677}, ru_stime={54, 741678}, ...}) = 0 <0.000029>
     0.000155 getrusage(RUSAGE_SELF, {ru_utime={521, 778677}, ru_stime={54, 741678}, ...}) = 0 <0.000027>
     0.000176 getrusage(RUSAGE_SELF, {ru_utime={521, 779677}, ru_stime={54, 741678}, ...}) = 0 <0.000028>
     0.000162 getrusage(RUSAGE_SELF, {ru_utime={521, 779677}, ru_stime={54, 741678}, ...}) = 0 <0.000023>
     0.000140 getrusage(RUSAGE_SELF, {ru_utime={521, 779677}, ru_stime={54, 741678}, ...}) = 0 <0.000022>


--//_mutex_wait_time=2的情況,不是很明顯,僅僅執行2次semtimedop sleep 0.01秒的情況.
65223      0.000106 getrusage(RUSAGE_SELF, {ru_utime={522, 312596}, ru_stime={54, 819666}, ...}) = 0 <0.000024>
65223      0.000140 getrusage(RUSAGE_SELF, {ru_utime={522, 312596}, ru_stime={54, 819666}, ...}) = 0 <0.000023>
65223      0.000237 semtimedop(309952512, 0x7fff28087160, 1, {0, 10000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.010283>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
65223      0.010404 semtimedop(309952512, 0x7fff28087160, 1, {0, 10000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.010921>
65223      0.011033 semtimedop(309952512, 0x7fff28087160, 1, {0, 20000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.020893>
65223      0.021011 semtimedop(309952512, 0x7fff28087160, 1, {0, 20000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.020881>
65223      0.020998 semtimedop(309952512, 0x7fff28087160, 1, {0, 20000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.020877>
65223      0.020993 semtimedop(309952512, 0x7fff28087160, 1, {0, 20000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.020885>
    
--//再來看看sleep記數:
$ sqlplus -s -l / as sysdba <<EOF
> $(seq 1000| xargs -I {} echo -e "@ mutexy 5 a31kd5tkdvvmm\nhost sleep 10\n")
> EOF

      HASH SUM_SLEEPS   SUM_GETS LOCATION                       MUTEX_TYPE           MUTEX_ADDR       SQLID         KGLNAOWN C100
---------- ---------- ---------- ------------------------------ -------------------- ---------------- ------------- -------- ---------------------------------------
1692266099  161166910  600017934 kksfbc [KKSCHLPIN1]            Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099    2263154 4.6431E+10 kksLockDelete [KKSCHLPIN6]     Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099    2183544 4.4733E+10 kksfbc [KKSCHLFSP2]            Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099          6   45955498 kksHeapReadUnlock [KKSCHLRDUP] Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10

      HASH SUM_SLEEPS   SUM_GETS LOCATION                       MUTEX_TYPE           MUTEX_ADDR       SQLID         KGLNAOWN C100
---------- ---------- ---------- ------------------------------ -------------------- ---------------- ------------- -------- ---------------------------------------
1692266099  161166942  600047254 kkslce [KKSCHLPIN2]            Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099    2263154 4.6431E+10 kksLockDelete [KKSCHLPIN6]     Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099    2183544 4.4733E+10 kksfbc [KKSCHLFSP2]            Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099          6   45955498 kksHeapReadUnlock [KKSCHLRDUP] Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10

      HASH SUM_SLEEPS   SUM_GETS LOCATION                       MUTEX_TYPE           MUTEX_ADDR       SQLID         KGLNAOWN C100
---------- ---------- ---------- ------------------------------ -------------------- ---------------- ------------- -------- ---------------------------------------
1692266099  161166948  600047254 kkslce [KKSCHLPIN2]            Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099    2263154 4.6431E+10 kksLockDelete [KKSCHLPIN6]     Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099    2183544 4.4733E+10 kksfbc [KKSCHLFSP2]            Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099          6   45955498 kksHeapReadUnlock [KKSCHLRDUP] Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10

      HASH SUM_SLEEPS   SUM_GETS LOCATION                       MUTEX_TYPE           MUTEX_ADDR       SQLID         KGLNAOWN C100
---------- ---------- ---------- ------------------------------ -------------------- ---------------- ------------- -------- ---------------------------------------
1692266099  161166952  600047254 kkslce [KKSCHLPIN2]            Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099    2263154 4.6431E+10 kksLockDelete [KKSCHLPIN6]     Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099    2183544 4.4733E+10 kksfbc [KKSCHLFSP2]            Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099          6   45955498 kksHeapReadUnlock [KKSCHLRDUP] Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10

      HASH SUM_SLEEPS   SUM_GETS LOCATION                       MUTEX_TYPE           MUTEX_ADDR       SQLID         KGLNAOWN C100
---------- ---------- ---------- ------------------------------ -------------------- ---------------- ------------- -------- ---------------------------------------
1692266099  161166954  600047254 kkslce [KKSCHLPIN2]            Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099    2263154 4.6431E+10 kksLockDelete [KKSCHLPIN6]     Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099    2183544 4.4733E+10 kksfbc [KKSCHLFSP2]            Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099          6   45955498 kksHeapReadUnlock [KKSCHLRDUP] Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10

      HASH SUM_SLEEPS   SUM_GETS LOCATION                       MUTEX_TYPE           MUTEX_ADDR       SQLID         KGLNAOWN C100
---------- ---------- ---------- ------------------------------ -------------------- ---------------- ------------- -------- ---------------------------------------
1692266099  161166956  600047254 kkslce [KKSCHLPIN2]            Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099    2263154 4.6431E+10 kksLockDelete [KKSCHLPIN6]     Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099    2183544 4.4733E+10 kksfbc [KKSCHLFSP2]            Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099          6   45955498 kksHeapReadUnlock [KKSCHLRDUP] Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10

      HASH SUM_SLEEPS   SUM_GETS LOCATION                       MUTEX_TYPE           MUTEX_ADDR       SQLID         KGLNAOWN C100
---------- ---------- ---------- ------------------------------ -------------------- ---------------- ------------- -------- ---------------------------------------
1692266099  161166958  600047254 kkslce [KKSCHLPIN2]            Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099    2263154 4.6431E+10 kksLockDelete [KKSCHLPIN6]     Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099    2183544 4.4733E+10 kksfbc [KKSCHLFSP2]            Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099          6   45955498 kksHeapReadUnlock [KKSCHLRDUP] Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10

--//sleep計數與getrusage調用有關,後面增加都是2次.


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 1.安裝DHCP伺服器角色,這樣在netsh下才會有dhcp上下文 2.編寫配置dhcp的腳本 從命令行運行netsh有兩種語法: 比如要獲取已經配置的網路介面列表 1.寫全 其中:-r RemoteComputerName 是指定要操作的遠程主機或本機的電腦名,interface ipv4 是n ...
  • shutdown shutdown 此命令用來安全關閉或重啟Linux系統,系統在關閉之前會通知所有的登錄用戶,系統即將關閉,此時所有新用戶都不可以登錄。 以下截取man手冊的內容(man shutdown): NAME shutdown - bring the system down SYNOPS ...
  • 從mysql資料庫中導出正常資料庫的腳本語句,而後使用腳本語句創建資料庫的過程中,執行語句提示Can't Create Table 'XXX' erro150的錯誤,語句執行中斷,創建table失敗,仔細分析相關語句發現導致此錯誤的原因為創建的外鍵和關聯的表的主鍵類型不匹配。 仔細查看被執行的語句, ...
  • snapshot其實就是一組metadata信息的集合,它可以讓管理員將表恢復到以前的一個狀態。snapshot並不是一份拷貝,它只是一個文件名的列表,並不拷貝數據。一個全的snapshot恢復以為著你可以回滾到原來的表schema和創建snapshot之前的數據。 應用場景: 1獲取:該操作嘗試從 ...
  • [20190402]Library Cache mutex.txt1.環境:SCOTT@book> @ ver1PORT_STRING VERSION BANNER x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Editi ...
  • 本篇文章並非原創,只是看到其中內容講的非常好,搬過來,還望海涵。 原文鏈接地址:http://wpceo.com/user-database-table-design/ 說起用戶表,大概是每個應用/網站立項動工(碼農們)考慮的第一件事情。用戶表結構的設計,算是整個後臺架構的基石。如果基石不穩,待到後 ...
  • 索引模板就是將已經創建好的某個索引參數設置(settings)和索引映射(mapping)保存下來作為模板, 在創建新索引時, 指定使用某個模板就可以直接使用已經定義好的設置和映射. ...
  • Numpy 基礎操作¶ 以numpy的基本數據例子來學習numpy基本數據處理方法 主要內容有: 創建數組 數組維度轉換 數據選區和切片 數組數據計算 隨機數 數據合併 數據統計計算 In [1]: import numpy as np 創建一維數組¶ In [2]: data = np.arang ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...