Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

SQL Server DBCCÃüÁî


¡ô1.DBCC CacheStats £ºÏÔʾ´æÔÚÓÚµ±Ç° buffer Cache ÖеĶÔÏóµÄÐÅÏ¢£¬ÀýÈç £ºhitrates ±àÒëµÄ¶ÔÏóºÍÖ´Ðмƻ®
 
DBCC CACHESTATS
 
¡¡¡¡´ÓÕâ¸öÃüÁî¿ÉÒԵõ½Ò»Ð©¹Ø¼üµÄͳ¼ÆÐÅÏ¢£º
¡¡¡¡Hit Ratio£ºÏÔʾÌض¨¶ÔÏó¿ÉÒÔÔÚSql ServerµÄ»º´æÖб»ÃüÖеİٷֱȣ¬Õâ¸öÊýÖµÔ½´ó£¬Ô½ºÃ
¡¡¡¡Object Count£ºÏÔʾÌض¨ÀàÐ͵ĶÔÏóÔÚsql serverµÄ»º´æÖб»ÃüÖеÄ×ÜÊý
¡¡¡¡Avg.Cost:sql serverÓÃÓÚ²âÁ¿±àÒëÒ»¸öÖ´Ðмƻ®ËùÐèµÄʱ¼ä£¬ÒÔ¼°Õâ¸ö¼Æ»®ËùÐèµÄÄÚ´æ¡£¸ù¾ÝÕâ¸öÖµ£¬¿ÉÒÔ¾ö¶¨Ö´Ðмƻ®ÊÇ·ñÓ¦¸Ã¼ÓÔØÔÚ»º´æÖС£
¡¡¡¡Avg.Pages£º²âÁ¿ÔÚ»º´æÖеĶÔÏóʹÓÃ8KÒ³µÄƽ¾ù×ÜÊý
¡¡¡¡LW Ojbect Count£¬LW Avg Cost£¬WL Avg Stay£¬LW Ave Use£ºÕâЩÁеÄÖµ±íÃ÷ÓжàÉÙÌض¨µÄ¶ÔÏóÒѾ­±»Ð´½ø½ø³Ì´Ó»º´æ×ÜÒÆ×ß¡£ÕâЩÊýÖµÔ½µÍ£¬Ô½ºÃ¡£
¡ô2.DBCC DROPCLEANBUFFERS£º´Ó»º³å³ØÖÐɾ³ýËùÓУ¬Çå³ý»º³åÇø¡£
      ÔÚ½øÐвâÊÔʱ£¬Ê¹ÓÃÕâ¸öÃüÁî¿ÉÒÔ´Ósql server’sµÄÊý¾Ý»º´ædata catch(buffer)Çå³ýËùÓеIJâÊÔÊý¾Ý£¬ÒÔ±£Ö¤²âÊԵĹ«ÕýÐÔ¡£ÐèҪעÒâµÄÊÇÕâ¸öÃüÁîÖ»ÒÆ×߸ɾ»µÄ»º´æ£¬²»ÒÆ×ßÔ໺´æ¡£ÓÉÓÚÕâ¸öÔ­Òò£¬ÔÚÖ´ÐÐÕâ¸öÃüÁîÇ°£¬Ó¦¸ÃÏÈÖ´ÐÐCheckPoint£¬½«ËùÓÐÔàµÄ»º´æдÈë´ÅÅÌ£¬ÕâÑùÔÚÔËÐÐDBCC RROPCLEANBUFFERS ʱ£¬¿ÉÒÔ±£Ö¤ËùÓеÄÊý¾Ý»º´æ±»ÇåÀí£¬¶ø²»ÊÇÆäÖеÄÒ»²¿·Ö¡£
¡ô3.DBCC ErrorLog £ºÈç¹ûºÜÉÙÖØÆðmssqlserver·þÎñ£¬ÄÇô·þÎñÆ÷µÄÈÕÖ¾»áÔö³¤µÃºÜ¿ì£¬¶øÇÒ´ò¿ªºÍ²é¿´ÈÕÖ¾µÄËÙ¶ÈÒ²»áºÜÂý¡£Ê¹ÓÃÕâ¸öÃüÁ¿ÉÒԽضϵ±Ç°µÄ·þÎñÆ÷ÈÕÖ¾£¬Ö÷ÒªÊÇÉú³ÉÒ»¸öеÄÈÕÖ¾¡£¿ÉÒÔ¿¼ÂÇÉèÖÃÒ»¸öµ÷¶ÈÈÎÎñ£¬Ã¿ÖÜÖ´ÐÐÕâ¸öÃüÁî×Ô¶¯½Ø¶Ï·þÎñÆ÷ÈÕÖ¾¡£Ê¹Óô洢¹ý³Ìsp_cycle_errorlogÒ²¿ÉÒԴﵽͬÑùµÄÄ¿µÄ¡£
¡ô4.DBCC FLUSHPROCINDB:ÓÃÓÚÇåÀíÒ»¸öÊý¾Ý¿âʵÀýÖÐÖ¸¶¨Êý¾Ý¿âµÄ´æ´¢¹ý³ÌʹÓõĻº´æ¡£Êý¾Ý¿âµÄIDÊDZØÊä²ÎÊý
      ÔÚ²âÊÔʱ±£Ö¤ÒÔÇ°µÄ´æ´¢¹ý³Ì¼Æ»®²»»á¶Ô²âÊÔ½á¹ûÔì³É¸ºÃæÓ°Ï죬¿ÉÒÔʹÓÃÕâ¸ö´æ´¢¹ý³Ì¡£
