statspackさわる - kagamihogeの日記ã§statspackãèªåã®ç°å¢ã§æ軽ã«è©¦ããããã«ãªã£ãããªã®ã§ãç·´ç¿ãã¦ãåãããããããããªã¨å·®ãåºãã¬ãã¼ããåå¾ãã¦çºãã¦ã¿ãã
ãããã¨ã¯ã10ä¸åinsertãå®è¡ããJavaã®ããã°ã©ã ã2種é¡ç¨æããã1ã¤ã¯ã1åãã¨ã«commitããããã1ã¤ã¯ã1åã ãæå¾ã«commitããããã®2ã¤ã®éã§statspackã®ã¬ãã¼ãã«ã©ããªå·®ãåºããã確èªããã
ç°å¢
ãã¼ãã«ã¨ããã°ã©ã æºå
ãã¼ã¿ãå ¥ãã¦ãããã¼ãã«ãä½ãã
DROP TABLE hoge_table PURGE; ALTER SYSTEM SWITCH LOGFILE; CREATE TABLE hoge_table ( ID INTEGER NOT NULL , VALUE VARCHAR2(10) NOT NULL , CONSTRAINT hoge_table_pk PRIMARY KEY ( ID ) ENABLE );
ããã°ã©ã ãå®è¡ããåã«ãä¸è¨ã®SQLå®è¡ã¨Oracleåèµ·åãããããã°ã¹ã¤ããã¯ãã¹ã¤ããã®åæ°ã«å¤åãçããããè¦ãããã«ãã¦ããã
ALTER SYSTEM FLUSH BUFFER_CACHE; ALTER SYSTEM SWITCH LOGFILE;
insertã1åãã¨ã«1åcommitããJavaã®ããã°ã©ã ãç¨æããã
public static void main(String[] args) throws SQLException { long start = System.currentTimeMillis(); final String insertStr = "INSERT INTO hoge_table(ID, VALUE) VALUES(?, dbms_random.string('X', 10))"; try (Connection connection = DriverManager.getConnection( "jdbc:oracle:thin:@192.168.0.20:1521:XE", "kagamihoge", "a"); PreparedStatement sql = connection.prepareStatement(insertStr);) { connection.setAutoCommit(false); for (int i=0; i<100_000; i++) { sql.setInt(1, i); sql.executeUpdate(); connection.commit(); } } long end = System.currentTimeMillis(); System.out.println(end - start); }
ä¸ã®ã³ã¼ããã¡ãã£ã¨å¤æ´ãã¦ã1åã ãæå¾ã«commitããããã°ã©ã ãç¨æããã
for (int i=0; i<100_000; i++) { sql.setInt(1, i); sql.executeUpdate(); } connection.commit();
ã¾ãå®è¡æéã®æ¯è¼ã
ç¨®é¡ | 1 | 2 |
---|---|---|
1åã㨠| 1152953 | 1135906 |
1åã ã | 49110 | 48859 |
ããã¾ã§ã¯10万件INSERTを1件ずつコミットと1回だけコミットしたときの速度比較してみた - kagamihogeの日記ã¨ãã£ããã¨åããJDBC経由で100万件取得・追加してみた - kagamihogeの日記ã®java.sql.Statement#addBatch(String sql)ã§ã©ã¦ã³ãããªããæ¸ããã°æ´ã«éããªããã¾ããåç´ãªãã¼ã¿ãã¼ããªããã¤ã¬ã¯ããã¹ãã¼ãã§SQL*Loaderã使ãã°è¯ãã
statspackã¬ãã¼ãã®æ¯è¼
Top 5 Timed Events
statspackã¬ãã¼ãã®ã¬ãã¼ããè¦ãã¨ãã¯ãã¾ããã®ã»ã¯ã·ã§ã³ããè¦ããããããªããç¹ã«æããç¡ããã°ãå ã1åãã¨ãå¾ã1åã ããã®ã¬ãã¼ãã¨ããã
Top 5 Timed Events Avg %Total ~~~~~~~~~~~~~~~~~~ wait Call Event Waits Time (s) (ms) Time ----------------------------------------- ------------ ----------- ------ ------ log file sync 100,026 1,034 10 49.2 log file parallel write 100,052 1,025 10 48.8 CPU time 24 1.1 db file async I/O submit 122 8 62 .4 control file parallel write 424 7 16 .3 -------------------------------------------------------------
Top 5 Timed Events Avg %Total ~~~~~~~~~~~~~~~~~~ wait Call Event Waits Time (s) (ms) Time ----------------------------------------- ------------ ----------- ------ ------ CPU time 6 47.0 log file parallel write 54 3 54 24.3 db file async I/O submit 5 2 379 15.9 control file parallel write 39 1 21 7.0 db file sequential read 373 0 0 1.5 -------------------------------------------------------------
1åãã¨ãé ãçç±ã¯ãããã§ã»ã¼èª¬æãåºæ¥ããã¾ãã1åãã¨ã®log file syncã¨log file parallel writeãçªåºãã¦ãããã1åã ãã®æ¹ã¯æ¥µã å°ããå¤ã«ãªã£ã¦ããããã®2ã¤ã®ã¤ãã³ãã§å¾ ãããã¦ããããé ããã¨ãããã¨ãåãããã§ã¯ããã®2ã¤ã®å¾ æ©ã¤ãã³ãã¨ã¯ä½è ãªã®ããã¨ãããã¨ã«ãªãã
log file parallel write
LGWRããã»ã¹ãã«ã¬ã³ããã°ãã¡ã¤ã«ã«æ¸è¾¼ãã§ããæã®å¾ æ©ã§ããlog file sync
ã³ããããªã©ã®ãã©ã³ã¶ã¯ã·ã§ã³ç¢ºå®æã®REDOãã°ãã¡ã¤ã«æ¸è¾¼ã¿å¾ ã¡ã§ãï¼ãlog file parallel writeãã¯LGWRããã»ã¹ã®å¾ ã¡ã§ãããããã¯ãµã¼ãã¼ããã»ã¹ã®å¾ ã¡ã§ãï¼ãããã¯å¿ ãçºçããå¾ æ©ã¤ãã³ãã§ããREDOã®æ¸è¾¼ã¿ã¯æ´åæ§ã®ããåæã§è¡ãã¾ãï¼å¿ ãæ¸è¾¼ã¿çµäºã¾ã§å¾ ã¡ã¾ãï¼ã®ã§ããã®æ¸è¾¼ã¿æéã¯å¤ããå°ãªããå¿ ãå¾ ã¡ã¨ãã¦çºçãã訳ã§ãã
è¦ããã«ãã³ãããããã¨ãã£ã¹ã¯æ¸ãè¾¼ã¿ãçºçãã*1ãããã®æ¸ãè¾¼ã¿ã¯REDOãã°æ´åæ§ç¢ºä¿ã®ããæ¸ãè¾¼ã¿çµäºã¾ã§å¾ ããªãã¦ã¯ãªããªããå³å¯ã«è¨ãã¨ä¸æ£ç¢ºãªæ¸ãæ¹ã§ã¯ããã®ã ãã©ããã®ã¨ã³ããªå ã§ã¯ããã ãã®ç解ã§ã²ã¨ã¾ãå åã
1åãã¨ã³ãããã®å ´åã®åä½ã¯ãinsertãã©ã¹commitãããã¨REDOãã°ãã¡ã¤ã«æ¸è¾¼ã¿ã«å ¥ããããã¦ãæ¸ãè¾¼ã¿ãçµããåã«æ¬¡ã®insertãã©ã¹commitãæ¥ãã®ã§å¾ æ©ãä½åãªããããï¼ã¨æãï¼ããããä¸åã®REODãã°ãµã¤ãºãå°ããï¼inser*1+commit*1ã ãï¼ã¨ã¯ãããã¡ã¢ãªä¸ã®ãã°ãããã¡ã«è¿½å ããã»ããä½ç¨æ©ãããã§ãããã§å¾ æ©ãããã¨ã«ãªããHDDã®ã¢ã¯ã»ã¹ã©ã³ããè¦ã¦ããã¨ã1åãã¨ã¯ç¹ç¯ãã£æ¾ãã«ãªãããããã1åã ãã®ã»ãã¯ã»ã¨ãã©ã©ã³ãã¯ç¹ç¯ããªãããã®å·®ãå¾ æ©ã¤ãã³ãã®æ°åã§èª¬æãä»ãã
REDOãã°ãã¡ã¤ã«ã¸ã®æ¸ãè¾¼ã¿ã¯ãOracleããã©ã³ã¶ã¯ã·ã§ã³ããã°æ³ã§å®ç¾ãã¦ãã以ä¸é¿ããããç¡ããã¨ãããæã£ã¦å½ããåãªã®ã§ãlog file syncãlog file parallel writeã®å¾ æ©ã¤ãã³ããããç¨åº¦åºã¦ããã®ã¯èªç¶ãªãã¨ã§ããã
ãã¨ãã£ã¦ãé »ç¹ã«ãã£ã¹ã¯æ¸ãè¾¼ã¿ããã£ã¦ã¯æ§è½ã¯ä¸ãããªãããã®ããã®å¯¾çã®1ã¤ããã°ãããã¡ã¨ãªããã¡ã¢ãªä¸ã«REDOãã°ãé©å½ã«æºãè¾¼ãã§ãã£ã¦ãé©å½ãªã¿ã¤ãã³ã°ã§ãã£ã¹ã¯ã«ã¾ã¨ãã¦æ¸ãè¾¼ããã¨ã§ãã£ã¹ã¯æ¸ãè¾¼ã¿ã«ããå¾ æ©ãæ¸ãããã¨ãç®çã¨ãªããã¾ããLGWRãREDOãã°ãæ¸ãè¾¼ãã¿ã¤ãã³ã°ã«ã¤ãã¦ãä¸æçã«ããã¡ã¢ãªã«ç½®ããã¨ã¯åªå¤±ã®å±éºãããã®ã§ãæ§è½ã¨ã®ãã©ã³ã¹ãè¦ã¦è²ããªã¿ã¤ãã³ã°ã§æ¸ãè¾¼ãããã«ãªã£ã¦ãããã¨æãããã
LGWRã¯ã以ä¸ã®ã¿ã¤ãã³ã°ã§REDOãã¼ã¿ãREDOãã°ãã¡ã¤ã«ã«æ¸ãè¾¼ã¿ã¾ãã
ã»ãã©ã³ã¶ã¯ã·ã§ã³ãã³ããããããã¨ã
ã»DBWnãREDOãã¼ã¿ã®æ¸ãè¾¼ã¿ãè¦æ±ããã¨ãï¼æ´æ°æ¸ã¿ãããã¯ã®ãã¼ã¿ãã¡ã¤ã«ã¸ã®æ¸ãè¾¼ã¿æãªã©ï¼
ã»3ç§ãã¨ã®ã¿ã¤ã ã¢ã¦ããçºçããã¨ã
ã»REDOãã°ãããã¡ã®å®¹éãä¸è¶³ããã¨ã
ã»æªæ¸ãè¾¼ã¿REDOãã¼ã¿ãREDOãã°ãããã¡å ¨ä½ã®3åã®1ã«éããã¨ãããã¨ãã¦ã®Oracleã¢ã¼ããã¯ãã£å ¥é Oracleç¾å ´ä¸»ç¾© CHAPTER 04 REDOãã°ãã¡ã¤ã«ã¨REDOãã¼ã¿ - REDOãã°ãããã¡ã¨LGWR p.52
ããã§éè¦ãªã®ã¯ãï¼LGWRã¯ï¼ãã©ã³ã¶ã¯ã·ã§ã³ãã³ããããããã¨ãREDOãã°ãããã¡ããã¡ã¤ã«ã«æ¸ãè¾¼ããã¨ããç¹ã1åãã¨ã«commitãã¦ããã¨ããã°ãããã¡ã«è²¯ã¾ãã¾ã§ããªãå³å¹ã§ãã£ã¹ã¯ã«ããããã¨æ¸ãåºããã¦ãããå°éãã¤é«é »åº¦ã§ãã£ã¹ã¯æ¸ãè¾¼ã¿ãçºçãã¦ãããã¨ãè¨ãããJavaããã°ã©ã ä¸ã§ã¯1ã«ã¼ããã¨ãªã®ã§10ä¸åï¼Waitsï¼ãããçºçããã対ãã¦1åã ãã®å ´åããã©ã³ã¶ã¯ã·ã§ã³ãã³ããããããã¨ãã®æ¸ãè¾¼ã¿ã¯1åã ãã¨ãªããstatspackä¸ã1åãã¨ã¯Waitsã100,026ã«ãªã£ã¦ããæã«ç¾ãã¦ããã
ã¡ãªã¿ã«ãlog file syncãlog file parallel writeãtop 5ã«åºã¦ããã®ã¯ãããã£ã¦ãã¨å²ã¨ãããããããªäºä¾ãªããã§ãããäºä¾ç´¹ä»ã¨ãã¦ããããããããç³»ã®ããã°ã©ã ã§é »ç¹ã«ã³ãããããéãã¦ãã¨ãããªããã¨ãã£ãæãã§ç´¹ä»ããã¦ããã¨ãå¤ãããã®ã¨ã³ããªã§ã¯ããªããããªãããã«ã³ã¿ã³ãªJavaã®ã³ã¼ããæ¸ãã¦statspackã®ã¬ãã¼ããåããã¨ã§ãç解ãæ·±ããããã
Load Profile
ã¬ãã¼ã対象æéä¸ã®1ç§å½ããããã©ã³ã¶ã¯ã·ã§ã³å½ããã®çµ±è¨æ å ±ãèªåãéè¦ã ã¨æããé¨å以å¤ã¯å²æã
Load Profile Per Second Per Transaction Per Exec Per Call ~~~~~~~~~~~~ ------------------ ----------------- ----------- ----------- Redo size: 70,615.9 845.9 Logical reads: 527.6 6.3 Block changes: 508.8 6.1 User calls: 167.0 2.0 Executes: 88.2 1.1 Transactions: 83.5
Load Profile Per Second Per Transaction Per Exec Per Call ~~~~~~~~~~~~ ------------------ ----------------- ----------- ----------- Redo size: 620,607.8 26,375,832.0 Logical reads: 3,774.8 160,429.5 Block changes: 4,808.1 204,342.0 User calls: 1,176.6 50,006.5 Executes: 1,206.4 51,273.5
ããã¯çµ¶å¯¾å¤ã«ã¯ã¢ã³ããªæå³ããªãããã®ç°å¢ä¸ã§ã®ç¸å¯¾è©ä¾¡ããã¦æå³ãåºã¦ãããããã§ã¯1åãã¨ã»1åã ãã§ç¸å¯¾è©ä¾¡ãããã¨ã«ãªããæ¯è¼ãã¦ã¿ãã¨ã1åã ãã®æ¹ãããå¤ãã®REDOããå¦çãããããªãã¦ãããã¨ãåãããããã¯ä½æ ãã¨ããã°ã1åãã¨ã¯å¾ æ©ããã¾ãã£ã¦ä»ã®å¦çãåºæ¥ãªãã£ããããã¨ãããã¨ã«ãªãã
Statistic
èªåãéè¦ã ã¨æããé¨å以å¤ã¯å²æã
Statistic Time (s) % DB time ----------------------------------- -------------------- --------- DB CPU 65.9 6.1 sql execute elapsed time 28.1 2.6 DB time 1,085.6 background elapsed time 1,056.3 background cpu time 23.4
Statistic Time (s) % DB time ----------------------------------- -------------------- --------- DB CPU 32.5 99.1 sql execute elapsed time 20.4 62.3 DB time 32.8 background elapsed time 6.4 background cpu time 0.5
1åãã¨ã¯ãããã¯ã°ã©ã¦ã³ãå®è¡æéï¼background elapsed timeï¼ãå端ç¡ãå¤ããããã¯æãããä¸è¿°ã®éãLGWRã®å¾ æ©ã¤ãã³ãã ã¨èããããã
ä¸ã®æ¹ã«æ¸ãããã³ãããæã«ç¾ããå¾ æ©ã¤ãã³ãã¯å¤§å¥ãã¦2ã¤ãããlog file parallel writeã¯LGWRããã»ã¹ã§ãlog file syncã¯ãµã¼ãããã»ã¹ã®å¾ æ©ã§ãããããã¯ã¡ãã£ã¨æ³åã«ãªã£ã¦ãã¾ãã®ã ããã¢ããªã±ã¼ã·ã§ã³ã®ããã°ã©ãããè¦ãã¨ããã¯ã°ã©ã¦ã³ãããã»ã¹ã®å¾ æ©ã¯åºæ¬çã«ã¯ä¸å¯è¦ã§ãããç´æ¥çã«è¦ããã®ã¯ãµã¼ãããã»ã¹ã®å¾ æ©ã®ã¿ã§ããããªã®ã§ãè£å´ã§ä½ããèµ·ãã¦ããã¨ãã¦ãæ°ä»ãã®ã¯é£ãã*2ããã£ã¦ããã®ã¨ã³ããªã®ä¾ã®å ´åãJavaã®ã³ã¼ãã ããè¦ã¦ããã¨ããªããç¥ãããã³ããããé ããã¨ãªãã®ã§ã¯ãªããããã
ä»ã®ãµã¼ãããã»ã¹ãããç°å¢ä¸ã§é »ç¹ãªã³ããããç¹°ãè¿ãã°ããã®ã¨ã³ããªã®ä¾ã¨ã¯æ¯è¼ã«ãªããªãã»ã©å¾ æ©ãé »çºãã¦ã³ãããå¦çã¯é ããªãããºã§ãããèªåèªèº«ã§log file syncã大éã«å¼ãèµ·ããããä»ã®ããã»ã¹ã®log file parallel writeã§å¾ æ©ãããããããã§è¯ããã¨ãç¡ãããã®è¾ºã«ã¤ãã¦ã¯å¾ã§æ¹ãã¦è§¦ãããã
Event
Avg %Total %Tim Total Wait wait Waits Call Event Waits out Time (s) (ms) /txn Time ---------------------------- ------------ ---- ---------- ------ -------- ------ log file sync 100,025 0 1,034 10 1.0 49.2 db file sequential read 708 0 2 3 0.0 .1 log file switch completion 2 0 0 112 0.0 .0 db file scattered read 8 0 0 4 0.0 .0 resmgr:cpu quantum 1 0 0 7 0.0 .0 control file sequential read 209 0 0 0 0.0 .0 Disk file operations I/O 10 0 0 0 0.0 .0 SQL*Net message from client 200,004 0 1,249 6 2.0 jobq slave wait 601 100 301 501 0.0 SQL*Net message to client 200,004 0 1 0 2.0 -------------------------------------------------------------
Avg %Total %Tim Total Wait wait Waits Call Event Waits out Time (s) (ms) /txn Time ---------------------------- ------------ ---- ---------- ------ -------- ------ db file sequential read 368 0 0 0 184.0 1.5 log buffer space 1 0 0 175 0.5 1.5 log file switch completion 1 0 0 134 0.5 1.1 log file sync 3 0 0 24 1.5 .6 db file scattered read 19 0 0 2 9.5 .3 control file sequential read 173 0 0 0 86.5 .0 SQL*Net message from client 100,005 0 104 1 ######## SQL*Net message to client 100,005 0 0 0 ######## -------------------------------------------------------------
ãã®ã»ã¯ã·ã§ã³ã§èå³æ·±ãã®ã¯SQL*Net message from clientã®ã¨ãããWait Timeã1,249ãªã®ã¯å®éã«ã¯log file syncã«ãããã®ãªã®ã§è¯ãã¨ãã¦ãWaitsã20ä¸ã«ãªã£ã¦ããããã®æ°å¤ã¯ãã¢ããªããOracleã«å¯¾ãã¦20ä¸åSQLãªã©ã®å½ä»¤è¦æ±ããã£ããã¨ã示ãã¦ããã1åãã¨ã§ã¯ãinsert + commitã®2 * 10ä¸ã§20ä¸ã¨æãããã1åã ãã®ã»ãã¯10ä¸ã§ããããã®ä¾ã®å ´åã¯åæ°ã¯å¤§ãã¦åé¡ã«ãªã£ã¦ããªãã¨æãããã
ããããJDBCã®ãããæ´æ°ã§ãã®é¨åã®æ¹åãããã¨æ´ã«é«éåãããã³ã¼ãä¾ã¯çç¥*3ããããããããµã¤ãºã100ã«ããã¨ããã®ä¾ã®å ´åSQL*Net message from clientã1,000ãããã«ãªãã100 * 1000ã§10ä¸ãOracleã¨ã®éä¿¡åæ°ãæ¸ãããã¨ã§æ§è½ã¢ãããè¦è¾¼ããçç±ã¯ããã®ãããã®æ°å¤ã¨ãªã£ã¦ç¾ããã
Statistic
ãã®ã»ã¯ã·ã§ã³ã¯åçµ±è¨æ å ±ã®é ç®ãã©ãã ããã£ããã示ãã¦ãããçµéæéãã¨ãçµéãã©ã³ã¶ã¯ã·ã§ã³ãã¨ãªã®ã§ããããç¸å¯¾å¤ã§æ¯è¼ãã¦æå³ãåºã¦ããããã ããã®ã¨ã³ããªã®ä¾ã®å ´åã1åãã¨ã®æ¹ãçµéæéãããªãé·ãã®ã§ããã®åã ãç¸å¯¾çã«æ°åã大ãããªãã
Statistic Total per Second per Trans --------------------------------- ------------------ -------------- ------------ CPU used by this session 2,394 2.0 0.0 CPU used when call started 2,317 1.9 0.0 IMU Redo allocation size 366,804 306.2 3.7 IMU commits 99,084 82.7 1.0 IMU undo allocation size 106,608,112 88,988.4 1,066.0 db block changes 609,566 508.8 6.1 redo size 84,597,804 70,615.9 845.9 redo synch time (usec) 1,035,021,368 863,957.7 10,349.6 session pga memory max 21,709,712 18,121.6 217.1 session uga memory max 25,763,832 21,505.7 257.6
Statistic Total per Second per Trans --------------------------------- ------------------ -------------- ------------ CPU used by this session 560 6.6 280.0 CPU used when call started 604 7.1 302.0 IMU Redo allocation size 10,056 118.3 5,028.0 IMU commits 0 0.0 0.0 IMU undo allocation size 5,152 60.6 2,576.0 db block changes 408,684 4,808.1 204,342.0 redo size 52,751,664 620,607.8 ############ redo synch time (usec) 71,869 845.5 35,934.5 session pga memory max 9,044,016 106,400.2 4,522,008.0 session uga memory max 8,897,248 104,673.5 4,448,624.0
ããã§ç®ãå¼ãã®ã¯redo sizeã®é ç®ã1åãã¨ã®Totalã¯ç´84Mã1åã ãã¯ç´52Mã«ãªã£ã¦ããããã®å·®ã¯ãã³ãããããã¨ããæ å ±ãREDOãã°ã«æ¸ãè¾¼ã¾ãããããã¨èããããããªã®ã§REDOãã°ã«ã¯ insert,commit,insert,commit...ã¨ããæ§é ã«ãªã£ã¦ããããºã§ããã1åã ãã®å ´åã¯ãinsert,insert,insert,...,commitã¨ããæ§é ã«ãªãã®ã§ããµã¤ãºã¯æ¸ãã
ã¨ããããã§ã試ãã«ã³ãããã ããç¹°ãè¿ãããã°ã©ã ãå®è¡ãã¦ã¿ãã
connection.setAutoCommit(false); for (int i=0; i<100_000; i++) { connection.commit(); }
ãã®ããã°ã©ã ãå®è¡ãããã¨statspackã®ã¬ãã¼ããåãã¨redo sizeã¯ã¬ã³å¢ãããããªã®ã§ã追å æ´æ°åé¤ãä½ãç¡ãã¦ããã³ããããããã¨ãã ããã ãã§Oracleã«è² è·ãããããã¨ã«ãªãã*4ãã ãå
ã«ãæ¸ããéãã³ãããã¯Oracleã«ç¡ãã¦ã¯ãªããªãå¦çã§ããããªã®ã§ãä½ãã³ããããã¹ãåä½ãªã®ãã»ãã©ã³ã¶ã¯ã·ã§ã³ã¯ã©ãããã©ãã¾ã§ãªã®ãããèããå¿
è¦ãåºã¦ãããããã¯å¾ã§èãããã
ãã¨ãCPU used by this sessionãsession pga|uga memory maxã1åã ãã®ã»ããå°ãªãã¨ã³ã§ããã
Statistic - log switches
Statistic Total per Hour --------------------------------- ------------------ --------- log switches (derived) 2 6.01
Statistic Total per Hour --------------------------------- ------------------ --------- log switches (derived) 1 42.35
ãã°ã¹ã¤ããã®åæ°ã¯ã1åãã¨ã2åã ãã1åã ãã¯1åã§æ¸ãã§ãããã©ã¡ãã®ããã°ã©ã ãçµæã¨ãã¦10ä¸ä»¶ã¬ã³ã¼ãã追å ããããã¨ã«ã¯å¤ãããªãããOracleã®å é¨çã«ã¯ã ãã¶ç°ãªãçµæã¨ãªã£ã¦ããã®ã伺ããããªãJDBCã®ãããæ´æ°ãå©ç¨ããã¨0åã¨ãªã£ããredo sizeãå°ãããªãã®ã ããå½ç¶ã¨ããã°å½ç¶ãªã®ã ãã©ã
ææ³ã¨ããã©è£
ä½ããã©ã³ã¶ã¯ã·ã§ã³ãªã®ã
Oracleã«ãããã³ãããã¯ãä½ãæ´æ°ãããã®ããªãã¦ãè² è·ã®ãããå¦çãã¨ãããã¨ãã¬ãã¼ãã示ããªããæ¸ãããã¾ãããã©ã³ã¶ã¯ã·ã§ã³ãå®ç¾ããããã«ã³ãããã¯å¿ è¦ä¸å¯æ¬ ã§ããããªã®ã§ãé©å½ãªåä½ã§ã³ãããããããã¨ãéçºè ã«ã¯è¦æ±ããããã§ã¾ããé©å½ãªåä½ã¨ã¯ä¸ä½ä½ãªãã ãã¨ãããã¨ã«ãªãã
ããããå ã¯ãã¾ã 俺èªèº«ãã©ã³ã¶ã¯ã·ã§ã³ã®ç解ãæµ ããã¨ããããææ³ãããã¯ãã©è£ãªã®ã ãã©ã
ã¾ãããã©ã³ã¶ã¯ã·ã§ã³ãè«çã¬ãã«ã®åä½ã¨ãã¦è¡¨ç¾ããªããã°ãããªããã®ã¯ä½ããã¨ãããã¨ã«ãªããè«çã¬ãã«ã¨ããã®ã¯ããã¸ãã¹ã¨ãæ¥åã¨ãã®åä½ã®ãã¨ããã©ã³ã¶ã¯ã·ã§ã³ã®ä¾ã§åºã¦ããéè¡å£åº§ã®ã¢ã¬ã¨ãããããã®ããã¸ãã¹ä¸ã§ããããããã¾ã§ãå解ä¸å¯è½ãªä¸åä½ã ãã¨ãã代ç©ããè«çã¬ãã«ã®ãã©ã³ã¶ã¯ã·ã§ã³ã®ä¸åä½ã«ç¸å½ãããã¨èãããããã§ã¾ãããªã³ã©ã¤ã³ã ã¨æ³¨æã¨ããããã ã¨æ®é«ç¹°è¶ã ã¨ããåºæ¬çã«ã¯å¢çãããããªãã¦ããã¢ã³ã§ããã
è«çã¬ãã«ã§ã®ãã©ã³ã¶ã¯ã·ã§ã³ã¯åºæ¬çã«ã¯ããããªãã¦ããã®ã ãã©ãå¿ ãããããããªããã¨ã¯éããªããä¼è¨ã¿ããã«ã«ã¼ã«ã決ã¾ã£ã¦ãã®ã¨ããã客ããã®æ³¨æã¿ããã«éã絡ãããå¿ ç¶çã«æ±ºã¾ãã®ã¯è¯ããä¾ãã°ãã®ã¨ã³ããªã®ä¾ã®ããã«ãã¼ã¿çªã£è¾¼ãã ãã®ãããã¨ãã¯ãè«çã¬ãã«ã»ãã¸ãã¹ä¸ã®ä¸åä½ã¯ä½ãªãã ãããï¼ãã¨ä¿ºã¯çåã«æããã¾ããã®å ´åãä¸ä»¶ã ãããå ¨ä»¶ã ãããããã¼ã¿ãæã£ã¦ããããã°ãã¯ã¯æºè¶³ãããã ãã¨ããã®ãå®éã®ã¨ãããªãã ãããã©ã
ãã¸ãã¹çã¨ããããã·ã¹ãã çã«å®æ½ããªããã°ãªããªãå¦çã¨ãããã®ä¼ç¤¾åºæã®æ¥åå¦çã§ä½ãä¸åä½ãªã®ãã¤ãã¤ãä¸æãªå¦çã¨ãã¯ãã©ãããã©ãã¾ã§ããã©ã³ã¶ã¯ã·ã§ã³ã¨æããã¹ããªã®ãããã®è¾ºã¯ããããåå¼·ããªãã¨ããããªã¼ã¨æãã
ãã¡ãããç©çã¬ãã«ã®å¶ç´ãèæ ®ããªããã°ãªããªãããããUNDOã»ã°ã¡ã³ããèªåæ¡å¼µããããã£ã¦ãé åä¸è¶³ã«ãªããããªå¤§ãããããã©ã³ã¶ã¯ã·ã§ã³ã¯å®ç¾ä¸å¯è½ã§ããããã®ã¨ã³ããªã®ä¾ã§è¨ãã°ã1件ãã¤ã³ãããããã®ã¯æããã«ãªã¼ãã¼ãããéå°ã§ãæå¾ã«1åã ãã³ãããããã°å åããã§ãããå¿è«ããã®ç¨åº¦ã®è² è·ã©ã£ã¡ã ã£ã¦ç¥ã£ããã¨ããã¨ããã®ãã¢ãªã ã¨æããã¨ã¯ãããè«çã¬ãã«ã®è¦æ±ãå®ç¾ããããã«ãç©çã¬ãã«ã§ãªãã¹ãå®ãæ¸ãæ段ãåããã¨ããéçºè ã®è²¬åã¨è¨ããããªæãã§ããã
ãããã®è¾ºçµæ§ããã©ããããã¨è²ã èããªããã°ãªããªãã®ã ãã©ãããã°ã©ãã«ã¾ã¨ãã¦æãæ¨ã¦ããã¦ãã®ãç¾ç¶ã§ããã
ããã°ã©ãã®ä¸å®
å®ãè¨ãã¨ããã®ã¨ã³ããªã®1件ãã¤ã³ãããã¯ä¿ºèªèº«ããã£ã¡ã¾ã£ããã¨ã®ãã失æè«ã§ãããæããOracleé¢é£ã®æ¬ã¨ãè³æã¨ãè¦ã¦ãã¨ããããã失æäºä¾ã¨ãã¦è¦ãããã®ã§ã俺ã«åºæã®å¤±æäºä¾ã¨ããããã§ããªããããã¯ã¨ããããä½æ ããããã³ã¼ããæ¸ãã¦ãã¾ã£ãããã¨ãããã¨ã«ã¤ãã¦èãããã
ã¾ããã³ããããéãå¦çã ã¨ç¥ããªããã¨ãæãããããã³ãããããã°ãã¼ã¿ã確å®ãããããããã®ç¥èãªã®ã§ãå°ã¾ãã«ã»ã¼ããã¨ãã°ãï½ã ãããç¨åº¦ã®å¤æãã¾ãããªãã¹ãéãã³ãããããªããã°ãã¼ã¿ãä¿æãããªãã®ã§ã¯ãªãããã¨ããä¸å®ãããã
ãã®ãããªç¥èä¸è¶³ãããã«èµ·å ããä¸å®ã«ãããã¦éå°ã«ã³ããããé£çºããã¨æ§è½ä¸ä¸å©ãªäºè±¡ã¨ãªã£ã¦ç¾ããããªãæªããã¨ã«ã³ã¼ãä¸ã§ã¯æ¬å½ã«äºç´°ãªéãã§ãããªããã¾ãããã¼ã¿éãå°ãªããã°ç¹ã«åé¡ç¡ãåãã¦ãã¾ãã®ã§ããã£ã¨å¾ã«ãªã£ã¦ããæ§è½å£åã表é¢åããé å ã«ããªã£ã¦ãã¾ãããªãã¤ã¼ãã¾ãç¥ããªãã£ã¦ã®ã¯æ¬å½ã«æãããã
ä¿ã«çµé¨è±å¯ãªDBAãããã¸ã§ã¯ãæ©æããåç»ããã¨å¤±æã®ç¢ºçãæ¸ãã¨è¨ããããã©ããããããã¤ã³ããæ©æã«æ½°ãã¦ããããããªã®ã ãããã¨æ¨æ¸¬ãããã
åèURL
- 第19回 UNDOデータとREDOログについて
- OTN Japan - Oracleデータベース 性能対策機能 〜 StatspackとDiagnostics Packを使いこなす 〜 第2回 ケーススタディ(Statspack)
- Oracle Databaseリファレンス11gリリース2 (11.2) -C Oracle待機イベント - 待機イベントの説明
- パフォーマンスセラピー / システム統計情報とセッション統計情報を取得してみよう
- 共有プール - オラクル・Oracleをマスターするための基本と仕組み
- http://www.insight-tec.com/mailmagazine/ora3/vol330.html
- MyKnowledge SE社員: show ~ Oracle チューニング db file sequential read
- 日本エクセム∥EXEM LABO∥Oracle Knowledge
*1:ããã¯ä¸æ£ç¢ºã§ãã°ã«ã¼ãã»ã³ããããããã®ã§å¿ ããããããªãã¨ã¯éããªããããã®ã¨ã³ããªã§ã¯ä»ã®ã»ãã·ã§ã³ãããªãã®ã§ã»ã¨ãã©é¢ä¿ãç¡ã
*2:詳ããä»çµã¿ãç¥ããªãã¦ãå©çã享ååºæ¥ãã®ãããã«ã¦ã§ã¢ã®å©ç¹ã§ãããã®ã ã
*3:http://d.hatena.ne.jp/kagamihoge/20120628/1340884433
*4:Oracleã«ããã¦ç©ºã³ãããã¯ã»ã¨ãã©æ§è½ã«å½±é¿ããªã http://kagamihoge.hatenablog.com/entry/2014/03/02/160514