[20210305]Oracle Rolling Invalidate Window Exceeded(3).txt
[20210305]Oracle Rolling Invalidate Window Exceeded(3).txt
--//昨天看了連結
--//https://blog.dbi-services.com/oracle-rolling-invalidate-window-exceeded3/->Oracle Rolling Invalidate Window Exceeded(3)
--//自己重複測試看看:
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
2.建立測試指令碼:
create table DEMO as select * from dual;
alter system set "_optimizer_invalidation_period"=15 scope=memory;
exec dbms_stats.gather_table_stats(user,'DEMO');
--//建立指令碼aaa.txt,原作者是將它的執行指令碼執行後展開分析,感覺不是很好,應該是寫成指令碼,然後在加上後面的分析。
$ cat aaa.txt
alter system flush shared_pool;
alter system flush shared_pool;
column REASON format a100
set time on
set echo on
host sleep 30
select * from DEMO;
select child_number,reason from v$sql_shared_cursor where sql_id='0m8kbvzchkytt';
exec dbms_stats.gather_table_stats(user,'DEMO');
select * from dba_tab_stats_history where table_name='DEMO' order by stats_update_time;
host sleep 30
select * from DEMO;
select child_number,reason from v$sql_shared_cursor where sql_id='0m8kbvzchkytt';
exec dbms_stats.gather_table_stats(user,'DEMO');
select * from dba_tab_stats_history where table_name='DEMO' order by stats_update_time;
host sleep 30
select * from DEMO;
select child_number,reason from v$sql_shared_cursor where sql_id='0m8kbvzchkytt';
3.執行分析:
15:52:05 SCOTT@book> @ aaa.txt
15:52:07 SCOTT@book> alter system flush shared_pool;
System altered.
15:52:08 SCOTT@book> alter system flush shared_pool;
System altered.
15:52:08 SCOTT@book> column REASON format a100
15:52:08 SCOTT@book> set time on
15:52:08 SCOTT@book> set echo on
15:52:08 SCOTT@book> host sleep 30
15:52:38 SCOTT@book> select * from DEMO;
D
-
X
15:52:38 SCOTT@book> select child_number,reason from v$sql_shared_cursor where sql_id='0m8kbvzchkytt';
CHILD_NUMBER REASON
------------ ----------------------------------------------------------------------------------------------------
0
15:52:38 SCOTT@book> exec dbms_stats.gather_table_stats(user,'DEMO');
PL/SQL procedure successfully completed.
15:52:38 SCOTT@book> select * from dba_tab_stats_history where table_name='DEMO' order by stats_update_time;
OWNER TABLE_NAME PARTITION_NAME SUBPARTITION_NAME STATS_UPDATE_TIME
------ ---------- ------------------------------ ------------------------------ ---------------------------------
SCOTT DEMO 2021-03-05 15:52:05.089218 +08:00
SCOTT DEMO 2021-03-05 15:52:38.487667 +08:00
15:52:38 SCOTT@book> host sleep 30
15:53:08 SCOTT@book> select * from DEMO;
D
-
X
15:53:08 SCOTT@book> select child_number,reason from v$sql_shared_cursor where sql_id='0m8kbvzchkytt';
CHILD_NUMBER REASON
------------ ----------------------------------------------------------------------------------------------------
0
--//第2次執行分析過了30秒後執行並沒有產生新的子游標。
15:53:08 SCOTT@book> exec dbms_stats.gather_table_stats(user,'DEMO');
PL/SQL procedure successfully completed.
15:53:08 SCOTT@book> select * from dba_tab_stats_history where table_name='DEMO' order by stats_update_time;
OWNER TABLE_NAME PARTITION_NAME SUBPARTITION_NAME STATS_UPDATE_TIME
------ ---------- ------------------------------ ------------------------------ ---------------------------------
SCOTT DEMO 2021-03-05 15:52:05.089218 +08:00
SCOTT DEMO 2021-03-05 15:52:38.487667 +08:00
SCOTT DEMO 2021-03-05 15:53:08.652373 +08:00
15:53:08 SCOTT@book> host sleep 30
15:53:38 SCOTT@book> select * from DEMO;
D
-
X
15:53:38 SCOTT@book> select child_number,reason from v$sql_shared_cursor where sql_id='0m8kbvzchkytt';
CHILD_NUMBER REASON
------------ ----------------------------------------------------------------------------------------------------
0 <ChildNode><ChildNumber>0</ChildNumber><ID>34</ID><reason>Rolling Invalidate Window Exceeded(3)</rea
son><size>2x4</size><invalidation_window>1614930791</invalidation_window><ksugctm>1614930818</ksugct
m></ChildNode>
1
--//第3次執行分析過了30秒後執行併產生新的子游標。
SYS@book> @ share 0m8kbvzchkytt
old 15: and q.sql_id like ''&1''',
new 15: and q.sql_id like ''0m8kbvzchkytt''',
SQL_TEXT = select * from DEMO
SQL_ID = 0m8kbvzchkytt
ADDRESS = 000000007E3BF1E0
CHILD_ADDRESS = 000000007D2BDD70
CHILD_NUMBER = 0
REASON = <ChildNode><ChildNumber>0</ChildNumber><ID>34</ID><reason>Rolling Invalidate Window Exceeded(3)</reason><size>2x4</size><invalidation_window>1614930791</invalidation_window><ksugctm>1614930818</ksugctm></ChildNode>
--------------------------------------------------
SQL_TEXT = select * from DEMO
SQL_ID = 0m8kbvzchkytt
ADDRESS = 000000007E3BF1E0
CHILD_ADDRESS = 000000007D6EC738
CHILD_NUMBER = 1
ROLL_INVALID_MISMATCH = Y
REASON =
--------------------------------------------------
PL/SQL procedure successfully completed.
--//我開始看了很久不明白作者實驗的意圖,視乎作者想說的是第2次分析等30秒一定會建立新的子游標。
--//實際上即使第3次即使不分析過一定時間也會出現新的子游標。
--//修改如下:
$ cat aaa.txt
alter system flush shared_pool;
alter system flush shared_pool;
column REASON format a100
set time on
set echo on
--//host sleep 30
select * from DEMO;
select child_number,reason from v$sql_shared_cursor where sql_id='0m8kbvzchkytt';
exec dbms_stats.gather_table_stats(user,'DEMO');
select * from dba_tab_stats_history where table_name='DEMO' order by stats_update_time;
host sleep 30
select * from DEMO;
select child_number,reason from v$sql_shared_cursor where sql_id='0m8kbvzchkytt';
--//exec dbms_stats.gather_table_stats(user,'DEMO');
--//select * from dba_tab_stats_history where table_name='DEMO' order by stats_update_time;
--//
host sleep &&1
select * from DEMO;
select child_number,reason from v$sql_shared_cursor where sql_id='0m8kbvzchkytt';
--//執行如下:
16:25:43 SCOTT@book> @ aaa.txt 5
16:26:23 SCOTT@book> alter system flush shared_pool;
System altered.
16:26:23 SCOTT@book> alter system flush shared_pool;
System altered.
16:26:23 SCOTT@book> column REASON format a100
16:26:23 SCOTT@book> set time on
16:26:23 SCOTT@book> set echo on
16:26:23 SCOTT@book> --//host sleep 30
16:26:23 SCOTT@book> select * from DEMO;
D
-
X
16:26:23 SCOTT@book> select child_number,reason from v$sql_shared_cursor where sql_id='0m8kbvzchkytt';
CHILD_NUMBER REASON
------------ ----------------------------------------------------------------------------------------------------
0
16:26:23 SCOTT@book>
16:26:23 SCOTT@book> exec dbms_stats.gather_table_stats(user,'DEMO');
PL/SQL procedure successfully completed.
16:26:24 SCOTT@book> select * from dba_tab_stats_history where table_name='DEMO' order by stats_update_time;
OWNER TABLE_NAME PARTITION_NAME SUBPARTITION_NAME STATS_UPDATE_TIME
------ ---------- ------------------------------ ------------------------------ ---------------------------------
SCOTT DEMO 2021-03-05 15:52:05.089218 +08:00
SCOTT DEMO 2021-03-05 15:52:38.487667 +08:00
SCOTT DEMO 2021-03-05 15:53:08.652373 +08:00
SCOTT DEMO 2021-03-05 16:08:35.590503 +08:00
SCOTT DEMO 2021-03-05 16:17:11.290579 +08:00
SCOTT DEMO 2021-03-05 16:19:52.977908 +08:00
SCOTT DEMO 2021-03-05 16:21:23.084524 +08:00
SCOTT DEMO 2021-03-05 16:25:12.445233 +08:00
SCOTT DEMO 2021-03-05 16:26:23.971873 +08:00
9 rows selected.
16:26:24 SCOTT@book>
16:26:24 SCOTT@book> host sleep 30
16:26:54 SCOTT@book> select * from DEMO;
D
-
X
16:26:54 SCOTT@book> select child_number,reason from v$sql_shared_cursor where sql_id='0m8kbvzchkytt';
CHILD_NUMBER REASON
------------ ----------------------------------------------------------------------------------------------------
0
16:26:54 SCOTT@book>
16:26:54 SCOTT@book> --//exec dbms_stats.gather_table_stats(user,'DEMO');
16:26:54 SCOTT@book> --//select * from dba_tab_stats_history where table_name='DEMO' order by stats_update_time;
16:26:54 SCOTT@book> --//
16:26:54 SCOTT@book> host sleep &&1
16:26:59 SCOTT@book> select * from DEMO;
D
-
X
16:26:59 SCOTT@book> select child_number,reason from v$sql_shared_cursor where sql_id='0m8kbvzchkytt';
CHILD_NUMBER REASON
------------ ----------------------------------------------------------------------------------------------------
0 <ChildNode><ChildNumber>0</ChildNumber><ID>34</ID><reason>Rolling Invalidate Window Exceeded(3)</rea
son><size>2x4</size><invalidation_window>1614932817</invalidation_window><ksugctm>1614932818</ksugct
m></ChildNode>
1
--//注:我嘗試了引數1,2,3,4都沒有出現新的子游標,設定5秒後出現,感覺這個時間間隔不確定。
--//正常15秒一定出現。
--//實際上這樣的情況主要每天都分析的表,最容易出現這樣的情況。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2761429/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20181220]ORA-1000 "maximum open cursors exceeded".txt
- [20191129]oracle Audit檔案管理3.txtOracle
- [20210126]探究oracle記憶體分配3.txtOracle記憶體
- Android中invalidateAndroid
- [20220303]oracle如何定位使用library cache mutex 3.txtOracleMutex
- kali Rolling終端bug
- 安卓invalidate()、postInvalidate()、req安卓
- [20220321]探究oracle sequence.txtOracle
- [20191217]Oracle C functions annotations.txtOracleFunction
- [20201110]oracle建立索引nosrt.txtOracle索引
- [20190530]oracle Audit檔案管理.txtOracle
- [20240618]Oracle C functions annotations.txtOracleFunction
- [20220322]探究oracle sequence 2.txtOracle
- ORA-15137: The ASM cluster is in rolling patch stateASM
- oracle 3Oracle
- java呼叫window本地應用程式;讀取TXT型別檔案Java型別
- [20181220]Bushy Join Trees in Oracle 12.2.txtOracle
- [20230508]crack oracle執行檔案.txtOracle
- [20190917]oracle引數deferred屬性.txtOracle
- [20191112]oracle共享連線模式埠.txtOracle模式
- [20241016]Oracle C functions annotations補充.txtOracleFunction
- [20210126]探究oracle記憶體分配.txtOracle記憶體
- Lock wait timeout exceeded; try restarting transactionAIREST
- cache操作:clean、invalidate與flush的含義
- [20181007]Scalable sequences oracle database 12c.txtOracleDatabase
- [20230908]Oracle Index Range Scan with LIKE Condition on Wildcard '_'.txtOracleIndex
- [20191128]oracle Audit檔案管理2.txtOracle
- [20220128]Check the datapump file header information in Oracle.txtHeaderORMOracle
- [20211110]oracle數字編碼30.txtOracle
- OPATCHAUTO-72141: Grid patching cannot be performed in rolling mode on single noORM
- SQLSERVER匯出TXT文字檔案,ORACLE SQL LOADER匯入TXT文字檔案SQLServerOracle
- Sybase IQ 錯誤 : Temporary space limit exceededMIT
- 一次OutOfMemoryError: GC overhead limit exceededErrorGCMIT
- Android自定義View之requestLayout方法和invalidate方法AndroidView
- Android自定義View之invalidate方法和postInvalidate方法AndroidView
- [20190410]Oracle RushQL勒索病毒簡單防範.txtOracle
- [20181018]Oracle Database 12c: Data Redaction.txtOracleDatabase
- [20181112]Private Temporary Tables Oracle Database 18C.txtOracleDatabase