OracleÖ´ÐÐSQLÓï¾äµÄ¹ý³Ì
µ±ÎÒÃÇÌá½»Ò»ÌõsqlÓï¾äʱ£¬oracle»á×öÄÄЩ²Ù×÷ÄØ£¿
Oracle»áΪÿ¸öÓû§½ø³Ì·ÖÅäÒ»¸ö·þÎñÆ÷½ø³Ì£ºservice process£¨Êµ¼ÊÇé¿öÓ¦¸ÃÇø·ÖרÓ÷þÎñÆ÷ºÍ¹²Ïí·þÎñÆ÷£©£¬µ±service process½ÓÊÕµ½Óû§½ø³ÌÌá½»µÄsqlÓï¾äʱ£¬·þÎñÆ÷½ø³Ì»á¶ÔsqlÓï¾ä½øÐÐÓï·¨ºÍ´Ê·¨·ÖÎö¡£
Ãû´Ê½âÊÍ£º
Óï·¨·ÖÎö£ºÓï¾ä±¾ÉíÕýÈ·ÐÔ¡£
´Ê·¨·ÖÎö£º¶ÔÕÕÊý¾Ý×ÖµäÖмì²é±í£¬Ë÷Òý£¬ÊÓͼºÍÓû§È¨ÏÞ¡£
¼ì²éͨ¹ýºó£¬·þÎñÆ÷½ø³Ì»á½«sqlÓï¾äת±äΪasciiÂ룬²¢Í¨¹ýÒ»¸öhashº¯Êý½«asciiÂëÉú³É³öÒ»¸öhashÖµ£¬·þÎñÆ÷½ø³Ì»áµ½share poolÖвéѯ´ËhashÊÇ·ñ´æÔÚ£¬Èç¹û´æÔÚ£¬·þÎñÆ÷½ø³Ì»á´ÓsharepoolÖжÁÈ¡ÒѾ½âÎöºÃµÄÓï¾äÀ´Ö´ÐУ»Èç¹û²»´æÔÚ£¬ÔòÐèÒª×öÒÔϲ½Ö裺Éú³ÉÖ´Ðмƻ®ºÍÉú³ÉÖ´ÐбàÂ루ÇëÀí½âºÎΪִÐмƻ®£©¡£½âÎöÍê³Éºó£¬Oracle»á½«sqlÓï¾ä±¾Éí´úÂë¡¢hashÖµ¡¢±àÒë´úÂë¡¢Ö´Ðмƻ®ºÍËùÓÐÓë¸ÃÓï¾äÏà¹ØµÄͳ¼ÆÊý¾Ý´æ·Åµ½sharepoolÖС£
×¢Ò⣺
1 ¾¡Á¿Ð´ÏàͬµÄsqlÓï¾ä£¬ÒòΪ¼´Ê¹ÊÇfromÓï¾äÖÐtable˳ÐòµÄ±ä»¯¡¢²éѯ×Ö¶ÎλÖõı仯£¬ÉõÖÁÖ»ÊÇ´óСдµÄ²»Í¬£¬¶¼»á´ÙʹoracleÖØÐÂ×öÒ»´ÎÓ²½âÎö¡£
2 Ôö´óshare_pool_size¿ÉÒÔ±£Áô¸ü¶àµÄ»º´æÔÚÄÚ´æÖеÄsqlÓï¾äÖ´Ðмƻ®£¬Ò²Òâζ׏²ÏísqlµÄ¿ÉÄÜÐÔµÄÔö´ó¡£
ÔÚÉú³É±àÒë´úÂëºó£¬service process»áÊÔͼ´Ódb_bufferÖжÁÈ¡ÊÇ·ñ´æÔÚÏà¹ØµÄ»º´æÊý¾Ý¡£
ÏÂÃæÎÒÃÇ·ÖÁ½ÖÖÇé¿öÀ´ËµÃ÷£º
1 db_bufferÖв»°üº¬ÄÚ´æÊý¾Ý£ºservice process»áÊ×ÏÈÔÚ±íµÄÍ·²¿ÇëÇóһЩÐÐËø£¬ÉêÇë³É¹¦ºó£¬½«ÕâЩÐÐËùÔڵĵÚÒ»¸öblock¶ÁÈëdb_buffer¡£´ËʱÈç¹ûdb_buffer¿ÕÏпռ䲻×㣬Ôò»á´¥·¢Ð´²Ù×÷—DBWr¡£Èç¹ûdb_bufferÊ£ÓàµÄ¿Õ¼ä²»¹»´æ´¢ÐÂÊý¾Ý£¬¾Í»á´¥·¢DBWr½ø³Ì£¬½«db_bufferÖÐÔàÊý¾ÝдÈëÊý¾ÝÎļþ¡£ÌÚ³öÀ´µÄ¿Õ¼äдÈëÐÂÊý¾Ý¡£
×¢Ò⣺ db_blockÊÇoracle×îСµÄÂß¼µ¥Î»£¬¼´Ê¹ÎÒÃÇËùÒªÇóµÄÊý¾ÝÖ»ÊÇÒ»¸öblockËù°üº¬µÄÖÚ¶àÐÐÖеÄÒ»Ðлò¼¸ÐУ¬ÎÒÃÇÈÔÈ»ÐèÒª½«Õû¸öblock¶ÁÈëdb_buffer¡£db_blockµÄ´óС¿ÉÒÔÉèÖÃΪ8kµÄÕûÊý±¶£¬²¢ÇÒ¿ÉÒÔÕë¶Ô²»Í¬µÄ±í¿Õ¼äÉèÖò»Í¬µÄdb_block_sizeµÄ´óС£¬Ò»°ã½¨ÒéÔÚselect¶àµÄ±íÉϽ«db_block_sizeÉèÖôóһЩ£¬¶ødml²Ù×÷¶àµÄ±íÉÏÉèÖõÄСһЩ¡£
2 DBWrÊÇдÊý¾Ý½ø³Ì£¬´¥·¢DBWr½ø³ÌµÄʼþ³ýÁËdb_buffer¿Õ¼ä²»¹»Í⣬ckpt½ø³ÌÒ²ÊÇ´¥·¢DBWrµÄʼþ¡£
²¹³ä£º
1 ¶ÎÊÇoracle×îСµÄÍØÕ¹µ¥Î»¡£
2 ckpt½ø³Ì£º¼ì²éµã½ø³Ì¡£½«scnдÈëÈÕÖ¾Îļþ£¬¿ØÖÆÎļþ£¬Êý¾ÝÎļþÍ·£¬Êý¾Ý¿éÍ·²¿¡£´¥·¢ckpt½ø³ÌµÄʼþÓÐalter system checkpoint£¬alter tablespace offl
Ïà¹ØÎĵµ£º
SQL Server Ë÷Òý½á¹¹¼°ÆäʹÓ㨶þ£©
×÷Õߣºfreedk
Ò»¡¢ÉîÈëdz³öÀí½âË÷Òý½á¹¹
¸ÄÉÆSQLÓï¾ä
¡¡¡¡ºÜ¶àÈ˲»ÖªµÀSQLÓï¾äÔÚSQL SERVERÖÐÊÇÈçºÎÖ´Ðеģ¬ËûÃǵ£ÐÄ×Ô¼ºËùдµÄSQLÓï¾ä»á±»SQL SERVERÎó½â¡£±ÈÈ磺
select * from table1 where name=''zhangsan'' and tID > 10000
ºÍÖ´ÐÐ:
select * from table1 where tID > ......
SQL Server Ë÷Òý½á¹¹¼°ÆäʹÓã¨Èý£©
×÷Õߣºfreedk
Ò»¡¢ÉîÈëdz³öÀí½âË÷Òý½á¹¹
¶þ¡¢¸ÄÉÆSQLÓï¾ä
ʵÏÖСÊý¾ÝÁ¿ºÍº£Á¿Êý¾ÝµÄͨÓ÷ÖÒ³ÏÔʾ´æ´¢¹ý³Ì
¡¡¡¡½¨Á¢Ò»¸ö Web Ó¦Ó㬷ÖÒ³ä¯ÀÀ¹¦Äܱز»¿ÉÉÙ¡£Õâ¸öÎÊÌâÊÇÊý¾Ý¿â´¦ÀíÖÐÊ®·Ö³£¼ûµÄÎÊÌâ¡£¾µäµÄÊý¾Ý·ÖÒ³·½·¨ÊÇ:ADO ¼Í¼¼¯·ÖÒ³·¨£¬Ò²¾ÍÊÇÀûÓÃADO×Ô´øµÄ·ÖÒ³¹¦ÄÜ£¨ÀûÓÃÓα꣩À ......
create function [dbo].[DeptTree](@initDeptCode varchar(10))/*¶¨Ò庯Êýc_tree£¬ÊäÈë²ÎÊýΪ³õʼ½ÚµãDeptCode*/
returns @t table(DeptCode varchar(10),UpDeptCode varchar(10),lev int)/*¶¨Òå±ítÓÃÀ´´æ·ÅÈ¡³öµÄÊý¾Ý*/
begin
declare @i int/*±êÖ¾µÝ¹é¼¶±ð*/
set @i=1
insert @t ......
ÎÞ·¨´ò¿ªÓû§Ä¬ÈÏÊý¾Ý¿â£¬µÇ¼ʧ°Ü,ÕâÊÇSQL ServerʹÓÃÕßÊìϤµÄÎÊÌâÖ®Ò»¡£ÔÚʹÓÃÆóÒµ¹ÜÀíÆ÷¡¢²éѯ·ÖÎöÆ÷¡¢¸÷À๤¾ßºÍÓ¦ÓÃÈí¼þµÄʱºò£¬Ö»Òª¹Øϵµ½Á¬½ÓSQL ServerÊý¾Ý¿âµÄʱºò£¬¶¼ÓпÉÄÜ»áÅöµ½´ËÎÊÌâ,ÒýÆð´Ë´íÎó·¢ÉúµÄÔÒò±È½Ï¶à,ÏÂÃæÎÒÃǾÍÀ´Ïêϸ·ÖÎöÒýÆð´ËÎÊÌâµÄÔÒòÒÔ¼°½â¾ö°ì·¨¡£
Ò»¡¢ÔÒò
µÇ¼ÕÊ»§µÄĬÈÏÊý¾Ý¿â±»É¾³ý¡ ......
Ä£·Â²Î¿¼:¶¯Ò×ÎÞÏÞ·ÖÀà
Óŵã:ËãµÃÉÏÊÇÕæÕýµÄÎÞÏÞ·ÖÀ࣬²»¹ýParentPathÊÇÓоÖÏÞÐÔ,ClassIDÊDZêʶÁÐ×Ô¶¯ÔöÒ».
ȱµã:ÐÂÔö¹ý³ÌÖÐParentID²»´æÔÚ»¹Ã»ÓÐÍêÉÆ£¬»á²åÈëNULLÊý¾Ý.ºóÃæÈý¸ö´æ´¢¹ý³Ì»¹ÔÚ²âÊÔ¡£
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ArticleClass]') and OBJECTPROPERTY(id, N'Is ......