photo credit: koalazymonkey via photopin cc
ã¯ããã«
Oracle DBã§ä»»æã®ãã¼ãã«ãæ¤ç´¢ããSQLãå®è¡ããéãã¤ã³ããã¯ã¹ã使ã£ãé«éãªæ¤ç´¢ãè¡ããã¦ããã確èªããæ¹æ³ãç´¹ä»ãã¾ãã
ã¤ã³ããã¯ã¹ãå¹ãã¦ããã確èªãã
ã¤ã³ããã¯ã¹ã使ã£ãæ¤ç´¢ãè¡ããã¦ãããã¯ãset autotrace onã使ã£ã¦ãå®è¡è¨ç»ãåºåããã¨ã²ã¨ç®ã§ãããã¾ãã
set autotrace on ä»»æã®SQL
set autotraceã³ãã³ãã§ãSP2-0618: ã»ãã·ã§ã³èå¥åãè¦ã¤ããã¾ããããã¨ããã¡ãã»ã¼ã¸ã表示ãããå ´åã¯ã以ä¸ã®è¨äºãåç §ãã¦è¨å®ãæå¹ã«ãã¦ãã ããã
ã¤ã³ããã¯ã¹ã使ã£ãæ¤ç´¢
ãã©ã¤ããªãã¼ã使ã£ãæ¤ç´¢ã§ã¤ã³ããã¯ã¹ãå¹ãã±ã¼ã¹ã§ãã以ä¸ã®ãããªãã¼ãã«ã«å¯¾ãã¦ãWHEREåºã«ä¸»ãã¼ãæå®ãã¦ãæ¤ç´¢ãã¦ã¿ã¾ãã
create table table01 ( ããid char(5), ããname varchar2(50), ããfurigana varchar2(50), ããprimary key( id ) );
set autotrace on select * from table01 where id = '1';
ä¸è¨ã®ä¾ã§ã¯ãINDEX UNIQUE SCANã¨ããã®ã表示ããã¦ãããSYS_C006997ã¨ããååã®ã¤ã³ããã¯ã¹ã使ã£ãæ¤ç´¢ãå®æ½ãã¦ããã¨ãããã¨ãåããã¾ãã
ã¤ã³ããã¯ã¹ã使ããã¦ããªãæ¤ç´¢
ããã»ã©ã¨åãããã«ãã©ã¤ããªãã¼ã«ããæ¤ç´¢ã§ãããã¤ã³ããã¯ã¹ã使ããã¦ããªãã±ã¼ã¹ã§ããWHEREåºã«ã¯ãã©ã¤ããªãã¼ãæå®ãã¦ãã¾ãããcharåã®ä¸»ãã¼ã«å¯¾ãã¦æ°å¤ã渡ãã¦ãããæé»ã®åå¤æãè¡ããã¦ãããããã¤ã³ããã¯ã¹ã使ããã¦ãã¾ããã
set autotrace on select * from table01 where id = 1;
ä¸è¨ã®ä¾ã§ã¯ãTABLE ACCESS FULLã¨ããã®ã表示ããã¦ããããã¼ãã«ã®ãã«ã¹ãã£ã³ãè¡ããã¦ããã¨ãããã¨ãåããã¾ãã
ãããã«
set autotrace onã§SQLã®å®è¡è¨ç»ãåºåããã¨ãã©ã®ãããªæ¤ç´¢ãè¡ããããã調ã¹ããã¨ãã§ãã¾ãããã¹ã段éã§æ§è½åé¡ã«ãªãåã«å®è£
段éãããã¾ãã«ãã§ãã¯ããããã«ãã¦ããããã§ããã
é¢é£ã¨ã³ããª
- Oracleã§ã«ã¼ã½ã«å ±æ(CURSOR_SHARING)ã®è¨å®å¤ã確èªãã
- Oracle DBã®å ±æãã¼ã«(SHARED_POOL)ãã¯ãªã¢ããã³ãã³ã
- Oracleã§NULLãç¹å®ã®æåã«ç½®ãæããæ¹æ³
- SP2-0749: ã·ããã âxxâã®å¾ªç°ãã¹ã解決ã§ãã¾ããã
- dbForge Data Compare for Oracleã§ãã¼ãã«éã®å·®åã確èªãã