±±´óÇàÄñoracleѧϰ±Ê¼Ç3
»¹ÊǽèÖúoracle sql developerÀ´²Ù×÷oracle£¬sql plus»¹ÊÇÂé·³Ò»µã¡£
¼òµ¥¿´ÁËһϣ¬Óï¾ä»ù±¾É϶¼ºÍÆäËûÊý¾Ý¿âµÄsql²î²»¶à£¬¼Ç¼һϲ»Í¬µÄµØ·½¡£
ÈÕÆÚÀàÐͱà¼
update student set stu_birthday = to_date('2010-03-06 13:14:20','yyyy-MM-dd HH24:mi:ss');
ÐèҪʹÓÃto_date()º¯Êý£¬SQLÖв»Çø·Ö´óСд£¬MMºÍmm±»ÈÏΪÊÇÏàͬµÄ¸ñʽ´úÂ룬ËùÒÔOracleµÄSQL²ÉÓÃÁËmi´úÌæ·ÖÖÓ¡£
ÕâÀï·¢ÏÖ×¢ÊÍsqlʹÓÃ-- ¶ø²»ÊÇ//
ÕâÀïÉèÖÃÁËÈÕÆÚÒÔºóʹÓÃselectÃüÁî²é³öÀ´µÄ¸ñʽÊÇ 06-3Ô -10 ÕâÑù×ӵģ¬²»·ûºÏÏ°¹ß£¬¿ÉÒÔͨ¹ýÐ޸ĻỰµÄ·½Ê½¡£
alter session set NLS_date_format = 'yyyy-mm-dd';
Ð޸ĵ±Ç°»á»°µÄÈÕÆÚÏÔʾ¸ñʽ¡£ÐÞ¸ÄÍêºóselect½á¹û¾ÍÏÔʾΪ2010-03-06
Õª×Ôgoogle½á¹û£º
Êý¾ÝÀàÐÍ£¨datatype£©ÊÇÁУ¨column£©»ò´æ´¢¹ý³ÌÖеÄÒ»¸öÊôÐÔ¡£
OracleÖ§³ÖµÄÊý¾ÝÀàÐÍ¿ÉÒÔ·ÖΪÈý¸ö»ù±¾ÖÖÀࣺ×Ö·ûÊý¾ÝÀàÐÍ¡¢Êý×ÖÊý¾ÝÀàÐÍÒÔ¼°±íʾÆäËüÊý¾ÝµÄÊý¾ÝÀàÐÍ¡£
×Ö·ûÊý¾ÝÀàÐÍ
CHAR CHARÊý¾ÝÀàÐÍ´æ´¢¹Ì¶¨³¤¶ÈµÄ×Ó·ûÖµ¡£Ò»¸öCHARÊý¾ÝÀàÐÍ¿ÉÒÔ°üÀ¨1µ½2000¸ö×Ö·û¡£Èç¹û¶ÔCHARûÓÐÃ÷È·µØ˵Ã÷³¤¶È£¬ËüµÄĬÈϳ¤¶ÈÔòÉèÖÃΪ1.Èç¹û¶Ôij¸öCHARÀàÐͱäÁ¿¸³Öµ£¬Æ䳤¶ÈСÓڹ涨µÄ³¤¶È£¬ÄÇôOracle×Ô¶¯ÓÿոñÌî³ä¡£
VARCHAR2´æ´¢¿É±ä³¤¶ÈµÄ×Ö·û´®¡£ËäȻҲ±ØÐëÖ¸¶¨Ò»¸öVARCHAR2Êý¾Ý±äÁ¿µÄ³¤¶È£¬µ«ÊÇÕâ¸ö³¤¶ÈÊÇÖ¸¶Ô¸Ã±äÁ¿¸³ÖµµÄµÄ×î´ó³¤¶È¶ø·Çʵ¼Ê¸³Öµ³¤¶È¡£²»ÐèÒªÓÿոñÌî³ä¡£×î¶à¿ÉÉèÖÃΪ4000¸ö×Ö·û¡£
ÒòΪVARCHAR2Êý¾ÝÀàÐÍÖ»´æ´¢Îª¸ÃÁÐËù¸³µÄ×Ö·û£¨²»¼Ó¿Õ¸ñ£©£¬ËùÒÔVARCHAR2ÐèÒªµÄ´æ´¢¿Õ¼ä±ÈCHARÊý¾ÝÀàÐÍҪС¡£
OracleÍƼöʹÓÃVARCHAR2
NCHARºÍNVARCHAR2 NCHARºÍNVARCHAR2Êý¾ÝÀàÐÍ·Ö±ð´æ´¢¹Ì¶¨³¤¶ÈÓë¿É±ä³¤¶ÈµÄ×Ö·ûÊý¾Ý£¬µ«ÊÇËüÃÇʹÓõÄÊǺÍÊý¾Ý¿âÆäËûÀàÐͲ»Í¬µÄ×Ö·û¼¯¡£ÔÚ´´½¨Êý¾Ý¿âʱ£¬ÐèÒªÖ¸ ¶¨ËùʹÓõÄ×Ö·û¼¯£¬ÒÔ±ã¶ÔÊý¾Ý¿âÖÐÊý¾Ý½øÐбàÂë¡£»¹¿ÉÒÔÖ¸¶¨Ò»¸ö¸¨ÖúµÄ×Ö·û¼¯£Û¼´±¾µØÓïÑÔ¼¯£¨National Language Set£¬¼ò³ÆNLS£©£Ý¡£NCHARºÍNVARCHAR2ÀàÐ͵ÄÁÐʹÓø¨Öú×Ö·û¼¯¡£
ÔÚOracle9iÖУ¬¿ÉÒÔÒÔ×Ö·û¶ø²»ÊÇ×Ö½ÚΪµ¥Î»À´±íʾNCHARºÍNVARCHAR2Áеij¤¶È¡£
LONG LONGÊý¾ÝÀàÐÍ¿ÉÒÔ´æ·Å2GBµÄ×Ö·ûÊý¾Ý£¬ËüÊÇ´ÓÔçÆÚ°æ±¾Öм̳ÐÀ´µÄ¡£ÏÖÔÚÈç¹ûÏë´æ´¢´ó
Ïà¹ØÎĵµ£º
Òª½â¾öOracleµÄ¿Í»§¶ËÂÒÂëÎÊÌâ¹Ø¼üÊÇÒª°Ñ·þÎñÆ÷¶ËʹÓõÄ×Ö·û¼¯¸ú¿Í»§¶ËʹÓõÄ×Ö·û¼¯Í³Ò»ÆðÀ´¡£Oracle¿Í»§¶Ë£¨Sqlplus£©Í¨¹ýNLS_LANG»·¾³±äÁ¿À´È·¶¨¿Í»§¶ËʹÓõÄ×Ö·û¼¯¡£NLS_LANG
²ÎÊýÓÉÒÔϲ¿·Ö×é³É:
NLS_LANG
=<Language>_<Territory>.<Clients Characterset>
NLS_LANG
¸÷²¿·Öº¬ÒåÈçÏÂ:
LANGUAGEÖ ......
£¨1£©¶Ôwindows»úÆ÷£º
#½«Oracle installclientѹËõ°ü¿½±´µ½D:\oracle£¬²¢Ñ¡Ôñ½âѹÖÁµ±Ç°Ä¿Â¼£¨»òÆäËûĿ¼£¬¼ÇµÃ¸ü¸ÄÏàÓ¦µÄ»·¾³±äÁ¿¼´¿É£©
#ÉèÖû·¾³±äÁ¿£º
Path£¨ÔÚ±äÁ¿ÖмÓÈ룩 ......
OracleÊý¾Ýµ¼Èëµ¼³öimp/exp¾ÍÏ൱ÓÚoracleÊý¾Ý»¹ÔÓ뱸·Ý¡£expÃüÁî¿ÉÒÔ°ÑÊý¾Ý´ÓÔ¶³ÌÊý¾Ý¿â·þÎñÆ÷µ¼³öµ½±¾µØµÄdmpÎļþ£¬impÃüÁî¿ÉÒÔ°ÑdmpÎļþ´Ó±¾µØµ¼Èëµ½Ô¶´¦µÄÊý¾Ý¿â·þÎñÆ÷ÖС£ ÀûÓÃÕâ¸ö¹¦ÄÜ¿ÉÒÔ¹¹½¨Á½¸öÏàͬµÄÊý¾Ý¿â£¬Ò»¸öÓÃÀ´²âÊÔ£¬Ò»¸öÓÃÀ´ÕýʽʹÓá£
Ö´Ðл·¾³£º¿ÉÒÔÔÚSQLPLUS.EXE»òÕßDOS£¨ÃüÁîÐУ©ÖÐÖ´Ð ......
Êʵ±µÄʹÓÃË÷Òý¿ÉÒÔÌá¸ßÊý¾Ý¼ìË÷Ëٶȣ¬¿ÉÒÔ¸ø¾³£ÐèÒª½øÐвéѯµÄ×ֶδ´½¨Ë÷Òý
oracleµÄË÷Òý·ÖΪ5ÖÖ:ΨһË÷Òý£¬×éºÏË÷Òý£¬·´Ïò¼üË÷Òý£¬Î»Í¼Ë÷Òý£¬»ùÓÚº¯ÊýµÄË÷Òý
´´½¨Ë÷ÒýµÄ±ê×¼Óï·¨:
CREATE INDEX Ë÷ÒýÃû ON ±íÃû (ÁÐÃû)
TABLESPACE ±í¿Õ¼äÃû;
´´½¨Î¨Ò»Ë÷Òý:
CREATE unique INDEX Ë÷ÒýÃû ......
start d:\a.sql
@ d:\a.sql
edit [d:\a.sql]
spool d:\a.sql ½«ÆÁÉÏÄÚÈÝ Êä³öµ½Ö¸¶¨Îļþ
spool off
set linesize 320
set pagesize 100
set autoprint on
set serveroutput on
variable v1 refcursor
exp imp ±¸·Ý »Ö
Ö»¶ÁÊÂÎñ
set transaction read only
Óô¦£¬ÉèÖà ......