Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

±±´óÇàÄñoracleѧϰ±Ê¼Ç26 27 28

Êý¾Ý¿â´¥·¢Æ÷
´¥·¢Æ÷Óï¾ä
    Öƶ¨´¥·¢Æ÷¶¨Ê±¡¢Ê¼þ¡¢±íÃû¼°ÀàÐÍ
´¥·¢Æ÷Ö÷Ìå
    ÊÇpl/sql¿ì»ò¶Ô¹ý³ÌµÄµ÷ÓÃ
´¥·¢Æ÷ÏÞÖÆ
    ¿ÉÒÔͨ¹ýwhen×Ó¾äʵÏÖ
DML(insert update delete)
DDL(create alter drop)
Êý¾Ý¿â²Ù×÷(servererror logon logoff startup shutdown)

create trigger ´¥·¢Æ÷Ãû
before|after insert|delete|update of ÁÐÃû
on ±íÃû
[for each row]  --Ðм¶´¥·¢Æ÷
when Ìõ¼þ
´¥·¢Æ÷ν´Ê
inserting insert²Ù×÷
updating update²Ù×÷
deleting delete²Ù×÷
¿ÉÒÔ¸ù¾ÝÕâÈý¸öν´ÊÅжϵ½µ×ÔÚÖ´ÐÐÄĸö²Ù×÷
create or replace
Trigger tg_insert
before insert or update on student
for each row
begin
  if updating then
    dbms_output.put_line('before update');
  end if;
  if inserting then
    dbms_output.put_line('before insert');
  end if;
