|
USING INDEX
TABLESPACE TSI_BIO01 PCTFREE 20
STORAGE ( INITIAL 16384 NEXT 471556096 PCTINCREASE 80 ))
TABLESPACE TSD_BIO01
PCTFREE 20
PCTUSED 80
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 1064960
NEXT 1048576
PCTINCREASE 0
MINEXTENTS 1
MAXEXTENTS 2147483645
FREELISTS 1 FREELIST GROUPS 1 )
NOCACHE;
´äº¯ ----------------------------------------
¤· TABLESPACE TSI_BIO01 PCTFREE 20 :
--> ¾îµð¼ °¡Á®¿À½Å °ÍÀÎÁö ¸ð¸£°ÚÁö¸¸, ÀÌ·± ¹®ÀåÀÌ
¿¬¼ÓµÇ·Á¸é OMF¹Û¿¡ ¾øÀ» µí ½Í½À´Ï´Ù. datafile ~ ÀýÀÌ
¾ø³×¿ä.. pctfree ´Â segment°ü¸®¿¡¼ ÀÖ¾î¾ß ÇÏ´Â »çÇ×ÀÔ´Ï´Ù. 9iÀÇ °æ¿ì¿£
segment space management auto ¸í·ÉÀ¸·Î ¸¸µé¸é pctfree
pctused ¸¦ »ç¿ëÇؼ Á¶ÀýÇÔÀÌ ÇÊ¿ä¾øÀÌ ÀÚµ¿À¸·Î segment
°ü¸®¸¦ ÇÕ´Ï´Ù.
--> ±×·¯¸é ¿Ö pctfree, pctused °¡ ÇÊ¿äÇÑÁö ¾Ë¾Æº¼±î¿ä?
row channing Çö»ó°ú row migration Çö»ó¿¡ ´ëÇؼ ¾Ë¾Æ¾ß ÇÕ´Ï´Ù.
row channingÀº db_block_sizeº¸´Ù ³Ê¹« Å« µ¥ÀÌÅÍ°¡ µé¾î¿ÔÀ» °æ¿ì
ÀÎÁ¢ÇÑ ´Ù¸¥ ºí·Ï±îÁö µ¥ÀÌÅÍ°¡ ³Ñ¾î°¡´Â °ÍÀ» ¸»ÇÏÁÒ. ÀÌ·± °æ¿ì
¸¸¾à¿¡ Å« µ¥ÀÌÅÍÀÇ Æ¯Â¡À» °¡Áø´Ù¸é LOB typeÀ¸·Î ´Ù¸¥ tablespace
¿¡ ÀúÀåÇÏ´Â °ÍÀÌ ¿Ç±ä ÇÏ°ÚÁÒ. ÇÏÁö¸¸ row channingÀº ÀϹÝÀûÀÎ Çö»óÀÔ´Ï´Ù.
¹°·Ð 9i ÀÏ °æ¿ì¿£ ÆĶó¹ÌÅÍ¿¡ db_?k_cache_size ¸¦ ÁÖ°í
?k·Î create tablespace ~~ blocksize ?k; ·Î Á¤ÇÏ¸é ´õ db_block_size
º¸´Ù ´õ Å« block_size¸¦ °¡Áö´Â tablespace¸¦ ¸¸µé°í ±× ¾È¿¡
µ¥ÀÌÅ͸¦ ³Ö´Â´Ù¸é rog channingÀ» ¹æÁöÇÒ ¼ö ÀÖ°ÚÁÒ.
row channingÀº ¾î¿ ¼ö ¾ø´Â Çö»óÀ̶ó°í ÇÒÁö¶óµµ.. row migration Àº
²À ¸·¾Æ¾ß ÇÏ´Â »çÇ×ÀÔ´Ï´Ù. ÀÌ°ÍÀº ¿¹¸¦µé¾î A¶ó´Â Å×ÀÌºí¿¡¼
10¹ø° °ªÀÌ insertµÇ¾ú½À´Ï´Ù. ÀÌ¾î¼ 11¹ø° °ªÀÌ insertµÇ¾ú±¸¿ä.
±×·±µ¥ 10¹ø° °ªÀ» À¯Àú°¡ update½ÃÄ״µ¥, updateÇÑ µ¥ÀÌÅÍ°¡ ¿¹ÀüÀÇ
µ¥ÀÌÅͺ¸´Ù Å©±â°¡ Å®´Ï´Ù. ±×·±µ¥ db block¿¡ 11¹ø° °ª¶§¹®¿¡ ¿©À¯°ø°£
ÀÌ ¾ø¾î¼ ´Ù¸¥ blockÀ¸·Î ÇØ´ç µ¥ÀÌÅ͸¦ À̵¿À» ÇÏ´Â °ÍÀÌÁÒ.ÀÌ·± °ÍÀÌ ÀÚÁÖ
ÀϾ °æ¿ì ÁÁÁö ¾Ê½À´Ï´Ù. ±×·¡¼ pctfree, pctusedÀ̶ó´Â °³³äÀÌ
»ý±ä °ÍÀÌÁÒ.. pctfree 10, pctused 40 À̶ó°í ÇÑ´Ù¸é....
Ãʱ⠺ó ºí·Ï¿¡ µ¥ÀÌÅÍ°¡ µé¾î°¡´Ù°¡.. pctused 40%¸¦ ³Ñ°å½À´Ï´Ù. ±×·¡µµ
°è¼ÓÇؼ insert¸¦ ÇÏÁö¿ä. ±×·¯´Ù°¡ pctfree 10% Áï µ¥ÀÌÅÍ°¡ 90%³Ñ°Ô
ä¿öÁú °æ¿ì¿£ ´õÀÌ»ó µ¥ÀÌÅÍ°¡ µé¾î°¡Áö ¾Ê°í ºí·Ï¿¡ ¿©À¯°ø°£À» ³²°ÜµÓ´Ï´Ù.
file header ¿¡¼ freelist¶ó´Â °ÍÀ» °ü¸®Çϴµ¥ ÀÌ°ÍÀº ÀÌ segment°¡
µé¾î°¥ ºó°ø°£ÀÌ ÀÖ´ÂÁö¸¦ È®ÀÎÇÏ´Â °ÍÀä. À§¿¡¼ 90%¸¦ ³Ñ±â¸é
Áï pctfree°ø°£ÀÌ 10% ÀÌÇÏ°¡ µÈ´Ù¸é... ±× ºí·ÏÀ» freelist¿¡¼ Á¦°Å¸¦
ÇÏ°í ±× ºí·ÏÀº insert¸¦ Áß´ÜÇÕ´Ï´Ù. ´Ù¸¥ freelist¿¡ µî·ÏµÈ ºó
ºí·Ï¿¡ µ¥ÀÌÅ͸¦ ³Ö°ÚÁÒ.
³ªÁß¿¡ µ¥ÀÌÅÍ°¡ update°¡ µÉ °æ¿ì¸¦ ºí·ÏÀÇ 10%¸¸Å ¹Ì¸® ÁغñÇÏ´Â °ÍÀÌÁÒ.
±×·±µ¥ ¸¸¾à¿¡ ±× ºí·ÏÀÇ µ¥ÀÌÅÍ°¡ ÁÙ¾îµç´Ù¸é¿ä? 90%º¸´Ù ÁÙ¾îµé
°æ¿ì °è¼ÓÇؼ 0±îÁö ÁÙ¾îµç´Ù¸é ±× ºí·ÏÀ» freelist¿¡¼ »èÁ¦µÈ
»óȲÀÌ´Ï ´õ ÀÌ»ó insert°¡ ¾ÈµÇ°ÚÁÒ. ÀÌ °æ¿ì ¾î¶² ±âÁØÀ»
¸¶·ÃÇصξî¾ß ÇÒ °ÍÀÔ´Ï´Ù. pctused´Â ÀÌ·¸°Ô block¿¡ µ¥ÀÌÅÍ°¡
¾ø¾îÁú°æ¿ì ÃÖ¼Ò°ªÀ» ¸»ÇÕ´Ï´Ù.Áï ÃÖ¼ÒÇÑ ÀÌ ¸¸ÅÀº µ¥ÀÌÅÍ°¡ µé¾î°¡¼
db blockÀÇ ³¶ºñ¸¦ ÃÖ¼ÒÈ ÇÏÀÚ´Â °ÍÀÌÁÒ. pctused°¡ ÇÊ¿äÇÑ ÀÌÀ¯ÀÔ
´Ï´Ù. ¿ì¸®°¡ 90% µ¥ÀÌÅÍ¿¡¼ µ¥ÀÌÅÍ°¡ »èÁ¦µÇ°Å³ª Çؼ 90% ÀÌÇÏ·Î
¶³¾îÁö°Ô µË´Ï´Ù. Áï pctfree°ªÀÌ 10% º¸´Ù ¿©À¯°ø°£ÀÌ ´õ »ý±â°ÚÁÒ.
ÇÏÁö¸¸ ¿À¶óŬÀº pctfree 10%º¸´Ù ´õ Å« ¿©À¯°ø°£ÀÌ »ý°Üµµ freelist
¿¡ ±× ºí·ÏÀ» Ãß°¡ÇÏÁö ¾Ê½À´Ï´Ù. Áï µ¥ÀÌÅÍ°¡ Á¡Á¡ Áٴٰ¡ 60%Á¤µµÀÇ
µ¥ÀÌÅÍ°¡ µÇ¾úÀ» Áö¶óµµ freelist¿¡ µî·ÏÇÏÁö ¾Ê´Â °ÍÀÌÁÒ.
ÀÌÁ¦ pctused 40% º¸´Ùµµ Àû¾îÁö´Â »óȲÀÌ »ý±æ °æ¿ì¿£¿ä? ÀÌ °æ¿ì¿¡¼
¾ß ºñ·Î¼Ò µ¥ÀÌÅ͸¦ ³ÖÀ» ¼ö ÀÖµµ·Ï freelist¿¡ µî·ÏÀ» ÇÕ´Ï´Ù.
ÇÏÁö¸¸ 9i¿¡¼´Â pctfree, pctused ¹æ¹ýÀº ±ÇÇÏÁö ¾Ê½À´Ï´Ù.
segment space management auto ÀýÀ» ³Ö¾î¼ auto·Î °ü¸®Çϵµ·ÏÇÏÁÒ.
Âü°í·Î auto¹æ½ÄÀÇ °æ¿ì¿£ pctfree¸¸ ÀÖ½À´Ï´Ù. ºí·ÏÀ» 25%¾¿ 4°³·Î
³ª¿ì¾î¼ °ü¸®ÇÏ´Â ¹æ½ÄÀÔ´Ï´Ù. auto¸¦ ¾²¸é ÈξÀ µ¥ÀÌÅÍ ºí·Ï
³¶ºñ¸¦ ¸·°í row migration µµ ÇØ°áÇØÁÝ´Ï´Ù. ¼öµ¿Àº ±ÇÇÏÁö ¾ÊÀ½
¤· STORAGE ( INITIAL 16384 NEXT 471556096 PCTINCREASE 80 )) :
À§¿¡¼ storage ÀýÀº extentÇÒ´ç ¹æ½ÄÀ» ¸»ÇÕ´Ï´Ù.
µÎ°¡Áö ¹æ½ÄÀÌ Àִµ¥ 8i¿¡¼´Â default °¡ extent ¸¦ ÇÒ´çÇÒ¶§¿¡
dictionary extent managed tablespace¸¦ »ç¿ëÇß½À´Ï´Ù. ¹°·Ð À̶§µµ
locally extent managed tablespace¸¦ ¸¸µé ¼ö´Â ÀÖ¾úÁÒ. 9i¿¡¼ ¿Í¼´Â
locally extent managed tablespace°¡ default°ªÀÔ´Ï´Ù.
µÎ°³ÀÇ Â÷ÀÌ´Â extent ÇÒ´çÇÏ´Â ¹æ½Ä¿¡ µû¸¨´Ï´Ù.
°£´ÜÈ÷ ¸»Çؼ dictionary extent tablespace¸¦ »ý¼ºÇÒ °æ¿ì¿£ ÀÌ Å×À̺í
½ºÆäÀ̽ºÀÇ extent ÇÒ´ç½Ã¿¡ ±× Á¤º¸¸¦ system tablespaeÀÇ base table
¿¡¼ °¡Á®¿É´Ï´Ù. ÇÏÁö¸¸ extentÇÒ´çÀ» ¿©±âÀú±â¼ ÇÏ´Ùº¸´Ï system
tablespace¸¦ Á¶È¸Çؼ extent¸¦ ¾îµð¸¦ ÇÒ´çÇÏ¸é µÉ °ÍÀÎÁö È®ÀÎÀ»
ÇÏ°í extent¸¦ ÇÒ´çÈÄ ÇÒ´çÁ¤º¸¸¦ system tablespace¿¡ ÀúÀåÇÕ´Ï´Ù.
º´¸ñÇö»óÀÌ ¾öû ³ª°Ô ¸¹¾ÆÁö°ÚÁÒ.
locally extent manage tablespaceÀÇ °æ¿ì¿£ ±×·¸Áö ¾Ê½À´Ï´Ù. system tablespace
ÀÇ base table¿¡¼ extent ¿©À¯°ø°£ Á¤º¸¸¦ °¡Á®¿À´Â °ÍÀÌ ¾Æ´Ï¶ó
ÇØ´ç µ¥ÀÌÅÍÆÄÀÏ Çì´õ¿¡ Á÷Á¢ bitmap blockÀ¸·Î ÀúÀåµË´Ï´Ù.
±×·¡¼ extentÇÒ´ç½Ã¿¡ system tablespac¿¡¼ ã¾Æ¼ ÇÒ´çÇÏ´Â °ÍÀÌ ¾Æ´Ï¶ó
ÀÚ½ÅÀÌ ¼ÓÇÑ Å×ÀÌÅÍÆÄÀÏÀÇ Çì´õ¿¡¼ bitmap block¿¡¼ ã°ÚÁÒ.
Áï °æÇÕÇö»óÀÌ °ÅÀÇ ¹ß»ýÇÏÁö ¾Ê½À´Ï´Ù. ¿À¶óŬ»ç¿¡¼´Â dictionary
¹æ½ÄÀ» »ç¿ëÇÏÁö ¸»°í locally tablespace¸¦ »ç¿ëÇϵµ·Ï ±ÇÇÕ´Ï´Ù.
9i¿¡¼ system tablespace°¡ locally tablespaceÀÏ °æ¿ì, ÀϹÝ
tablespace»ý¼º½Ã default storageÀý(dictionary ¹æ½Ä)Àº »ç¿ëµÇÁö ¾Ê½À´Ï´Ù. ¿¡·¯³²
ÇÏÁö¸¸ system tablespace°¡ dictionary tablespaceÀÏ °æ¿ì¿£
default storageÀý(dictionary ¹æ½Ä)À» ÅëÇؼ create tablespace¸¦ »ç¿ëÇÒ ¼ö
ÀÖ°ÚÁÒ. ¸¸¾à¿¡ create table Àý¿¡ storage¸¦ ÁØ´Ù¸é ¾î¶»°Ô
µÉ±î¿ä? ÀÌ·± °æ¿ì extenet management local ¹æ½ÄÀÇ °æ¿ì¿£
Áú¹®»çÇ×ÀÎ storage ÀýÀ» ÁÖ°Ô µÇ¸é ¸ðµÎ ¹«½ÃµË´Ï´Ù. Áï tablespace
¿¡¼ Á¤ÇÑ uniform size ´ë·Î default ¶ó¸é 1M ¸¸ÅÀÇ extentÇÒ´çÀ»
ÇÕ´Ï´Ù.
±×·¸´Ù¸é system tablespace°¡ dictionary tablesapce¶ó¸é?
ÀÌ °æ¿ì ÀÏ¹Ý tablespace¸¦ ¸¸µé °æ¿ì¿¡ default storageÀýÀ»
ÁöÁ¤ÇÒ ¼ö ÀÖ½À´Ï´Ù. ÇÏÁö¸¸ create table ¸í·É¿¡¼ Áú¹®°ú °°ÀÌ
storageÀýÀ» ÁÖ°Ô µÇ¸é tablespaceÀÇ ¼³Á¤Àº ¸ðµÎ ¹«½ÃµÇ°í
create table ¼³Á¤À» µû¸¨´Ï´Ù. ¸Ç ¾Æ·¡¿¡ ¿¹Á¦¸¦ µÎ´Ï Âü°íÇϼ¼¿ä.
±×·¯¸é ¿©±â¼ STORAGE ( INITIAL 16384 NEXT 471556096 PCTINCREASE 80 ))
´Â ¹«¾ùÀ» ¶æÇϴ°¡..
system tablespace°¡ locally extent managed tablespace¿¡¼´Â À§ ÀýÀ» ÀÌ¿ë
ÇÏ´Â °ÍÀÌ ºÒ°¡´ÉÇÏ´Ï, dictionary extent managed tablesapce¶ó°í ÇÏ°Ú½À´Ï´Ù.
¶ÇÇÑ tablespaceµµ dictionary extent managed tablesapce À̱¸¿ä.
create table test ( id number ) storage STORAGE ( INITIAL 16384 NEXT
471556096 PCTINCREASE 80 )); À̶ó°í ÁְԵǸé Ãʱ⿡ ÀÌ Å×ÀÌºí¿¡ extent´Â
16384 ¹ÙÀÌÆ®¸¸Å ¹Ì¸® ÇÒ´çµË´Ï´Ù. ±×¸®°í ³ª¼ extent¾È¿¡ db blockµé¿¡
µ¥ÀÌÅÍ°¡ µé¾î°¬´Âµ¥ µ¥ÀÌÅÍ°¡ ¸¹ÀÌ µé¾î°¡¼ ¸ðµÎ µ¥ÀÌÅÍ°¡ áÀ» °æ¿ì
»õ·Î¿î extent¸¦ ÇÒ´çÇÕ´Ï´Ù. À̶§¿¡ next ¸¸ÅÀ» ÇÒ´çÇÏ´Â °ÍÀÌÁÒ.
±×·±µ¥ °¡Àå ¹®Á¦°¡ ÀÖ´Â pctincrease 80 À̶ó°í Ç߳׿ä. ±× ´ÙÀ½ nextÀÇ
°æ¿ì¿£ 80% ¸¸Å ´õ Å©°Ô ´Ã¾î³³´Ï´Ù.
extent1 ¿¡¼´Â 16384
extent2 ¿¡¼´Â 16384 + 471556096
extent3 ¿¡¼´Â ( 16384 + 471556096 + 471556096 )*(1+0.8) =>
--> °è»ê¹ýÀº È®½ÇÄ¡ ¾ÊÀ½..
ÀÌ·¸µç pctincrease¸¦ ¾²°Ô µÇ¸é ¾µµ¥¾øÀÌ ÇѲ¨¹ø¿¡ extent¸¦ ÇÒ´ç¹ÞÀ¸´Ï
´Ù¸¥ table¿¡¼ ±× ¸¸Å ÀÌ °ø°£À» ¾²Áö ¸øÇÏ´Â ²ÃÀÌ µÇ°í ¸¿´Ï´Ù.
pctincrease´Â ¾²¸é ¾ÈµË´Ï´Ù.
±×¸®°í dictionary ¹æ½ÄÀº ¾²Áö ¸»°í locally ¹æ½ÄÀ¸·Î uniform size ¸¦
ÁöÁ¤Çؼ »ç¿ëÇϼ¼¿ä.. uniform size ¸¦ ¾î´ÀÁ¤µµ ÁÖ¾î¾ß Çϳª°¡
°í¹ÎÀÌ µÈ´Ù¸é 10M Á¤µµ·Î ±×³É unique ÇÏ°Ô ÁÖ¼¼¿ä. ´Ü ³Ê¹« Å©¸é
¾ÈµË´Ï´Ù.
±×·±µ¥ ¿©·¯ Å×À̺íÀÇ µ¥ÀÌÅÍ°¡ µé¾î°¡´Âµ¥.. ³Ê¹« ¸¹ÀÌ extent
°¡ »ý°Ü¼ ´Ù¸¥ Å×À̺íÀÇ µ¥ÀÌÅÍ¿Í ¼¯ÀÌ¸é ¾ÈµÇ´Â °ÍÀÌ ¾Æ´Ñ°¡?
ÀÌ°ÍÀº »ý°¢ÇÏÁö ¸¶¼¼¿ä..~ ¿Ö³Ä¸é SMONÀ̶ó´Â ÇÁ·Î¼¼½º°¡ ¾Ë¾Æ¼
ÇÕ´Ï´Ù. ¿À¶óŬÀÌ ¾Ë¾Æ¼ ÇÏ´Ï »ý°¢ÇÒ ÇÊ¿ä ¾øÁÒ.
¤· PCTFREE 20 : -> À§¿¡¼ ¼³¸íÇÑ ³»¿ë, Áï update¸¦ À§Çؼ db block¿¡
ÃÖ¼ÒÇÑ 20% Á¤µµÀÇ °ø°£À» ³²°ÜµÎ°Ú´Ù.
¤· PCTUSED 80 : -> À§¿¡¼ ¼³¸íÇÑ ³»¿ë, Áï pctfree·Î ÀÎÇÑ °ø°£³¶ºñ¸¦ ¸·±â
À§Çؼ ÃÖ¼ÒÇÑ 80% ¸¸ÅÀÇ µ¥ÀÌÅÍ´Â ²À ³Öµµ·Ï ÇÏ°Ú´Ù.
¤· INITRANS 1 : -> segment¿¡ Æ®·£Á§¼ÇÀÌ ÃÖ¼Ò ÇÑ°³ ÀÌ»ó °É¸± ¼öÀÖµµ·Ï ÇÑ´Ù.
¤· MAXTRANS 255 : -> segment¿¡ Æ®·£Àè¼ÇÀÌ ÃÖ´ë 255°³±îÁö °É¸± ¼ö ÀÖµµ·Ï ÇÑ´Ù.
¤· INITIAL 1064960 : -> À§¿¡¼ ¼³¸í ÃʱâÀÇ extent Å©±â
¤· NEXT 1048576 : -> À§¿¡¼ ¼³¸í Ãʱâ extentÇÒ´çÈÄ extent°¡ ºÎÁ·ÇÒ °æ¿ì
´ÙÀ½ÀÇ extent ÇÒ´ç½Ã Å©±â
¤· PCTINCREASE 0 : -> 0%¾¿ ´Ã¾î³ª°Ú´Ù´Â À̾߱â´Ï.. ¹«½ÃµÇ°ÚÁÒ.
¤· MINEXTENTS 1 : -> ÃÖ¼ÒÇÑÀÇ extent¸¦ ÇÒ´çÇÏ°Ú´Ù..
initial 10K Àε¥ minextents°¡ 2 ¸é¿ä?
tableÀ» »ý¼ºÇÏ¸é¼ 20K¸¦ ¹Ì¸® ÇÒ´çÇÕ´Ï´Ù.
20ºÎÅÍ ½ÃÀÛÇÏÁÒ..~
¤· MAXEXTENTS 2147483645 : -> ÃÖ´ëÇÑÀÇ extent¸¦ ¸»ÇÕ´Ï´Ù. ÀÌ°Å ½è´Ù°¡´Â
µ¥ÀÌÅÍ°¡ Ä¿Áö¸é ¹®Á¦°¡ »ý±æµíÇÕ´Ï´Ù.
¤· FREELISTS 1 FREELIST GROUPS 1 ) : -> µ¥ÀÌÅͺí·ÏÀÇ segment°ü¸®¿¡¼
ÇÑ°³ freelist¿¡¼ free blockÀ» ã°í µ¥ÀÌÅ͸¦ ³Ö´Â °Í¿¡ ¸¹Àº Æ®·£Àè¼ÇÀÌ Ã³¸®¸¦ ÇÒ °æ¿ì
¼º´ÉÀÌ ³ªºüÁö°ÚÁÒ? ±×·¡¼ freelistÀÇ °æ¿ì¿¡ ¿©·¯°³°¡ ÀÖÀ¸¸é ºÐ»êÀÌ µÇ±â¿¡ ÁÁ°ÚÁÒ. freelist groupÀº freelist¸¦ ¸î°³¸¦ freelist groupÀ¸·Î »ç¿ëÇÏ°Ú´Ù´Â ¶æÀÌ°ÚÁÒ.
¤· NOCACHE; ¾Æ·¡¸¦ Âü°í..
CACHE | NOCACHE | CACHE READS
Use the CACHE clauses to indicate how Oracle should store blocks in the buffer cache. If you specify neither CACHE nor NOCACHE:
In a CREATE TABLE statement, NOCACHE is the default
In an ALTER TABLE statement, the existing value is not changed.
CACHE Clause
For data that is accessed frequently, this clause indicates that the blocks retrieved for this table are placed at the most recently used end of the least recently used (LRU) list in the buffer cache when a full table scan is performed. This attribute is useful for small lookup tables.
As a parameter in the LOB_storage_clause, CACHE specifies that Oracle places LOB data values in the buffer cache for faster access.
Restriction on CACHE
You cannot specify CACHE for an index-organized table. However, index-organized tables implicitly provide CACHE behavior.
NOCACHE Clause
For data that is not accessed frequently, this clause indicates that the blocks retrieved for this table are placed at the least recently used end of the LRU list in the buffer cache when a full table scan is performed.
As a parameter in the LOB_storage_clause, NOCACHE specifies that the LOB value is either not brought into the buffer cache or brought into the buffer cache and placed at the least recently used end of the LRU list. (The latter is the default behavior.)
Restriction on NOCACHE
You cannot specify NOCACHE for index-organized tables.
CACHE READS
CACHE READS applies only to LOB storage. It specifies that LOB values are brought into the buffer cache only during read operations, but not during write operations.
------------ Á¦°¡ Å×½ºÆ®ÇÑ ·Î±×¸¦ µå¸³´Ï´Ù. --------------
SQL> create tablespace testdic
2 datafile "$DATA/u06/testdic.dbf" size 10M
3 extent management dictionary
4 default storage ( initial 20k next 20k );
Tablespace created.
SQL> desc dba_tablespaces;
Name Null? Type
----------------------------------------- -------- ----------------------------
TABLESPACE_NAME NOT NULL VARCHAR2(30)
BLOCK_SIZE NOT NULL NUMBER
INITIAL_EXTENT NUMBER
NEXT_EXTENT NUMBER
MIN_EXTENTS NOT NULL NUMBER
MAX_EXTENTS NUMBER
PCT_INCREASE NUMBER
MIN_EXTLEN NUMBER
STATUS VARCHAR2(9)
CONTENTS VARCHAR2(9)
LOGGING VARCHAR2(9)
FORCE_LOGGING VARCHAR2(3)
EXTENT_MANAGEMENT VARCHAR2(10)
ALLOCATION_TYPE VARCHAR2(9)
PLUGGED_IN VARCHAR2(3)
SEGMENT_SPACE_MANAGEMENT VARCHAR2(6)
SQL> select tablespace_name, initial_extent, next_extent, min_extents, max_extents
2 from dba_tablespaces where tablespace_name="TESTDIC";
TABLESPACE_NAME INITIAL_EXTENT NEXT_EXTENT MIN_EXTENTS
------------------------------ -------------- ----------- -----------
MAX_EXTENTS
-----------
TESTDIC 20480 20480 1
249
SQL> create user userdic
2 identified by oracle
3 default tablespace testdic;
User created.
SQL> grant connect, resource to userdic;
Grant succeeded.
SQL> conn userdic/oracle
Connected.
SQL> create table dictable
2 (id number,
3 var varchar2(10))
4 storage ( initial 100k next 100k );
Table created.
SQL>
SQL> conn sys/oracle as sysdba
Connected.
SQL> select owner, segment_name, segment_type, tablespace_name, initial_extent, next_extent
2 from dba_segments where owner="USERDIC";
OWNER
------------------------------
SEGMENT_NAME
----------------------------------------------------------------------
----------
SEGMENT_TYPE TABLESPACE_NAME INITIAL_EXTENT NEXT_EXTENT
------------------ ------------------------------ -------------- -----------
USERDIC
DICTABLE
TABLE TESTDIC 102400 102400
SQL> conn userdic/oracle
Connected.
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
DICTABLE TABLE
SQL> alter table dictable
2 storage ( initial 30k next 30k);
storage ( initial 30k next 30k)
*
ERROR at line 2:
ORA-02203: INITIAL storage options not allowed
SQL> alter table dictable
2 storage ( next 60k );
Table altered.
SQL> select owner, segment_name, segment_type, tablespace_name, initial_extent, next_extent
2 from user_segments ;
select owner, segment_name, segment_type, tablespace_name, initial_extent, next_extent
*
ERROR at line 1:
ORA-00904: "OWNER": invalid identifier
SQL> desc user_segments
Name Null? Type
----------------------------------------- -------- ----------------------------
SEGMENT_NAME VARCHAR2(81)
PARTITION_NAME VARCHAR2(30)
SEGMENT_TYPE VARCHAR2(18)
TABLESPACE_NAME VARCHAR2(30)
BYTES NUMBER
BLOCKS NUMBER
EXTENTS NUMBER
INITIAL_EXTENT NUMBER
NEXT_EXTENT NUMBER
MIN_EXTENTS NUMBER
MAX_EXTENTS NUMBER
PCT_INCREASE NUMBER
FREELISTS NUMBER
FREELIST_GROUPS NUMBER
BUFFER_POOL VARCHAR2(7)
SQL> select segment_name, segment_type, tablespace_name, initial_extent, next_extent
2 from user_segments ;
SEGMENT_NAME
----------------------------------------------------------------------
----------
SEGMENT_TYPE TABLESPACE_NAME INITIAL_EXTENT NEXT_EXTENT
------------------ ------------------------------ -------------- -----------
DICTABLE
TABLE TESTDIC 102400 61440
SQL> conn sys/oracle as sysdba
Connected.
SQL> desc dba_users;
Name Null? Type
----------------------------------------- -------- ----------------------------
USERNAME NOT NULL VARCHAR2(30)
USER_ID NOT NULL NUMBER
PASSWORD VARCHAR2(30)
ACCOUNT_STATUS NOT NULL VARCHAR2(32)
LOCK_DATE DATE
EXPIRY_DATE DATE
DEFAULT_TABLESPACE NOT NULL VARCHAR2(30)
TEMPORARY_TABLESPACE NOT NULL VARCHAR2(30)
CREATED NOT NULL DATE
PROFILE NOT NULL VARCHAR2(30)
INITIAL_RSRC_CONSUMER_GROUP VARCHAR2(30)
EXTERNAL_NAME VARCHAR2(4000)
SQL>
SQL> create tablespace localtbs
2 datafile "$DATA/u06/localtbs01.dbf" size 10M
3 extent management local uniform size 20k;
Tablespace created.
SQL> create user localuser
2 identified by oracle
3 default tablespace localtbs;
User created.
SQL> grant connect, resource to localuser;
Grant succeeded.
SQL> desc dba_users
Name Null? Type
----------------------------------------- -------- ----------------------------
USERNAME NOT NULL VARCHAR2(30)
USER_ID NOT NULL NUMBER
PASSWORD VARCHAR2(30)
ACCOUNT_STATUS NOT NULL VARCHAR2(32)
LOCK_DATE DATE
EXPIRY_DATE DATE
DEFAULT_TABLESPACE NOT NULL VARCHAR2(30)
TEMPORARY_TABLESPACE NOT NULL VARCHAR2(30)
CREATED NOT NULL DATE
PROFILE NOT NULL VARCHAR2(30)
INITIAL_RSRC_CONSUMER_GROUP VARCHAR2(30)
EXTERNAL_NAME VARCHAR2(4000)
SQL> select username, default_tablespace
2 from dba_users where username="LOCALUSER";
USERNAME DEFAULT_TABLESPACE
------------------------------ ------------------------------
LOCALUSER LOCALTBS
SQL> conn localuser/oracle
Connected.
SQL> create table localtable
2 (id number,
3 val varchar2(10))
4 storage ( initial 40k next 40k );
Table created.
SQL> conn sys/oracle as sysdba
Connected.
SQL> desc dba_tablespaces;
Name Null? Type
----------------------------------------- -------- ----------------------------
TABLESPACE_NAME NOT NULL VARCHAR2(30)
BLOCK_SIZE NOT NULL NUMBER
INITIAL_EXTENT NUMBER
NEXT_EXTENT NUMBER
MIN_EXTENTS NOT NULL NUMBER
MAX_EXTENTS NUMBER
PCT_INCREASE NUMBER
MIN_EXTLEN NUMBER
STATUS VARCHAR2(9)
CONTENTS VARCHAR2(9)
LOGGING VARCHAR2(9)
FORCE_LOGGING VARCHAR2(3)
EXTENT_MANAGEMENT VARCHAR2(10)
ALLOCATION_TYPE VARCHAR2(9)
PLUGGED_IN VARCHAR2(3)
SEGMENT_SPACE_MANAGEMENT VARCHAR2(6)
SQL> select tablespace_name, initial_extent, next_extent from dba_tablespaces
2 where tablespace_name="LOCALTBS";
TABLESPACE_NAME INITIAL_EXTENT NEXT_EXTENT
------------------------------ -------------- -----------
LOCALTBS 20480 20480
SQL> desc dba_tables
Name Null? Type
----------------------------------------- -------- ----------------------------
OWNER NOT NULL VARCHAR2(30)
TABLE_NAME NOT NULL VARCHAR2(30)
TABLESPACE_NAME VARCHAR2(30)
CLUSTER_NAME VARCHAR2(30)
IOT_NAME VARCHAR2(30)
PCT_FREE NUMBER
PCT_USED NUMBER
INI_TRANS NUMBER
MAX_TRANS NUMBER
INITIAL_EXTENT NUMBER
NEXT_EXTENT NUMBER
MIN_EXTENTS NUMBER
MAX_EXTENTS NUMBER
PCT_INCREASE NUMBER
FREELISTS NUMBER
FREELIST_GROUPS NUMBER
LOGGING VARCHAR2(3)
BACKED_UP VARCHAR2(1)
NUM_ROWS NUMBER
BLOCKS NUMBER
EMPTY_BLOCKS NUMBER
AVG_SPACE NUMBER
CHAIN_CNT NUMBER
AVG_ROW_LEN NUMBER
AVG_SPACE_FREELIST_BLOCKS NUMBER
NUM_FREELIST_BLOCKS NUMBER
DEGREE VARCHAR2(10)
INSTANCES VARCHAR2(10)
CACHE VARCHAR2(5)
TABLE_LOCK VARCHAR2(8)
SAMPLE_SIZE NUMBER
LAST_ANALYZED DATE
PARTITIONED VARCHAR2(3)
IOT_TYPE VARCHAR2(12)
TEMPORARY VARCHAR2(1)
SECONDARY VARCHAR2(1)
NESTED VARCHAR2(3)
BUFFER_POOL VARCHAR2(7)
ROW_MOVEMENT VARCHAR2(8)
GLOBAL_STATS VARCHAR2(3)
USER_STATS VARCHAR2(3)
DURATION VARCHAR2(15)
SKIP_CORRUPT VARCHAR2(8)
MONITORING VARCHAR2(3)
CLUSTER_OWNER VARCHAR2(30)
DEPENDENCIES VARCHAR2(8)
SQL> select table_name, initial_extent, next_extent from dba_tables
2 where owner="LOCALUSER";
TABLE_NAME INITIAL_EXTENT NEXT_EXTENT
------------------------------ -------------- -----------
LOCALTABLE 40960 20480
SQL> conn localuser/oracle
Connected.
SQL> alter table localtable
2 storage ( initial 60k next 60k );
storage ( initial 60k next 60k )
*
ERROR at line 2:
ORA-02203: INITIAL storage options not allowed
SQL> alter table localtable
2 storage ( next 60k);
alter table localtable
*
ERROR at line 1:
ORA-25150: ALTERING of extent parameters not permitted
SQL> spool off;
dictionary ÀÏ °æ¿ì table »ý¼º½Ã storageÀý¿¡¼ initial, next¸¦ ¸¾´ë·Î Á¤ÇÒ ¼ö ÀÖ°í Àû¿ëµÇ³ª, º¯°æ½Ã¿¡´Â initialÀº ºÒ°¡´É next´Â °¡´É, locally tablespaceÀÇ °æ¿ì, table»ý¼º½Ã initialÀº ¸¾´ë·Î º¯°æÇصµ tablespace ¼³Á¤À» µû¸£¸ç Å×À̺í»ý¼º½Ã Á¤ÇÑ °ÍÀº ¹«½ÃµÊ, nextÀÇ °æ¿ì table »ý¼º½Ã ¼³Á¤À» µû¸§¸ç Àû¿ëµÊ
¶ÇÇÑ locallyÀÇ °æ¿ì initial , next º¯°æ ºÒ°¡´É
|