ORACLE ºÁÃëת»»ÎªÈÕÆÚ ÈÕÆÚת»»ºÁÃë
--ÈÕÆÚת»»ºÁÃë
SELECT TO_NUMBER(TO_DATE('2005-03-29 12:30:45', 'YYYY-MM-DD HH24:MI:SS') -
TO_DATE('1970-01-01 8:0:0', 'YYYY-MM-DD HH24:MI:SS')) * 24 * 60 * 60 * 1000
from DUAL;
--ºÁÃëת»»ÈÕÆÚ
SELECT TO_CHAR(1112070645000 / (1000 * 60 * 60 * 24) +
TO_DATE('1970-01-01 08:00:00', 'YYYY-MM-DD HH:MI:SS'), 'YYYY-MM-DD HH:MI:SS') AS CDATE
from DUAL;
Ïà¹ØÎĵµ£º
1£©´ÓʹÓÃÉÏÀ´Ëµ£¬oci±ØÐëÔÚ¿Í»§»úÉϰ²×°oracle¿Í»§¶Ë»ò²ÅÄÜÁ¬½Ó£¬¶øthin¾Í²»ÐèÒª£¬Òò´Ë´ÓʹÓÃÉÏÀ´½²thin»¹ÊǸü¼Ó·½±ã£¬ÕâÒ²ÊÇthin±È½Ï³£¼ûµÄÔÒò¡£
2£©ÔÀíÉÏÀ´¿´£¬thinÊÇ´¿javaʵÏÖtcp/ipµÄc/sͨѶ£»¶øoci·½Ê½,¿Í»§¶Ëͨ¹ýnative java methodµ÷ÓÃc library·ÃÎÊ·þÎñ¶Ë£¬¶øÕâ¸öc library¾ÍÊÇoci(oracle called interface ......
×Ö·ûÀàÐÍ£º
CHAR(size)£º¹Ì¶¨³¤¶È×Ö·û´®£¬×î´ó³¤¶È2000 bytes
VARCHAR2(size)£º¿É±ä³¤¶ÈµÄ×Ö·û´®£¬×î´ó³¤¶È4000 bytes£¬¿É×öË÷ÒýµÄ×î´ó³¤¶È749
NCHAR(size)£º¸ù¾Ý×Ö·û¼¯¶ø¶¨µÄ¹Ì¶¨³¤¶È×Ö·û´®£¬×î´ó³¤¶È2000 bytes
NVARCHAR2(size)£º¸ù¾Ý×Ö·û¼¯¶ø¶¨µÄ¿É±ä³¤¶È×Ö·û´®£¬×î´ó³¤¶È4000 byte
LONG£º±ä³¤µÄ×Ö·û´®£¬×î´ó³¤¶ÈÏÞ ......
Ò»¡¢Êý¾Ý¿â
Êý¾Ý¿â¹ËÃû˼ÒåÊÇÊý¾ÝµÄ¼¯ºÏ£¬¶øOracleÔòÊǹÜÀíÕâЩÊý¾Ý¼¯ºÏµÄÈí¼þϵͳ£¬ËüÊÇÒ»¸ö¶ÔÏó¹ØÏµÐ͵ÄÊý¾Ý¿â¹ÜÀíϵͳ¡£
¶þ¡¢±í¿Õ¼ä
±í¿Õ¼äÊÇOracle¶ÔÎïÀíÊý¾Ý¿âÉÏÏà¹ØÊý¾ÝµÄÂß¼Ó³Éä¡£Ò»¸öÊý¾Ý¿âÔÚÂß¼Éϱ»»®·Ö³ÉÒ»µ½Èô¸É¸ö±í¿Õ¼ä£¬Ã¿¸ö±í¿Õ¼ä°üº¬ÁËÔÚÂß¼ÉÏÏà¹ØÁªµÄÒ»×é½á¹¹¡£Ã¿¸öÊý¾Ý¿âÖ ......
1.´´½¨Ñ§Éú±í£º
CREATE TABLE student (
xh number primary key,
Name varchar2(10) not null);
2. ´´½¨ÐòÁУº
CREATE SEQUENCE student_seq
START WITH 1
INCREMENT BY 1
NOCACHE;
°´»Ø³ ......
SQLµÄÓÅ»¯Ó¦¸Ã´Ó
5
¸ö·½Ãæ½øÐе÷Õû£º
1.È¥µô²»±ØÒªµÄ´óÐͱíµÄÈ«±íɨÃè
2.»º´æÐ¡ÐͱíµÄÈ«±íɨÃè
3.¼ìÑéÓÅ»¯Ë÷ÒýµÄʹÓÃ
4.¼ìÑéÓÅ»¯µÄÁ¬½Ó¼¼Êõ
5.¾¡¿ÉÄܼõÉÙÖ´Ðмƻ®µÄ
Cost
SQLÓï¾ä£º
ÊǶÔÊý¾Ý¿â(
Êý¾Ý
)
½øÐвÙ×÷µÄΩһ;¾¶£»
ÏûºÄÁË70%~90%
µÄÊý¾Ý¿â×ÊÔ´£»¶ÀÁ¢ÓÚ³ÌÐòÉè¼ÆÂß¼£¬Ïà¶ÔÓÚ¶Ô³ÌÐòÔ´´úÂëµÄÓÅ»¯£¬ ......