oracle ´¥·¢Æ÷ÎÊÌâ - Oracle / ¸ß¼¶¼¼Êõ
SQL code:
create or replace trigger article_log_file
after update or delete or insert
on article
for each row
begin
if updating then
insert into log_file values
(old.authorID,'update',old.artcleName,sysdate);
else if deleting then
insert into log_file values
(old.authorID,'delete',old.artcleName,sysdate);
else if inserting then
insert into log_file values
(new.authorID,'insert',new.artcleName,sysdate);
end if;
end;
ËäÈ»Óï¾äÖ´ÐÐÁË£¬µ«±àÒëÆ÷Ìáʾ±àÒë´øÓдíÎ󣬶øÇÒÎÒ²åÈëʱҲ³öÏÖÁË´íÎó£¬ÍûÖ¸½Ì£¬³õѧ¡¡
ÎÒÊýÁËÏ£¬end if Ö»ÓÐÒ»¸ö£¬if È´ÓÐ3¸ö¡£
if ÒªÓë end if Æ¥Åä
else if ¸ÄΪ elsif ÊÔÊÔ
PL/SQL ifÓï¾äÓï·¨
if <Ìõ¼þ1> then
<Óï¾ä1>;
elsif <Ìõ¼þ2> then
<Óï¾ä2>;
elsif <Óï¾ä3> then
....
else
<Óï¾än>;
end if;
2Â¥»¹²»Ë¯¾õ£¿ ¹»ÇڷܵÄ
ÎÒ˯¾õÈ¥
create or replace trigger article_log_file
after update or delete or insert
on article
for each row
begin
if updating then
insert into log_file values
(old.authorID,'update',old.artcleName,sysdate);
elseif deleting then
insert into log_file values
(old.authorID,'delete',old.artcleName,sy
Ïà¹ØÎÊ´ð£º
ÎÒÔÚ¿ª·¢µÄÕâ¸öÓ¦Óò¢·¢ÐԱȽϸߣ¬oracle¸üÐÂÊý¾ÝʱºòÈçºÎ´¦Àí²¢·¢´¦ÀíÄØ£¿¸÷λ´óÏÀ·¢±íºÃµÄ¹Ûµã°¡£¬ÔÚÏߵȴý£¡
oracleÊý¾Ý¸üÐÂʱ£¬»á×Ô¶¯Ä¬ÈÏÐÐËø¶¨£¬Â¥Ö÷²»Òª²ÙÐÄ£¬Oracle¶Ô²¢Ðд¦ÀíÒѾºÜ³ÉÊìÁË
ÒýÓÃ
oracle ......
²éÁËÒ»ÌìµÄblob£¬»¹ÊÇûÀí½âµ½£¬ÎÒÏëÔÚVCÏ´æÈ¡¶þ½øÖƵÄÎļþ£¬Ê¹ÓõÄÊÇoo4o£¬ÕÕ×ŰïÖúÎĵµÉÏÃæµÄдÁËдÈëÊý¾Ý¿âµÄ´úÂ룬»¹ÊÇûд¶Ô£¬´íÎóÌáʾÊÇthis operation is not permitted on a empty LOB£¬ÕâÊÇʲôÒâ˼°¡£¿ÕÕ ......
×öÍædata guard ºó
ÔÚPrimary·þÎñÆ÷ Ö´ÐÐ
SQL>SELECT SEQUENCE#,APPLIED from V$ARCHIVED_LOG ORDER BY SEQUENCE#;
SEQUENCE# APP
---------- ---
13 NO
13 YES ......
Ö÷ÒªÏëʵÏÖ£ºÔÚÿÌìµÄ0µã֮ǰ×Ô¶¯½«Êý¾Ý²åÈëÊý¾Ý¿â£¬Ï£Íû´ó¼ÒÖ¸µã£¡
×Ô¶¯²åÈë?Êý¾ÝÔ´ÄÄÀïÀ´µÄ,²åÈ뵽ʲôµØ·½
´¥·¢Æ÷?
Ó¦¸ÃÓÃJOB
Êý¾ÝÔ´ÔÝʱÏëµÄÊǹ̶¨Êý¾Ý£¬²åÈëµ½Ò»Õűí
ÄǾÍÊÇÓÃJOB¶¨Ê±Ö´ÐÐ,´ÓÎļþµ¼ÈëÊ ......