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
Ïà¹ØÎĵµ£º
create function decodehundred(@hundredstring varchar(300) )
returns varchar(1000)
as
begin
declare @tmp varchar(1000),@decodehundred varchar(1000)
set @decodehundred = ''
declare @strno1 varchar(1000)
select @strno1 = 'One Two ......
SQL Server Ë÷Òý½á¹¹¼°ÆäʹÓã¨ËÄ£©
×÷Õߣºfreedk
Ò»¡¢ÉîÈëdz³öÀí½âË÷Òý½á¹¹
¶þ¡¢¸ÄÉÆSQLÓï¾ä
Èý¡¢ÊµÏÖСÊý¾ÝÁ¿ºÍº£Á¿Êý¾ÝµÄͨÓ÷ÖÒ³ÏÔʾ´æ´¢¹ý³Ì
¾Û¼¯Ë÷ÒýµÄÖØÒªÐÔºÍÈçºÎÑ¡Ôñ¾Û¼¯Ë÷Òý
¡¡¡¡ÔÚÉÏÒ»½ÚµÄ±êÌâÖУ¬±ÊÕßдµÄÊÇ£ºÊµÏÖСÊý¾ÝÁ¿ºÍº£Á¿Êý¾ÝµÄͨÓ÷ÖÒ³ÏÔʾ´æ´¢¹ý³Ì¡£ÕâÊÇÒòΪÔÚ½«±¾´æ´¢¹ý³ÌÓ¦ÓÃÓÚ“°ì¹«×Ô¶ ......
1.½¨¿â
declare @dbName varchar(20),@dataName varchar(2000),@dataPath varchar(2000),@logName varchar(2000),@logPath varchar(2000)
set @dbName='DB_Exam_OnLine_YHK'
set @dataName='DB_Exam_OnLIne_YHK_DB'
set @dataPath='D:\gaoFang\Exam\App_Data\DB_Exam_OnLIne_YHK_DB.mdf'
set @logName='DB_Exam_OnLIne ......
sysaltfiles Ö÷Êý¾Ý¿â ±£´æÊý¾Ý¿âµÄÎļþ
syscharsets Ö÷Êý¾Ý¿â &nb ......
SQLʱ¼ä¶Î²éѯ
ACCESSµÄ»°
select * from table where date1<#2008-1-20# and date2>#2007-8-30#
MYSQLµÄ»°
select * from table where date1<'2008-1-20' and date2>'2007-3-30'
Ò²¿ÉÒÔ
select * from table where date1 between '2008-1-20' and '2007-3-30'
ÆäÖÐdate1,date2¶¼ÊÇÈÕÆÚÀàÐ͵Ä× ......