Oracle´´½¨´¥·¢Æ÷
½ñÌìÔÚ°Ù¶ÈÉÏËÑË÷ÁËÏÂoracleдµÄ´¥·¢Æ÷£¬¸Ð¾õ»¹¿ÉÒÔ¡£
¾ÍÊղؿ©¡£
Óû§±í£º´´½¨´¥·¢Æ÷֮ǰÊ×ÏÈÒª´´½¨ÐòÁÐ
Óû§±íÐòÁУº
create sequence users_seq;
Óû§±í´¥·¢Æ÷£º
create or replace trigger bifer_users_userid_pk
before insert
on users
for each row
begin
select users_seq.nextval into:new.userid from dual;
end;
/
ÉÌÆ·±í£º
ÉÌÆ·±íÐòÁУºcreate sequence product_seq;
ÉÌÆ·±í´¥·¢Æ÷£º
create or replace trigger bifer_product_itemid_pk
before insert
on product
for each row
begin
select product_seq.nextval into:new.itemid from dual;
end;
/
ÉÌÆ·Æ·ÅÆ±í£º
ÉÌÆ·Æ·ÅƱíÐòÁУºcreate sequence brand_seq;
ÉÌÆ·Æ·ÅÆ±í´¥·¢Æ÷£º
create or replace trigger bifer_brand_brandid_pk
before insert
on brand
for each row
begin
select brand_seq.nextval into:new.brandid from dual;
end;
/
ÉÌÆ·Àà±ð±í£º
ÉÌÆ·±íÐòÁУºcreate sequence class_seq;
ÉÌÆ·±í´¥·¢Æ÷£º
create or replace trigger bifer_class_classid_pk
before insert
on class
for each row
begin
select class_seq.nextval into:new.classid from dual;
end;
/
Ò»¸ö´¥·¢Æ÷Ö»ÄÜÓÃÓÚÒ»¸ö±í£¬¶øÒ»¸ö±í¿ÉÒÔÓÐ×î¶àÈý¸ö´¥·¢Æ÷£¬ÉÌÆ·Æ·ÅÆÀà±ð±íÊǸ´ºÏÖ÷¼üËùÒÔ¾ÍΪÉÌÆ·±í½¨ÁËÁ½¸ö´¥·¢Æ÷·Ö±´×÷ÓÃÓÚÿ¸öÖ÷¼ü
ÉÌÆ·Æ·ÅÆÀà±ð±í£º
ÉÌÆ·Æ·ÅÆÀà±ðÐòÁУºcreate sequence brand_class_seq;
ÉÌÆ·Æ·ÅÆÀà±ð´¥·¢Æ÷(brandid)£º
create or replace trigger brand_class_brandid_pk
before insert
on brand_class
for each row
begin
select brand_class_seq.nextval into:new.brandid from dual;
end;
/
ÉÌÆ·Æ·ÅÆÀà±ð´¥·¢Æ÷(classid)£º
create or replace trigger brand_class_classid_pk
before insert
on brand_class
for each row
begin
select brand_class_seq.nextval into:new.classid from dual;
end;
/
ÔÚoracleÖУ¬ÎªÁË·½±ã³£³£Óô¥·¢Æ÷¼°ÐòÁнáºÏÆðÀ´ÊµÏÖ
ÏȽ¨±í¡¢ÔÙ½¨ÐòÁС¢È»ºóÊÇ´¥·¢Æ÷£¬×îºó²âÊÔ
=============================================
&
Ïà¹ØÎĵµ£º
oracle±í¿Õ¼ä²Ù×÷Ïê½â
1
2
3×÷Õߣº À´Ô´£º ¸üÐÂÈÕÆÚ£º2006-01-04
5
6
7½¨Á¢±í¿Õ¼ä
8
9CREATE TABLESPACE data01
10DATAFILE '/ora ......
¿Î³Ì¸ÅÒª
¿Î³Ì±àºÅ
£ºXY-DB-V01
ÅàÑøÄ¿±ê
£º¾ß±¸Êµ¼Ê²Ù×÷ÄÜÁ¦µÄ Oracle Êý¾Ý¿â¹ÜÀíÔ±
רעOracleʵսÄÜÁ¦µÄÇ¿»¯£¬ÍêÈ«¸²¸ÇOCP¿Î³ÌÄÚÈÝ£¬¾ßÓиü´óµÄѧϰǿ¶ÈºÍ¸ü³¤µÄѧϰʱ¼ä¡£
ÈëѧÌõ¼þ
£º¶ÔOracle»òÆäËü¹ØϵÊý¾Ý¿âÓÐÒ»¶¨µÄ»ù´¡Õß
°à±ð¼°ÊÚ¿Îʱ¼ä
£ºÍѲú°àÀúʱ1¸öÔ£¬1 ......
ϵͳ·Ö²½Öè²úÉúµÄ·Ö¼£º
1£©¿â´æÄ£¿é×÷½ÓÊÕʱ²úÉúµÄ·Ö¼Ϊ£º
½è£º²ÄÁϲɹº £¨²É¹ºµ¥¼ÛX¶©µ¥ÊýÁ¿£©
´û£ºÓ¦¼Æ¸ºÕ®
£¨²É¹ºµ¥¼ÛX¶©µ¥ÊýÁ¿£©
2£©¿â´æÄ£¿é×÷¼ìÑéÈë¿âʱ²úÉúµÄ·Ö¼Ϊ£º
ϵͳ²úÉúµÄ·Ö¼·Ö±ðΪ£º
1£©¿â´æÄ£¿é×÷½ÓÊÕʱ²úÉúµÄ·Ö¼Ϊ£º
½è£º²ÄÁϲɹº
£¨²É¹ºµ¥¼ÛX¶©µ¥ÊýÁ¿£©
´û£ºÓ¦¼Æ¸ºÕ®
£¨²É¹ºµ¥¼ÛX¶©µ¥Ê ......
Oracle ×ÜÕÊÄ£¿éµÄÒ»¸ö»á¼ÆÒµÎñÖÜÆÚÈçÏÂ:
1.´ò¿ª×ÜÕÊ»á¼ÆÆÚ
2.¼ÈëÊÖ¹¤Æ¾Ö¤,°üÀ¨:· ÊÖ¹¤±ê׼ƾ֤
  ......
Ó¦¸¶Ä£¿éµÄ¶àÊýÒµÎñ»ùÓڲɹººÍ¿â´æµÄ²Ù×÷£¬Òò´ËÓ¦¸¶Ä£¿éµÄÔ½áÓ¦¸ÃÔڲɹºÄ£¿éºÍ¿â´æÄ£¿éÔ½áºó²ÅÄܹرջá¼ÆÆÚ¡£
Ô½ᲽÖè
ÔÚÿ¸ö»á¼ÆÆÚÄ©£¬Ó¦¸¶Ä£¿éµÄÔ½áÓ¦×ñÑÒÔÏÂÁ÷³Ì£º
1.¼ì²éÒµÎñÊÇ·ñÈ«²¿Â¼Èë;
2.¼ì²éÊÇ·ñÓÐδÑéÖ¤¡¢Ôݹҷ¢Æ±;
3.¸üе½ÆÚµÄÔ¶ÆÚ¸¶¿î״̬;
4.¼ì²éÓ¦¸¶ÒµÎñÊÇ·ñÉú³É·Ö¼;
5.Ó¦¸¶ÒµÎñ´«Ë͵½×ÜÕÊ;
6 ......