Oracle Êý¾ÝÀàÐͼ°´æ´¢·½Ê½
Ô¬¹â¶« Ô´´
¸ÅÊö
ͨ¹ýʵÀý£¬È«Ãæ¶øÉîÈëµÄ·ÖÎöoralceµÄ»ù±¾Êý¾ÝÀàÐͼ°ËüÃǵĴ洢·½Ê½¡£ÒÔORACLE 10GΪ»ù´¡£¬½éÉÜoralce 10gÒýÈëµÄеÄÊý¾ÝÀàÐÍ¡£ÈÃÄã¶ÔoracleÊý¾ÝÀàÐÍÓÐÒ»¸öȫеÄÈÏʶ¡£½ÒʾһЩ²»ÎªÈËÖªµÄÃØÃܺͱ»ºöÂÔµÄäµã¡£´ÓʵÓúÍÓÅ»¯µÄ½Ç¶È³ö·¢£¬ÌÖÂÛÿÖÖÊý¾ÝÀàÐ͵ÄÌØµã¡£´ÓÕâÀ↑ʼoracleÖ®Âã¡
µÚÒ»²¿·Ý ×Ö·ûÀàÐÍ
§1.1 char
¶¨³¤×Ö·û´®£¬»áÓÿոñÀ´Ìî³äÀ´´ïµ½Æä×î´ó³¤¶È,×2000¸ö×Ö½Ú¡£
1£® н¨Ò»¸ö²âÊÔ±ítest_char.,Ö»ÓÐÒ»¸öcharÀàÐ͵ÄÁС£³¤¶ÈΪ10
SQL> create table test_char(colA char(10));
Table created
2£® ÏòÕâ¸ö±íÖвåÈëһЩÊý¾Ý¡£
SQL> insert into test_char values('a');
1 row inserted
SQL> insert into test_char values('aa');
1 row inserted
SQL> insert into test_char values('aaa');
1 row inserted
SQL> insert into test_char values('aaaa');
1 row inserted
SQL> insert into test_char values('aaaaaaaaaa');
1 row inserted
×¢Ò⣺×î¶àÖ»ÄܲåÈë10¸ö×Ö½Ú¡£·ñÊǾͱ¨´í¡£
SQL> insert into test_char values('aaaaaaaaaaa');
insert into test_char values('aaaaaaaaaaa')
ORA-12899: value too large for column "PUB_TEST"."TEST_CHAR"."COLA" (actual: 11, maximum: 10)
3£® ʹÓÃdumpº¯Êý¿ÉÒԲ鿴ÿһÐеÄÄÚ²¿´æÊý½á¹¹¡£
SQL> select colA, dump(colA) from test_char;
COLA DUMP(COLA)
---------- --------------------------------------------------------------------------------
a Typ=96 Len=10: 97,32,32,32,32,32,32,32,32,32
aa Typ=96 Len=10: 97,97,32,32,32,32,32,32,32,32
aaa Typ=96 Len=10: 97,97,97,32,32,32,32,32,32,32
aaaa Typ=96 Len=10: 97,97,97,97,32,32,32,32,32,32
aaaaaaaaaa Typ=96 Len=10: 97,97,97,97,97,97,97,97,97,97
×¢Ò⣺Typ=96 ±íʾÊý¾ÝÀàÐ͵ÄID¡£OracleΪÿһÖÖÊý¾ÝÀàÐͶ¼½øÐÐÁ˱àºÅ¡£ËµÃ÷charÀàÐ͵ıàºÅÊÇ96.
Len =10 ±íʾËùÔÚµÄÄÚ²¿´æ´¢µÄ³¤¶È(ÓÃ×Ö½Ú±íʾ)¡£ËäÈ»µÚÒ»ÀýÖ»´æÁËÒ»¸ö×Ö·û
ËäȻѧϰJavaºÜ¾ÃÁË£¬×Ô¼ºÒ²Á¬½Ó¹ýһЩÊý¾Ý¿â£¬±ÈÈçmysqlÖ®ÀàµÄ£¬Èç½ñÄØ£¬Ò²Ñ§Ï°ÁËÒ»¶Îʱ¼äµÄOracle£¬È»¶øÄØ£¬½ñÌìÊÇÎÒµÚÒ»´ÎÁ¬½ÓOracle£¬ºÙºÙ£¬Ó¦¸Ã»¹²»ËãÌ«³Ù°É¡£
½ñÌìÄØ£¬Óе㱿׾£¬´ó¼ÒĪЦ£¡
ÎÒÕâÊÇÒ»¸ö²éѯÀý×Ó
Ê×ÏÈ£¬Ô ......
¾Û¼¯(cluster)ÊÇ´æ´¢±íÊý¾ÝµÄ¿ÉÑ¡ÔñµÄ·½·¨¡£Ò»¸ö¾Û¼¯ÊÇÒ»×é±í£¬½«¾ßÓÐͬһ¹«¹²ÁÐÖµµÄÐд洢ÔÚÒ»Æð£¬²¢ÇÒËüÃǾ³£Ò»ÆðʹÓá£ÕâЩ¹«¹²Áй¹³É¾Û¼¯Âë¡£
¾³£±»Í¬Ê±·ÃÎʵıíÔÚÎïÀíλÖÃÉÏ¿ÉÒÔ´æ´¢ÔÚÒ»Æð¡£ÎªÁ˽«ËüÃÇ´æ´¢ÔÚÒ»Æð£¬¾ÍÒª´´½¨Ò»¸ö´Ø( c l u s t e r )À´¹ÜÀíÕâЩ±í¡£±íÖеÄÊý¾ÝÒ»Æð´æ´¢ÔÚ´ØÖУ¬´Ó¶ø×îС»¯±ØÐëÖ´ÐеÄI ......
ÒòΪÏîĿijЩģ¿éµÄÊý¾Ý½á¹¹Éè¼ÆÃ»ÓÐÑϸñ°´ÕÕij¹æ·¶Éè¼Æ£¬ËùÒÔÖ»ÄÜ´ÓÊý¾Ý¿âÖвéѯÊý¾Ý½á¹¹£¬ÐèÒª²éѯµÄÐÅÏ¢ÈçÏ£º×Ö¶ÎÃû³Æ¡¢Êý¾ÝÀàÐÍ¡¢ÊÇ·ñΪ¿Õ¡¢Ä¬ÈÏÖµ¡¢Ö÷¼ü¡¢Íâ¼üµÈµÈ¡£
ÔÚÍøÉÏËÑË÷Á˲éѯÉÏÊöÐÅÏ¢µÄ·½·¨£¬×ܽáÈçÏ£º
Ò»£¬²éѯ±í»ù±¾ÐÅÏ¢
select
utc.column_name,utc.data_type,utc.data_le ......
in ÊǰÑÍâ±íºÍÄÚ±í×÷hash Á¬½Ó£¬¶øexistsÊǶÔÍâ±í×÷loopÑ»·£¬Ã¿´ÎloopÑ»·ÔÙ¶ÔÄÚ±í½øÐвéѯ¡£
Ò»Ö±ÒÔÀ´ÈÏΪexists±ÈinЧÂʸߵÄ˵·¨ÊDz»×¼È·µÄ¡£
Èç¹û²éѯµÄÁ½¸ö±í´óСÏ൱£¬ÄÇôÓÃinºÍexists²î±ð²»´ó¡£
in ÊǰÑÍâ±íºÍÄÚ±í×÷hash
Á¬½Ó£¬¶øexistsÊǶÔÍâ±í×÷loopÑ»·£¬Ã¿´ÎloopÑ»·ÔÙ¶ÔÄÚ±í½øÐвéѯ¡£
Ò»Ö±ÒÔ ......