end;
´¥·¢Æ÷ÀàÐÍ£º   
1¡¢ ±í¼¶´¥·¢Æ÷£¨±í¼¶´¥·¢Æ÷¶Ôÿ¸öDMLÓï¾äÖ´ÐÐÒ»´Î)
create or replace Trigger tg_insert
before update on student
begin
  dbms_output.put_line('before update);
end;
4 rows updated
before update
2¡¢ Ðд¥·¢Æ÷ (Ðм¶´¥·¢Æ÷¶ÔDMLÓï¾äÓ°ÏìµÄÿ¸öÐÐÖ´ÐÐÒ»´Î)
create or replace
Trigger tg_insert
before update on student
for each row  --ÿÐд¥·¢Ò»´Î
begin
  dbms_output.put_line('before update');
end;
4 rows updated
before update
before update
before update
before update
ʹÓô¥·¢Æ÷ʱ£¬Á½¸öÌØÊâÖµ:new вåÈëµÄÖµ :old Ô­À´µÄÖµ  ²»ÄÜÓÃÓÚ±í¼¶´¥·¢Æ÷

 create or replace trigger trig_job
before insert or update of job
on emp
for each row
begin
if inserting then
:new.job:=upper(:new.job);
else
:new.job:=upper(:new.job);
end if;
end;
3¡¢INSTEAD OF´¥·¢(´Ë´¥·¢Æ÷ÊÇÔÚÊÓͼÉ϶ø²»ÊÇÔÚ±íÉ϶¨ÒåµÄ´¥·¢Æ÷,ËüÊÇÓÃÀ´Ìæ


Ïà¹ØÎĵµ£º

oracle 9iÉý¼¶µ½oracle9208Êý¾Ý¿â

±³¾°£ºÔÚwindows2003serverÉÏ°²×°ÁËOracle9.2.0.1.0£¬ÏÖ´òË㽫ÆäÉý¼¶µ½9.2.0.8°æ±¾£¬²¢´òÉÏ×îÐµİ²È«²¹¶¡April2008°æ¡£
1.Éý¼¶oracle£¨administratorÓû§È¨ÏÞ£©
  (1)µ½metalinkÏÂÔØÉý¼¶Ñ¹Ëõ°ü£¬patchºÅΪ4547809£¬Ñ¹Ëõ°üÃû³ÆΪ p4547809_92080_WINNT.zip£¬for windows 32bit¡£
  (2)½âѹËõzip£¬Ï±߰üº¬Ò»¸ö ......

oracle¼àÌý¼ÓÃÜ ¸ü°²È«

ºÜ¶àÈ˶¼ÖªµÀ£¬OracleµÄ¼àÌýÆ÷Ò»Ö±´æÔÚ×ÅÒ»¸ö°²È«Òþ»¼£¬¼ÙÈç²»ÉèÖð²È«´ëÊ©£¬ÄÇôÄܹ»·ÃÎʵÄÓû§¾Í¿ÉÒÔÔ¶³Ì¹Ø±Õ¼àÌýÆ÷¡£
Ïà¹ØʾÀý£º
D:\>lsnrctl stop eygle
LSNRCTL for 32-bit Windows: Version 10.2.0.3.0 - Production on 28-11ÔÂ-2007 10:02:40
Copyright (c) 1991, 2006, Oracle. All rights reserved.
......

ORACLEÐÔÄÜÕï¶ÏʵÀý ÐÐǨÒƺÍÐÐÁ´½Ó

ÃÀ¹úPVH DB´æÔÚÐÐÁ´½Ó.ͨ¹ýÎҵļì²é,·¢ÏÖ,ÎÒÃǵÄDBͬÑù´æÔÚÐÐǨÒƺÍÐÐÁ´½Ó.ORACLEµÄdbms_stats.gather_schema_statsÖ»»áÊÕ¼¯ÓÅ»¯Æ÷ͳ¼ÆÐÅÏ¢,²»»á¼ì²â±íµÄ¼Ç¼ÊÇ·ñ´æÔÚÐÐǨÒƺÍÐÐÁ´½Ó.(ÎÒÔ­Ïȱ»Õâ¸ö°ü¸øÆ­ÁË,ËùÒÔÖ´ÐÐÍêdbms_stats.gather_schema_statsºóÒ»²éÊý¾Ý×Öµä:USER_TABLES,ÆäÖеÄ×Ö¶Îchain_cntֵȫΪ0).Òª¼ì²â±íµÄ¼Ç ......

´«ÖDz¥¿Í——Êý¾Ý¿âÖ®ORACLE£¨¶þ£©


¡¡¡¡1£© ÓÃSELECTÓï¾ä´Ó±íÖÐÌáÈ¡²éѯÊý¾Ý¡£Ó﷨Ϊ
¡¡¡¡SELECT [DISTINCT] {column1,column2,…} from tablename WHERE {conditions} GROUP BY {conditions} ORDER BY {expressions} [ASC/DESC]; 
¡¡¡¡ËµÃ÷£ºSELECT×Ó¾äÓÃÓÚÖ¸¶¨¼ìË÷Êý¾Ý¿âµÄÖÐÄÄЩÁУ¬from×Ó¾äÓÃÓÚÖ¸¶¨´ÓÄÄÒ»¸ö±í»òÊÓͼÖмìË÷Êý¾Ý¡£
¡¡¡¡2£© ......

ɨä ORACLE RACµÄ°Ù¿Æ½éÉÜ

Oracle RAC
¡¡¡¡RAC£¬È«³Æreal application clusters£¬ÒëΪ“ÕæÕýÓ¦Óü¯Èº”£¬ ÊÇOracleаæÊý¾Ý¿âÖвÉÓõÄÒ»Ïîм¼Êõ£¬Ò²ÊÇOracleÊý¾Ý¿âÖ§³ÖÍø¸ñ¼ÆËã»·¾³µÄºËÐļ¼Êõ¡£
¡¡¡¡Oracle RACÖ÷ÒªÖ§³ÖOracle9i¡¢10g¡¢11g°æ±¾£¬¿ÉÒÔ¿ÉÒÔÖ§³Ö24 x 7 ÓÐЧµÄÊý¾Ý¿âÓ¦Óà ϵͳ£¬Ôڵͳɱ¾·þÎñÆ÷ÉϹ¹½¨¸ß¿ÉÓÃÐÔÊý¾Ý¿âϵͳ£¬²¢Ç ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