OracleÖ®º¯ÊýÓë´¥·¢Æ÷
½ñÌìдÓйØOracleÖк¯ÊýÓë´¥·¢Æ÷µÄÄÚÈÝ£¬ÔÚÊý¾Ý¿âÖж¨Ò岢ʹÓô洢¹ý³Ì¡¢º¯Êý¡¢´¥·¢Æ÷£¬¿ÉÒÔÌá¸ßÓû§·ÃÎÊÊý¾Ý¿âµÄЧÂÊ¡£
Êý¾Ý¿âÖк¯Êý°üº¬Ëĸö²¿·Ö£ºÉùÃ÷¡¢·µ»ØÖµ¡¢º¯ÊýÌåºÍÒì³£´¦Àí¡£
1 create or replace function getname(sno varchar2 )
2 return varchar is
3 name varchar(12 );
4 begin
5 select ename into name from emp where empno= sno;
6 return name;
7 exception
8 ...
12 end ;
13
´¥·¢Æ÷ÊÇÒ»ÖÖÌØÊâµÄ´æ´¢¹ý³Ì£¬ÀàËÆÓÚÆäËü±à³ÌÓïÑÔÖеÄʼþº¯Êý£¬ÔÊÐíΪ INSERT¡¢UPDATE¡¢DELETE ´´½¨´¥·¢Æ÷£¬µ±ÔÚ±í£¨ÊÓͼ£©ÖвåÈë¡¢¸üС¢É¾³ý¼Ç¼(Ç°¡¢ºó)ʱ£¬´¥·¢Ò»¸ö»òһϵÁÐ T-SQL Óï¾ä¡£
´´½¨ÔÚ STUDENT ±íÉϵIJåÈë´¥·¢Æ÷£¬µ±ÔÚ STUDENT ±íÖвåÈëÊý¾Ýʱºò´¥·¢Æ÷½«±»´¥·¢£¬Ö´ÐÐÌ彫±»Ö´ÐÐ
²åÈë´¥·¢Æ÷
1 create or replace trigger tg_insert
2 before insert on student ££ ¿ÉÉèÖÃÔÚ²åÈëÇ°»ò²åÈëºó
3 begin
4 ...
5 end ;
¸üд¥·¢Æ÷
8 create or replace trigger tg_update
9 after update on student
10 for each row
12 begin
13 ...
14 END ;
15
´¥·¢Æ÷Á½¸öÌØÊâÐ춱äÁ¿£º :New ÐÂÖµ ºÍ :Old ¾ÉÖµ ·Ö±ð´ú±í¸üÐÂÖµ£¬±»¸üеÄÖµ
1 create or replace trigger tg_insert
2 after update on stud
Ïà¹ØÎĵµ£º
ʲôÊǺϲ¢¶àÐÐ×Ö·û´®£¨Á¬½Ó×Ö·û´®£©ÄØ£¬ÀýÈ磺
SQL> desc test;
Name Type Nullable Default Comments
------- ------------ -------- ------- --------
COUNTRY VARCHAR2(20) Y &nb ......
½üÀ´½ÓÁ˸ö¼òµ¥µÄϵͳ×ö£¬Íâ°üµÄ£¬ÓõÄÊý¾Ý¿âÊÇoracle8i,
Ò»¿ªÊ¼ÎÒʹÓà ojdbc6.jarÀ´×öÁ¬½Ó£¬Á¬²»ÉÏ£¬ÕÒÒ»·¬£¬ÔÀ´¹Ù·½oracle8i³öµÄÇý¶¯Ö»ÓÐ class12.jar ºÍclass14.jar ,×îÒªÃüµÄÊDz»Ö§³Öjdk1.4¼°1.4ÒÔÉϵģ¬¹¤×÷Á¿ÂíÉϾÍÉÏÀ´ÁË¡£²»¸ÊÐÄ°¡¡£
×îºóÊÔÁËÏ£¬ÄÜÓõÄÖ»ÓÐojadb14.jar £¬Á¬ÉÏÁË£¬²»¹ýͨ¹ýhibernateÉú³ÉµÄsqlÊµÔ ......
1£®top
topÃüÁî¿ÉʵʱµØÏÔʾLinuxϵͳµÄ½ø³Ì¡¢CPU¡¢ÄÚ´æ¡¢¸ºÔصȵÄÐÅÏ¢¡£ËüÊÇÎÒÃÇÁ˽âϵͳÕûÌå״̬×îºÃµÄ¹¤¾ß¡£
topÃüÁîµÄÔËÐÐ״̬ÊÇÒ»¸öʵʱµÄÏÔʾ¹ý³Ì£¬ÎÒÃÇ¿ÉÔÚÕâ¸ö½çÃæ¼à¿ØϵͳÔËÐÐÇé¿ö¡£ÎÒÃÇ¿Éͨ¹ý¼¸¸ö°´¼üÀ´¿ØÖÆtopÃüÁÈç°´q¿ÉÍ˳ötopÃüÁî״̬£¬°´s¿ÉÊäÈëÐÅÏ¢µÄ¸üÐÂƵÂʵȡ£ÕâЩÃüÁî¿É°´h°ïÖú¼ü²éѯ¡£
2£®Ps ......
[oracle@dba01 dbs]$ orapwd file=/oracle/app/oracle/product/10.2.0/db_1/dbs/orapworcl password=oracle entries=20 force=y
[oracle@dba01 dbs]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Sat May 29 13:07:10 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Con ......
oracle ÖÁ½ñûÓÐÍƳöÕë¶Ôwin7µÄ°æ±¾£¬ÎÞÄÎ֮ϲéѯÍøÂ磬ÍøÉÏ´óϺ±íʾÐÞ¸Ärefhost.xmlÎļþ¼´¿É¡£
½øÈë×Ô¼ºÊµÕ½½×¶Î£¬´Óoracle¹Ù·½ÏÂÔØoracle 10g for vista and windows2K8 x86°æ(for windowsÊÇÖ§³ÖvistaÄں˵ģ¬win7µÄÄÚºËÓë2008ÒÔ¼°vistaµÄÄÚºËÊÇÒ»Ñù)¡£
Ïȵã»÷°²×°£¬ÔÚ°²×°µÄ°æ±¾¼ì²âʱÌáʾĿǰoracle²»Ö§³ÖversionΪ6 ......