RAW£¬ÀàËÆÓÚCHAR£¬ÉùÃ÷·½Ê½RAW(L)£¬LΪ³¤¶È£¬ÒÔ×Ö½ÚΪµ¥Î»£¬×÷ΪÊý¾Ý¿âÁÐ×î´ó2000£¬×÷Ϊ±äÁ¿×î´ó32767×Ö½Ú¡£
LONG RAW£¬ÀàËÆÓÚLONG£¬×÷ΪÊý¾Ý¿âÁÐ×î´ó´æ´¢2G×Ö½ÚµÄÊý¾Ý£¬×÷Ϊ±äÁ¿×î´ó32760×Ö½Ú
²åÈërawÊý¾Ý²Ù×÷:
¡¡¡¡insert into raw_test values (1, hextoraw('ff'));
¡¡¡¡insert into raw_test values (utl_raw.cast_to_raw('051'));
¡¡¡¡É¾³ý±í²Ù×÷:
¡¡¡¡drop table raw_test;
¡¡¡¡µ±Ê¹ÓÃHEXTORAWʱ£¬»á°Ñ×Ö·û´®ÖÐÊý¾Ýµ±×÷16½øÖÆÊý¡£¶øʹÓÃUTL_RAW.CAST_TO_RAWʱ£¬Ö±½Ó°Ñ×Ö·û´®ÖÐÿ¸ö×Ö·ûµÄASCIIÂë´æ·Åµ½RAWÀàÐ͵Ä×Ö¶ÎÖÐ.
¡¡¡¡¿ÉÒÔʹÓÃdumpº¯Êý£¬²éѯ´æ´¢Çé¿ö£º
¡¡¡¡select id,raw_date, dump(raw_date, 16) dump_raw from raw_test;
¡¡¡¡OracleÖÐRAWºÍVarchar2³£ÓõÄÁ½¸öת»»º¯Êý
¡¡¡¡1. UTL_RAW.CAST_TO_RAW
¡¡¡¡¸Ãº¯Êý°´ÕÕȱʡ×Ö·û¼¯£¨Ò»°ãΪGB2312£©£¬½«VARCHAR2×Ö·û´®×ª»»ÎªRAW¡£
¡¡¡¡insert into cmpp_submit (dest_terminal_id,msg_content) values('13001081371',UTL_RAW.CAST_TO_RAW('ÄúºÃ£¡'));
¡¡¡¡2. UTL_RAW.CAST_TO_VARCHAR2
¡¡¡¡¸Ãº¯Êý°´ÕÕȱʡ×Ö·û¼¯ºÏ£¨Ò»°ãΪGB2312£©£ ......
oracle¿Í»§¶ËplsqlÉèÖÃ(windows7) ÔÚwindows7°²×°plsqlÒÔ·ÃÎÊ·þÎñÆ÷ÉϵÄoracleÊý¾Ý¿â
1. ÔÚ¹ÙÍøÏÂÔØoracle database 10g client£¬°²×°Ê±Ñ¡Ôñinstant client£¬°´Ä¬ÈÏÉèÖð²×°
2. °²×°»òʹÓÃÂÌÉ«°æµÄplsql
3. ÔÚplsqlĿ¼ÏÂÕÒµ½(»òн¨)Îļþtnsnames.ora£¬¿ÉÖظ´Ìí¼ÓÈçÏ¶Σº
MYNAME =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = oradb)
)
)
ÆäÖÐMYNAMEËæÒâÉèÖã¬HOSTÌîд·þÎñÆ÷Ö÷»úIPµØÖ·£¬POSTʹÓÃĬÈϵÄ1521£¬SERVICE_NAMEÌîдĿ±êÊý¾Ý¿âµÄÍøÂç·þÎñÃû¡£
×¢£ºÈô°²×°oracleÖ®ºó£¬ÔÚ{ORACLE_HOME}/NETWORK/ADMIN/ÏÂÓÐÈý¸öÅäÖÃÎļþ£ºsqlnet.ora, tnsnames.ora, listener.ora
4. ÔÚÎҵĵçÄÔÉÏÓÒ¼üÊôÐÔ--¸ß¼¶ÏµÍ³ÉèÖÃ--¸ß¼¶--»·¾³±äÁ¿£¬Ð½¨Óû§±äÁ¿£º
±äÁ¿Ãû£ºNLS_LANG
±äÁ¿Öµ£ºAMERICAN_AMERICA.UTF8
ÒÔ½â¾öÊý¾Ý¿â±íÖеÄÖÐÎÄÂÒÂëÎÊÌâ¡£
......
´ËÎÄ´ÓÒÔϼ¸¸ö·½ÃæÀ´ÕûÀí¹ØÓÚ·ÖÇø±íµÄ¸ÅÄî¼°²Ù×÷:
1.±í¿Õ¼ä¼°·ÖÇø±íµÄ¸ÅÄî
2.±í·ÖÇøµÄ¾ßÌå×÷ÓÃ
3.±í·ÖÇøµÄÓÅȱµã
4.±í·ÖÇøµÄ¼¸ÖÖÀàÐͼ°²Ù×÷·½·¨
5.¶Ô±í·ÖÇøµÄά»¤ÐÔ²Ù×÷.
(1.) ±í¿Õ¼ä¼°·ÖÇø±íµÄ¸ÅÄî
±í¿Õ¼ä£º
¡¡¡¡ÊÇÒ»¸ö»ò¶à¸öÊý¾ÝÎļþµÄ¼¯ºÏ£¬ËùÓеÄÊý¾Ý¶ÔÏ󶼴æ·ÅÔÚÖ¸¶¨µÄ±í¿Õ¼äÖУ¬µ«Ö÷Òª´æ·ÅµÄÊÇ±í£¬ ËùÒÔ³Æ×÷±í¿Õ¼ä¡£
·ÖÇø±í£º
µ±±íÖеÄÊý¾ÝÁ¿²»¶ÏÔö´ó£¬²éѯÊý¾ÝµÄËٶȾͻá±äÂý£¬Ó¦ÓóÌÐòµÄÐÔÄܾͻáϽµ£¬Õâʱ¾ÍÓ¦¸Ã¿¼ÂǶԱí½øÐзÖÇø¡£±í½øÐзÖÇøºó£¬Âß¼ÉϱíÈÔÈ»ÊÇÒ»ÕÅÍêÕûµÄ±í£¬Ö»Êǽ«±íÖеÄÊý¾ÝÔÚÎïÀíÉÏ´æ·Åµ½¶à¸ö±í¿Õ¼ä(ÎïÀíÎļþÉÏ)£¬ÕâÑù²éѯÊý¾Ýʱ£¬²»ÖÁÓÚÿ´Î¶¼É¨ÃèÕûÕÅ±í¡£
( 2).±í·ÖÇøµÄ¾ßÌå×÷ÓÃ
OracleµÄ±í·ÖÇø¹¦ÄÜͨ¹ý¸ÄÉƿɹÜÀíÐÔ¡¢ÐÔÄܺͿÉÓÃÐÔ£¬´Ó¶øΪ¸÷ʽӦÓóÌÐò´øÀ´Á˼«´óµÄºÃ´¦¡£Í¨³££¬·ÖÇø¿ÉÒÔʹijЩ²éѯÒÔ¼°Î¬»¤²Ù×÷µÄÐÔÄÜ´ó´óÌá¸ß¡£´ËÍâ,·ÖÇø»¹¿ÉÒÔ¼«´ó¼ò»¯³£¼ûµÄ¹ÜÀíÈÎÎñ£¬·ÖÇøÊ ......
ʵÀý¶Ô±ÈOracleÖÐtruncateºÍdeleteµÄÇø±ð
ɾ³ý±íÖеÄÊý¾ÝµÄ·½·¨ÓÐdelete,truncate,
ËüÃǶ¼ÊÇɾ³ý±íÖеÄÊý¾Ý,¶ø²»ÄÜɾ³ý±í½á¹¹,delete ¿ÉÒÔɾ³ýÕû¸ö±íµÄÊý¾ÝÒ²¿ÉÒÔɾ³ý±íÖÐijһÌõ»òNÌõÂú×ãÌõ¼þµÄÊý¾Ý,¶øtruncateÖ»ÄÜɾ³ýÕû¸ö±íµÄÊý¾Ý,Ò»°ãÎÒÃÇ°Ñdelete ²Ù×÷ÊÕ×÷ɾ³ý±í,¶øtruncate²Ù×÷½Ð×÷½Ø¶Ï±í.
truncate²Ù×÷Óëdelete²Ù×÷¶Ô±È
²Ù×÷
»Ø¹ö
¸ßË®Ïß
¿Õ¼ä
ЧÂÊ
Truncate
²»ÄÜ
Ͻµ
»ØÊÕ
¿ì
delete
¿ÉÒÔ
²»±ä
²»»ØÊÕ
Âý
ÏÂÃæ·Ö±ðÓÃʵÀý²é¿´ËüÃǵIJ»Í¬
1.»Ø¹ö
Ê×ÏÈÒªÃ÷°×Á½µã
1.ÔÚoracle ÖÐÊý¾Ýɾ³ýºó»¹ÄܻعöÊÇÒòΪËü°ÑÔʼÊý¾Ý·Åµ½ÁËundo±í¿Õ¼ä,
2.DMLÓï¾äʹÓÃundo±í¿Õ¼ä,DDLÓï¾ä²»Ê¹ÓÃundo,¶ødeleteÊÇDMLÓï¾ä,truncateÊÇDDLÓï¾ä,±ðÍâDDLÓï¾äÊÇÒþʽÌá½».
ËùÒÔtruncate²ÙÓò»Äܻعö,¶ødelete²Ù×÷¿ÉÒÔ.
Á½ÖÖ²Ù×÷¶Ô±È(Ê×ÏÈн¨Ò»¸ö±í,²¢²åÈëÊý¾Ý)
SQL> create table t
2 (
3 i number
4 );
Table created.
SQL> insert into t values(10);
SQL> commit;
Commit complete.
SQL> select * from t;
I
----------
......
¶ÔoracleÒѾѧϰÈý¸ö¶à4£¬¿ÉÒÔ²âÊÔÓÃһЩ¸´ÔÓµÄ×éºÏ£» 5£¬ËüÉú³ÉµÄ²âÊÔÓÃÀýÊÇÓм£¿ÉÑÈÕ£¬¼´ÓйæÂɵģ¬²»ÏñÊÖ¹¤²âÊÔÄÇÑù»áÒÅ©һЩÓÃÀýµÄ×éºÏ¡£ 3 Ñ¡ÔñOATSµÄ»ù±¾ÔÔòÒ»°ã¶¼ÊÇÏÈÈ·¶¨²âÊÔµÄÒòËØ¡¢Ë®Æ½ºÍ½»»¥×÷Ó㬺óÑ¡ÔñÊÊÓõÄÕý½»±í¡£ÔÚÈ·¶¨ÒòËصÄˮƽÊýʱ£¬Ö÷ÒªÒòËØÓ¦¸Ã¶à°²Åż¸¸öˮƽ£¬´ÎÒªÒòËØ¿ÉÉÙ°²Åż¸¸öˮƽ¡£ £¨1ÖØÇìÈí¼þÅàѵ£©ÏÈ¿´Ë®Æ½Êý¡£Èô¸÷ÒòËØÈ«ÊÇ2ˮƽ£¬¾ÍÑ¡ÓÃL(2£ª)±í£»Èô¸÷ÒòËØÈ«ÊÇ3ˮƽ£¬¾ÍÑ¡L(3£ª)±í¡£Èô¸÷ÒòËصÄˮƽÊý²»Ïàͬ£¬¾ÍÑ¡ÔñÊÊÓõĻìºÏˮƽÕý½»±í¡£ £¨2£©Ã¿Ò»¸ö½»»¥×÷ÓÃÔÚÕý½»±íÖÐÓ¦Õ¼Ò»Áлò¶þÁС£Òª¿´ËùÑ¡µÄÕý½»±íÊÇ·ñ×ã¹»´ó£¬ÄÜ·ñÈÝÄɵÃÏÂËù¿¼ÂǵÄÒòËغͽ»»¥×÷Óá£ÎªÁ˶ÔÊÔÑé½á¹û½øÐз½²î·ÖÎö»ò»Ø¹é·ÖÎö£¬»¹±ØÐëÖÁÉÙÁôÒ»¸ö¿Õ°×ÁУ¬×÷Ϊ“Îó²î”ÁУ¬ÔÚ¼«²î·ÖÎöÖÐÒª×÷Ϊ“ÆäËûÒòËØ&rdquo.Êý¾Ý¿â¼¯Èº
¹Ø¼ü×Ö£ºOATS£º¼´Orthogonal Array ¼¯£¬Õâ¸ö¼¯ºÏ£¬°üÀ¨×îÉٵIJâÊÔÓÃÀý£¬;Áд¦Àí¡£ £¨3£©Òª¿´²âÊÔ¾«¶ÈµÄÒªÇó¡£ÈôÒªÇó¸ß£¬ÔòÒËÈ¡²âÊÔ´ÎÊý¶àµÄÕý½»±í¡£ £¨4£©Èô²âÊÔ·ÑÓúܰº¹ó£¬»ò²âÊԵľ·ÑºÜÓÐÏÞ£¬»òÈËÁ¦ºÍʱ¼ä¶¼±È½Ï½ôÕÅ£¬Ôò²»ÒËѡʵÑé´ÎÊýÌ«¶àµÄÕý½»±í¡£ £¨5£©°´ÔÀ´¿¼ÂǵÄÒòËØ¡¢Ë®Æ½ºÍ½»»¥×÷ÓÃȥѡÔñÕý½»±í£¬Èô ......
Ò»£®ÒýÑÔ
ORACLEÊý¾Ý¿â×Ö·û¼¯£¬¼´OracleÈ«Çò»¯Ö§³Ö(Globalization Support)£¬»ò¼´¹ú¼ÒÓïÑÔÖ§³Ö£¨NLS£©Æä×÷ÓÃÊÇÓñ¾¹úÓïÑԺ͸ñʽÀ´´æ´¢¡¢´¦ÀíºÍ¼ìË÷Êý¾Ý¡£ÀûÓÃÈ«Çò»¯Ö§³Ö£¬ORACLEΪÓû§Ìṩ×Ô¼ºÊìϤµÄÊý¾Ý¿âĸÓï»·¾³£¬ÖîÈçÈÕÆÚ¸ñʽ¡¢Êý×Ö¸ñʽºÍ´æ´¢ÐòÁеȡ£Oracle¿ÉÒÔÖ§³Ö¶àÖÖÓïÑÔ¼°×Ö·û¼¯£¬ÆäÖÐoracle8iÖ§³Ö48ÖÖÓïÑÔ¡¢76¸ö¹ú¼ÒµØÓò¡¢229ÖÖ×Ö·û¼¯£¬¶øoracle9iÔòÖ§³Ö57ÖÖÓïÑÔ¡¢88¸ö¹ú¼ÒµØÓò¡¢235ÖÖ×Ö·û¼¯¡£ÓÉÓÚoracle×Ö·û¼¯ÖÖÀà¶à£¬ÇÒÔÚ´æ´¢¡¢¼ìË÷¡¢Ç¨ÒÆoracleÊý¾Ýʱ¶à¸ö»·½ÚÓë×Ö·û¼¯µÄÉèÖÃÃÜÇÐÏà¹Ø£¬Òò´ËÔÚʵ¼ÊµÄÓ¦ÓÃÖУ¬Êý¾Ý¿â¿ª·¢ºÍ¹ÜÀíÈËÔ±¾³£»áÓöµ½ÓйØoracle×Ö·û¼¯·½ÃæµÄÎÊÌâ¡£±¾ÎÄͨ¹ýÒÔϼ¸¸ö·½Ãæ²ûÊö£¬¶Ôoracle×Ö·û¼¯×ö¼òÒª·ÖÎö
¶þ£®×Ö·û¼¯»ù±¾ÖªÊ¶
2.1×Ö·û¼¯
ʵÖʾÍÊÇ°´ÕÕÒ»¶¨µÄ×Ö·û±àÂë·½°¸£¬¶ÔÒ»×éÌض¨µÄ·ûºÅ£¬·Ö±ð¸³Ó費ͬÊýÖµ±àÂëµÄ¼¯ºÏ¡£OracleÊý¾Ý¿â×îÔçÖ§³ÖµÄ±àÂë·½°¸ÊÇUS7ASCII¡£
OracleµÄ×Ö·û¼¯ÃüÃû×ñÑÒÔÏÂÃüÃû¹æÔò:
<Language><bit size><encoding>
¼´: <ÓïÑÔ><±ÈÌØλÊý><±àÂë>
±ÈÈç ......