ÔÚoracle±íÖÐÔõÑù´´½¨×ÔÔö³¤×Ö¶Î
.½¨Á¢²âÊÔÊý¾Ý±í
CREATE TABLE TEST
(
ID NUMBER PRIMARY KEY,
NAME VARCHAR2(20)
);
2.´´½¨ÐòÁÐ
CREATE SEQUENCE SEQ_TEST;
3.´´½¨´¥·¢Æ÷
CREATE OR REPLACE TRIGGER AUTOINCREMENT
BEFORE INSERT ON TEST
FOR EACH ROW
WHEN (NEW.ID IS NULL)
BEGIN
SELECT SEQ_TEST.NEXTVAL INTO :NEW.ID from DUAL;
END;
/
4.²åÈëÊý¾Ý
INSERT INTO TEST(NAME) VALUES('increase');
5.²é¿´²åÈë½á¹û
SELECT * from TEST;
Ïà¹ØÎĵµ£º
Oracle 9i±È8i¶àÁËÄÄЩÐÂÌØÐÔ£¿
¼òҪ˵£º
9i¸üÒ×ÓÚ¹ÜÀí¡£
Ïêϸ˵£º
²¢·¢¼¯Èº£¬8i OPSÉý¼¶Îª9i RAC£¬8i½áµã¼äÓÃÓ²Å̽»»»ÐÅÏ¢£¬9i½áµã¼ä²ÉÓøßËÙÍøÏߵĻº´æÈÛºÏ(Cache Fusion)¼¼Êõ½»»»ÐÅÏ¢£¬½»»»ËÙ¶ÈÌá¸ß100±¶ÒÔÉÏ¡£
9i¿ÉÒÔÔÚÏßÐÞ¸ÄÄں˲ÎÊýºÍÄÚ´ ......
µ±ÔËÐÐsqlplus.shµÄʱºò±¨³ö£º
/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/nls_lang.sh: 114: [[: not found
ºÜÆæ¹Ö
nls_lang.shµÄ114ÐÐǰºóÊÇÕâÑùµÄ
if [[ -n "$LC_ALL" ]]; then
locale=$LC_ALL
elif [[ -n "$LANG" ]]; then
locale=$LANG
else
locale=
fi
[[ÓдíÎ󣿲»¿ ......
¡¡¡¡¿Í»§ÓõÄÊý¾Ý¿âÊÇmysql£¬¶øÑз¢ºÃµÄ²úÆ·Ö§³Öoracle£¬ÎªÁËÈÿͻ§ÌÍÑü°ü£¬ÎÒÃDZØÐë°ÑÊý¾Ý¿â»·¾³´ÓoracleתÏòmysql¡£ÎÒÃÇÔÚת»»µÄ¹ý³ÌÖÐÅöµ½ÁËÏÂÃæÒ»Ð©ÎÊÌ⣬ϣÍûÄܸøÍ¬ÑùÔâÓöµÄͬÈÊÃÇһЩ½è¼ø¡£Èç¹ûÎÒÃÇÔÚ×î³õµÄÉè¼Æ¡¢±àÂë¹ý³ÌÖÐ×¢ÒâÊý¾Ý¿âµÄÒÆÖ²ÐÔ£¬ÕâÖÖÇé¿öÏ¿ÉÒÔÍêÈ«²»ÐèÒª×÷¶îÍ⹤×÷¡£
¡¡¡¡Ò»¡¢Êý¾Ý¿â»·¾³´Óoracleת ......
oracle ¿ÉÓÐʲô·½·¨ ͳ¼ÆÃ¿ÔÂÀÛ»ý¹ºÂòÈËÊý
±ÈÈç˵ÓиöÃŵê 2008Ä깺ÂòÉÌÆ·µÄÈËÊý
±í:t_buy_log ×Ö¶Î f_username Óû§Ãû³Æ;¹ºÂòʱ¼äf_buytime
1 Èç¹ûÊÇͳ¼ÆÃ¿Ô¹ºÂòÈËÊý
select to_char(f_buytime,'yyymm'),count(distinct f_username)
from t_buy_log
group by to_char(f_buytime,'yyymm')
......
OracleÊý¾Ý¿âÌṩÁ˼¸ÖÖ²»Í¬µÄÊý¾Ý¿âÆô¶¯ºÍ¹Ø±Õ·½Ê½£¬±¾ÎĽ«Ïêϸ½éÉÜÕâЩÆô¶¯ºÍ¹Ø±Õ·½Ê½Ö®¼äµÄÇø±ðÒÔ¼°ËüÃǸ÷×Ô²»Í¬µÄ¹¦ÄÜ¡£
Ò»¡¢Æô¶¯ºÍ¹Ø±ÕOracleÊý¾Ý¿â¡¡¡¡¶ÔÓÚ´ó¶àÊýOracle DBAÀ´Ëµ£¬Æô¶¯ºÍ¹Ø±ÕOracleÊý¾Ý¿â×î³£Óõķ½Ê½¾ÍÊÇÔÚÃüÁîÐз½Ê½ÏµÄServer Manager¡£´ÓOracle 8iÒÔºó£¬ÏµÍ³½«Server ManagerµÄËùÓй¦Äܶ¼¼¯Öе½ ......