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 ±íʾËùÔÚµÄÄÚ²¿´æ´¢µÄ³¤¶È(ÓÃ×Ö½Ú±íʾ)¡£ËäÈ»µÚÒ»ÀýÖ»´æÁËÒ»¸ö×Ö·û
ÉùÃ÷£ºÒÔÏÂÄÚÈÝת×Ô http://www.weixiuwang.com/Article/server/tech/200610/22126.html
1. ²éѯÕýÔÚÖ´ÐÐÓï¾äµÄÖ´Ðмƻ®(Ò²¾ÍÊÇʵ¼ÊÓï¾äÖ´Ðмƻ®)
select * from v$sql_plan where hash_value = (select sql_hash_value from v$session where sid = 1111);
ÆäÖÐidºÍparent_id±íʾ ......