Oracle °ó¶¨±äÁ¿
oracle ÖУ¬¶ÔÓÚÒ»¸öÌá½»µÄsqlÓï¾ä,´æÔÚÁ½ÖÖ¿ÉÑ¡µÄ½âÎö¹ý³Ì, Ò»ÖÖ½Ð×öÓ²½âÎö,Ò»ÖÖ½Ð×öÈí½âÎö.
Ò»¸öÓ²½âÎöÐèÒª¾½âÎö,Öƶ¨Ö´Ðз¾¶,ÓÅ»¯·ÃÎʼƻ®µÈÐí¶àµÄ²½Öè.Ó²½âÊͲ»½ö½öºÄ·Ñ´óÁ¿µÄcpu£¬¸üÖØÒªµÄÊÇ»áÕ¼¾ÝÖØÒªµÄÃÇãÅ£¨latch£©×ÊÔ´£¬ÑÏÖصÄÓ°ÏìϵͳµÄ¹æÄ£µÄÀ©´ó£¨¼´ÏÞÖÆÁËϵͳµÄ²¢·¢ÐУ©£¬ ¶øÇÒÒýÆðµÄÎÊÌâ²»ÄÜͨ¹ýÔö¼ÓÄÚ´æÌõºÍcpuµÄÊýÁ¿À´½â¾ö¡£
Ö®ËùÒÔÕâÑùÊÇÒòΪÃÅãÅÊÇΪÁË˳Ðò·ÃÎÊÒÔ¼°ÐÞ¸ÄһЩÄÚ´æÇøÓò¶øÉèÖõģ¬ÕâЩÄÚ´æÇøÓòÊDz»Äܱ»Í¬Ê±Ð޸ġ£µ±Ò»¸ösqlÓï¾äÌá½»ºó£¬oracle»áÊ×Ïȼì²éһϹ²Ïí»º³å³Ø£¨shared pool£©ÀïÓÐûÓÐÓëÖ®ÍêÈ«ÏàͬµÄÓï¾ä£¬Èç¹ûÓеĻ°Ö»ÐëÖ´ÐÐÈí·ÖÎö¼´¿É£¬·ñÔò¾ÍµÃ½øÐÐÓ²·ÖÎö¡£
¶øΨһʹµÃoracle Äܹ»Öظ´ÀûÓÃÖ´Ðмƻ®µÄ·½·¨¾ÍÊDzÉÓð󶨱äÁ¿¡£°ó¶¨±äÁ¿µÄʵÖʾÍÊÇÓÃÓÚÌæ´úsqlÓï¾äÖеij£Á¿µÄÌæ´ú±äÁ¿¡£°ó¶¨±äÁ¿Äܹ»Ê¹µÃÿ´ÎÌá½»µÄsqlÓï¾ä¶¼ÍêÈ«Ò»Ñù¡£
°ó¶¨±äÁ¿Ö»ÊÇÆðµ½Õ¼Î»µÄ×÷Óã¬Í¬ÃûµÄ°ó¶¨±äÁ¿²¢²»Òâζ×ÅÔÚËüÃÇÊÇͬÑùµÄ£¬ÔÚ´«µÝʱҪ¿¼ÂǵÄÊÇ´«µÝµÄÖµÓë°ó¶¨±äÁ¿³öÏÖ˳ÐòµÄ¶Ô룬¶ø²»Êǰ󶨱äÁ¿µÄÃû³Æ¡£
°ó¶¨±äÁ¿ÊÇÔÚͨ³£Çé¿öÏÂÄÜÌáÉýЧÂÊ£¬·ÇÕý³£µÄÇé¿öÈçÏ£º
ÔÚ×Ö¶Î(°üÀ¨×ֶμ¯)½¨ÓÐË÷Òý£¬ÇÒ×Ö¶Î(¼¯)µÄ¼¯µÄÊƷdz£´ó£¨Ò²¾ÍÊÇÓиöÖµÔÚ×Ö¶ÎÖгöÏֵıÈÀýÌرðµÄ´ó£©µÄÇé¿öÏ£¬Ê¹Óð󶨱äÁ¿¿ÉÄܻᵼÖ²éѯ¼Æ»®´íÎó£¬Òò¶ø»áʹ²éѯЧÂʷdz£µÍ¡£ÕâÖÖÇé¿ö×îºÃ²»ÒªÊ¹Óð󶨱äÁ¿¡£
µ«ÊDz¢²»ÊÇÈκÎÇé¿ö϶¼ÐèҪʹÓð󶨱äÁ¿£¬ÏÂÃæÊÇÁ½ÖÖÀýÍâÇé¿ö£º
1£®¶ÔÓÚ¸ôÏ൱һ¶Îʱ¼ä²ÅÖ´ÐÐÒ»´ÎµÄSQLÓï¾ä£¬ÕâÊÇÀûÓð󶨱äÁ¿µÄºÃ´¦»á±»²»ÄÜÓÐЧÀûÓÃÓÅ»¯Æ÷¶øµÖÏû
2£®Êý¾Ý²Ö¿âµÄÇé¿öÏ¡£
°ó¶¨±äÁ¿²»Äܵ±×÷ǶÈëµÄ×Ö·û´®À´Ê¹Óã¬Ö»Äܵ±×÷Óï¾äÖеıäÁ¿À´Óᣲ»ÄÜÓð󶨱äÁ¿À´´úÌæ±íÃû¡¢¹ý³ÌÃû¡¢×Ö¶ÎÃûµÈ.
´ÓЧÂÊÀ´¿´£¬ÓÉÓÚoracle10G·ÅÆúÁËRBO£¬È«ÃæÒýÈëCBO£¬Òò´Ë£¬ÔÚ10GÖÐʹÓð󶨱äÁ¿Ð§ÂʵÄÌáÉý±È9iÖиüΪÃ÷ÏÔ¡£
¾ÙÀý£º
ÆÕͨsqlÓï¾ä£º
SELECT fname, lname, pcode from cust WHERE id = 674;
SELECT fname, lname, pcode from cust WHERE id = 234;
SELECT fname, lname, pcode from cust WHERE id = 332;
º¬°ó¶¨±äÁ¿µÄsql Óï¾ä£º
SELECT fname, lname, pcode from cust WHERE id = :cust_no;
Sql*plus Ö
Ïà¹ØÎĵµ£º
Ö»ÊÇsqlserver ÌṩµÄÔ¶³ÌÊý¾Ý·ÃÎʺ¯Êý; ÔÚ±¾µØsqlserver ÖÐÈ¡ÍⲿÊý¾ÝÔ´Êý¾Ýʱºò¿ÉÓÃ;
¶ÔÁ¬½Ó±¾µØ oracle ²Ù×÷Ô¶³Ì oracle ²»ÄÜʹÓÃ; ²âÊÔ: pl/sql ÖÐʹÓÃ:
select * from openrowset(................); ÎÞЧ!!!!!!!!!!!!!!
ÔÚoracle ÖÐÐèÒª·ÃÎÊÔ¶³ÌÊý¾Ý,ÐèÒª½¨Á¢Ò»Á¬½ÓÔ¶³Ìoracle µÄ dblink ;
ÔÙÓÃÈçÏ·½ ......
ÎÒÔÚ°ÑoracleÊý¾Ýµ¼ÈësqlserverÖÐʱ£¬·¢ÏÖÔÚoracleÖÐ×ֶζ¨ÒåΪΨһË÷Òýʱ£¬²»Í¬¼Ç¼µÄ´Ë×Ö¶ÎÈç¹ûΪ¿Õ²»±»ÈÏΪÊÇÖظ´µÄ£¬µ«ÔÚsqlserverÖÐÈç¹û´Ë×Ö¶ÎΪΨһË÷Òý×ֶΣ¬²»ÔÊÐíÓÐ2¸öÒÔÉϵĿÕÖµ¡£ÓôÃÆ¡£ËùÒÔÖ»ºÃ½«sqlserverÖеÄΨһË÷Òý×Ö¶ÎÊÖ¹¤ÐÞ¸ÄΪ¼¸¸ö·Ç¿ÕµÄÖµ£¬µ«ÕâÑù³ÌÐò¿Ï¶¨Òª½øÐÐÐÞ¸ÄÁË¡£ÐèÒªÔÚ³ÌÐòÖÐΪ´Ë×Ö¶ÎÉèÖò»Öظ´ ......
oracle²»Í¬°æ±¾¼äÊý¾ÝµÄµ¼Èëµ¼³ö
OracleµÄimp/exp×é¼þÊÇÎÒÃdz£ÓõŤ¾ß£¬ËüµÄÒ»¸ö²Ù×÷ÔÔò¾ÍÊÇÏòϼæÈÝ¡£ÏÂÃæÊǾݴË×ܽáµÄ¼¸¸öʹÓùæÔòºÍÏà¹Ø²âÊÔ£º
¹æÔò1£ºµÍ°æ±¾µÄexp/imp¿ÉÒÔÁ¬½Óµ½¸ß°æ±¾£¨»òͬ°æ±¾£©µÄÊý¾Ý¿â·þÎñÆ÷£¬µ«¸ß°æ±¾µÄexp/imp²»ÄÜÁ¬½Óµ½µÍ°æ±¾µÄÊý¾Ý¿â·þÎñÆ÷
1.1 ʹÓÃ9i¿Í»§¶Ëͨ¹ýimpÁ¬ ......
1 ²Ù×÷ϵͳ±¸·Ý
²Ù×÷ϵͳ±¸·ÝºÍ»Ö¸´ÊµÊ©ÆðÀ´±È½Ï¼òµ¥£¬µ±È»Ò²±È½Ï·Ñʱ£¬ÒªÇóϵͳֹͣʹÓ㬴˹ý³Ì°üÀ¨¹Ø±ÕÊý¾Ý¿â²¢´ÓϵͳÉÏ×¢ÏúËùÓÐÓû§¡£ËùÓзÃÎʱ»½â³ýÖ®ºó£¬ÏµÍ³¹Ø±Õ²¢ÒÔµ¥Óû§·½Ê½ÖØÐÂÆô¶¯£¬¿ØÖÆȨ½»¸øϵͳ¹ÜÀíÔ±£¬ÕâÒ»²½È·±£Ã»ÓÐÓû§Ó¦ÓóÌÐòÈí¼þÔËÐУ¬±ÜÃâÐÞ¸ÄÓ²ÅÌÉϵÄÊý¾Ý¡£Èç¹ûÕâ¸ö±¸·ÝÓÃÓÚ»Ö¸´Êý¾Ý¿âϵͳ£¬ÄÇôϵ ......
Oracle ´¥·¢Æ÷ÓÐÓï¾ä¼¶´¥·¢Æ÷ºÍÐм¶´¥·¢Æ÷
Óï¾ä¼¶´¥·¢Æ÷ µ±É¾³ý²¿ÃűíÖеIJ¿ÃźÅʱ£¬Í¬Ê±É¾³ýµôÔ±¹¤±íÖв¿ÃźÅΪ£ºold.deptnoµÄ¼Ç¼
create or replace trigger del_dept_id
after delete on dept
for each row
begin
delete from emp where deptno=:old.deptno;
end;
µ±Íù²¿Ãűí²åÈëʱ£¬Í¬Ê±ÔÚÔ±¹¤±íÖ ......