ORACLE+SQLÐÔÄÜÓÅ»¯ÏµÁÐ
ORACLE SQLÐÔÄÜÓÅ»¯ÏµÁÐ
1. ·ÃÎÊTableµÄ·½Ê½
ORACLE ²ÉÓÃÁ½ÖÖ·ÃÎʱíÖмǼµÄ·½Ê½:
a. È«±íɨÃè
È«±íɨÃè¾ÍÊÇ˳ÐòµØ·ÃÎʱíÖÐÿÌõ¼Ç¼. ORACLE²ÉÓÃÒ»´Î¶ÁÈë¶à¸öÊý¾Ý¿é(database block)µÄ·½Ê½ÓÅ»¯È«±íɨÃè.
b. ͨ¹ýROWID·ÃÎʱí
Äã¿ÉÒÔ²ÉÓûùÓÚROWIDµÄ·ÃÎÊ·½Ê½Çé¿ö,Ìá¸ß·ÃÎʱíµÄЧÂÊ, , ROWID°üº¬Á˱íÖмǼµÄÎïÀíλÖÃÐÅÏ¢..ORACLE²ÉÓÃË÷Òý(INDEX)ʵÏÖÁËÊý¾ÝºÍ´æ·ÅÊý¾ÝµÄÎïÀíλÖÃ(ROWID)Ö®¼äµÄÁªÏµ. ͨ³£Ë÷ÒýÌṩÁË¿ìËÙ·ÃÎÊROWIDµÄ·½·¨,Òò´ËÄÇЩ»ùÓÚË÷ÒýÁеIJéѯ¾Í¿ÉÒԵõ½ÐÔÄÜÉϵÄÌá¸ß.
2. ¹²ÏíSQLÓï¾ä
ΪÁ˲»Öظ´½âÎöÏàͬµÄSQLÓï¾ä,ÔÚµÚÒ»´Î½âÎöÖ®ºó, ORACLE½«SQLÓï¾ä´æ·ÅÔÚÄÚ´æÖÐ.Õâ¿éλÓÚϵͳȫ¾ÖÇøÓòSGA(system global area)µÄ¹²Ïí³Ø(shared buffer pool)ÖеÄÄÚ´æ¿ÉÒÔ±»ËùÓеÄÊý¾Ý¿âÓû§¹²Ïí. Òò´Ë,µ±ÄãÖ´ÐÐÒ»¸öSQLÓï¾ä(ÓÐʱ±»³ÆΪһ¸öÓαê)ʱ,Èç¹ûËüºÍ֮ǰµÄÖ´ÐйýµÄÓï¾äÍêÈ«Ïàͬ, ORACLE¾ÍÄܺܿì»ñµÃÒѾ±»½âÎöµÄÓï¾äÒÔ¼°×îºÃµÄÖ´Ðз¾¶. ORACLEµÄÕâ¸ö¹¦ÄÜ´ó´óµØÌá¸ßÁËSQLµÄÖ´ÐÐÐÔÄܲ¢½ÚÊ¡ÁËÄÚ´æµÄʹÓÃ.
¿ÉϧµÄÊÇORACLEÖ»¶Ô¼òµ¥µÄ±íÌṩ¸ßËÙ»º³å(cache buffering) ,Õâ¸ö¹¦Äܲ¢²»ÊÊÓÃÓÚ¶à±íÁ¬½Ó²éѯ.
Êý¾Ý¿â¹ÜÀíÔ±±ØÐëÔÚinit.oraÖÐΪÕâ¸öÇøÓòÉèÖúÏÊʵIJÎÊý,µ±Õâ¸öÄÚ´æÇøÓòÔ½´ó,¾Í¿ÉÒÔ±£Áô¸ü¶àµÄÓï¾ä,µ±È»±»¹²ÏíµÄ¿ÉÄÜÐÔÒ²¾ÍÔ½´óÁË.
µ±ÄãÏòORACLE Ìá½»Ò»¸öSQLÓï¾ä,ORACLE»áÊ×ÏÈÔÚÕâ¿éÄÚ´æÖвéÕÒÏàͬµÄÓï¾ä.
ÕâÀïÐèҪעÃ÷µÄÊÇ,ORACLE¶ÔÁ½Õß²ÉÈ¡µÄÊÇÒ»ÖÖÑϸñÆ¥Åä,Òª´ï³É¹²Ïí,SQLÓï¾ä±ØÐëÍêÈ«Ïàͬ(°üÀ¨¿Õ¸ñ,»»ÐеÈ).
¹²ÏíµÄÓï¾ä±ØÐëÂú×ãÈý¸öÌõ¼þ:
A. ×Ö·û¼¶µÄ±È½Ï:
µ±Ç°±»Ö´ÐеÄÓï¾äºÍ¹²Ïí³ØÖеÄÓï¾ä±ØÐëÍêÈ«Ïàͬ.
ÀýÈç:
SELECT * from EMP;
ºÍÏÂÁÐÿһ¸ö¶¼²»Í¬
SELECT * from EMP;
Select * from Emp;
SELECT * from EMP;
B. Á½¸öÓï¾äËùÖ¸µÄ¶ÔÏó±ØÐëÍêÈ«Ïàͬ:
ÀýÈç:
Óû§ ¶ÔÏóÃû ÈçºÎ·ÃÎÊ
Jack sal_limit private synonym
Work_city public synonym
Plant_detail public synonym
Jill sal_limit private synonym
Work_city public synonym
Plant_detail table owner
¿¼ÂÇÒ»ÏÂÏÂÁÐSQLÓï¾äÄÜ·ñÔÚÕâÁ½¸öÓû§Ö®¼ä¹²Ïí.
SQL
ÄÜ·ñ¹²Ïí
ÔÒò
select max(sal_cap) from sal_limit;
²»ÄÜ
ÿ¸öÓû§¶¼ÓÐÒ»¸öprivate synonym - sal_limit , ËüÃÇÊDz»Í¬µÄ¶ÔÏó
select count(*0 from work_city where sdesc like 'NEW%';
ÄÜ
Á½¸öÓû§·ÃÎÊÏàͬµÄ¶ÔÏópublic sy
Ïà¹ØÎĵµ£º
Éè¼ÆÔÔò
·ûºÅÈý´ó·¶Ê½£¨Ã¿Ò»Áбí´ïÒ»¸öÒâ˼£¬Ã¿Ò»Ðдú±íÒ»¸öʵÀý/ÿһÐÐÓÐΨһ¼ü/±íÄÚûÓÐÆäËü±íµÄ·ÇÖ÷¼üÐÅÏ¢£©
ÿ¸ö±íÓ¦¸ÃÓеÄ3¸öÓÐÓÃ×ֶΣ¨¼Ç¼´´½¨»ò¸üÐÂʱ¼ä/¼Ç¼´´½¨Õß/¼Ç¼°æ±¾£©
±ÜÃâ±£Áô×Ö
±íÓ¦±ÜÃâ¿ÉΪ¿ÕµÄÁÐ
ÃüÃû¹æ·¶
±í
±íÃûÈçOr ......
Linq to SQL uses a DataContext to manage it's access to the database as well as tracking changes made to entities retrieved from the database. Linq to SQL has a persistent approach to managing its 'connection' to the database via this data context and it basically assumes that you use a single Dat ......
×÷Õß
£º
Takayuki Hoshino
׫¸åÈË
£º
Juergen Thomas
¼¼
Êõ
ÉóÔÄÈË
£º
Sanjay Mishra
SQL Server Ϊ SAP Ó¦ÓóÌÐòÌṩÁË׿ԽµÄÊý¾Ý¿âƽ̨¡£ÏÂÁн¨Òé¸ÅÊöÁËÕë¶Ô SAP ʵÏÖά»¤ SQL Server Êý¾Ý¿âµÄ×î¼Ñ×ö·¨¡£
ÿÌìÖ´ÐÐÍêÕûÊý¾Ý¿â±¸·Ý
´Ó
¼¼Êõ½Ç¶ÈÀ´Ëµ£¬Áª»ú±¸·Ý SAP Êý¾Ý¿â²»³ÉÎÊÌâ¡£ÕâÒâζ×Å£¬×îÖ ......
Case¾ßÓÐÁ½ÖÖ¸ñʽ¡£¼òµ¥Caseº¯ÊýºÍCaseËÑË÷º¯Êý¡£
--¼òµ¥Caseº¯Êý
CASE sex
WHEN '1' THEN 'ÄÐ'
WHEN '2' THEN 'Å®'
ELSE 'ÆäËû' END
--CaseËÑË÷º¯Êý
CASE WHEN sex = '1' THEN 'ÄÐ'
&nbs ......