¡¡¡¡Àý£º
 
DECLARE @intDBID INTEGER SET @intDBID = (select dbid from master.dbo.sysdatabases where name = 'database_name')
DBCC FLUSHPROCINDB (@intDBID)
 
¡ô5.DBCC FREEPROCCACHE£ºÓÃÓÚÇåÀíËùÓÐÊý¾Ý¿âµÄ¹ý³Ì¸ßËÙ»º´æ¡£
      ÀýÈ磬ÊͷŹý³Ì¸ßËÙ»º´æ½«µ¼ÖÂÖØбàÒëijЩ²¿·Ö(ÀýÈçÌرð SQL Óï¾ä)£¬¶ø²»ÊÇ´Ó¸ßËÙ»º´æÖжÔÆäÔÙʹÓÃ


Ïà¹ØÎĵµ£º

SQL SERVERÐÔÄÜÓÅ»¯ TempdbÏà¹ØÎÊÌâ

TEMPDB²»Ö§³Ö×Ô¶¯Ñ¹Ëõ£¬ÇÒËüµÄÊý¾Ý¿âºÍÎļþѹËõÄÜÁ¦ÊÇÓÐÏÞÖƵģ»
Èç²»µÃ²»Ñ¹ËõTEMPDBµÄ´óС£¬½¨ÒéʹÓÃÀëÏß¹¦ÄÜ£¬ÈçϲÙ×÷£º
1.Í£Ö¹SQL SERVER·þÎñ£»
2.ÕÒµ½sqlservr.exeÔÚ´ÅÅÌÖеÄλÖã»
3.ʹÓÃsqlservr.exeÊäÈëÃüÁîsqlservr -c -f,ÕâÑùÆô¶¯SQL SERVERʱ£¬TEMPDBµÄ´óСÄܹ»±£³Ö×îС£»
4.ʹÓÃTSQLÃüÁALTER DATA ......

SQL SERVER ÖÐÈçºÎʹÓÃÐÐËø

¸øÄã¸ö×îÏêϸµÄ°É ¿ÉÄÜÓÐÄãÒªµÄÄÚÈÝ
ËøµÄ¸ÅÊö
Ò». ΪʲôҪÒýÈëËø
¶à¸öÓû§Í¬Ê±¶ÔÊý¾Ý¿âµÄ²¢·¢²Ù×÷ʱ»á´øÀ´ÒÔÏÂÊý¾Ý²»Ò»ÖµÄÎÊÌâ:
¶ªÊ§¸üÐÂ
A,BÁ½¸öÓû§¶ÁͬһÊý¾Ý²¢½øÐÐÐÞ¸Ä,ÆäÖÐÒ»¸öÓû§µÄÐ޸Ľá¹ûÆÆ»µÁËÁíÒ»¸öÐ޸ĵĽá¹û,±ÈÈ綩Ʊϵͳ
Ôà¶Á
AÓû§ÐÞ¸ÄÁËÊý¾Ý,ËæºóBÓû§ÓÖ¶Á³ö¸ÃÊý¾Ý,µ«AÓû§ÒòΪijЩԭÒòÈ¡Ï ......

SQL SERVER 2005Êý¾Ý¼ÓÃÜ

-- ʾÀýÒ», ʹÓÃÖ¤Êé¼ÓÃÜÊý¾Ý.
-- ½¨Á¢²âÊÔÊý¾Ý±í
CREATE TABLE tb(ID int IDENTITY (1,1),data varbinary (8000));
GO
-- ½¨Á¢Ö¤ÊéÒ», ¸ÃÖ¤ÊéʹÓÃÊý¾Ý¿âÖ÷ÃÜÔ¿À´¼ÓÃÜ
CREATE CERTIFICATE Cert_Demo1 
WITH 
  SUBJECT = N'cert1 encryption by database master key' ,
  START_DATE = ......

DB2 SQLÐÔÄÜÓÅ»¯Ïà¹ØµÄ10´óÒªËØ

ÏÂÃæÌá³öÁË10ÌõºÍDB2 SQLÐÔÄÜÏà¹ØµÄ10ÌõÒòËØ£º
1¡¢ÌṩÊʵ±µÄͳ¼ÆÐÅÏ¢
¶ÔDB2ÓÅ»¯¹ÜÀíÆ÷£¨otimizer£©¶øÑÔ£¬ÈçºÎ¸ü¼ÓÓÐЧµÄÖ´ÐÐSQLÓï¾äÊÇÓÉ´æÔÚÓÚDB2 catalogÖеÄͳ¼ÆÐÅÏ¢¾ö¶¨µÄ£¬ÓÅ»¯Æ÷ÀûÓÃÕâЩÐÅÏ¢¾ö¶¨×îÓÅ»¯µÄ·¾¶¡£
Òò´Ë£¬ÎªÁ˱£³ÖϵͳÄܹ»×ö³ö×î¼ÑÑ¡Ôñ£¬ÐèÒª¾­³£µÄÔËÐÐRunstatsÃüÁÀ´±£³Öϵͳͳ¼ÆÐÅÏ¢µÄ¼°Ê±ÓÐЧ¡£Ô ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