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

»ñÈ¡SQL ServerµÄµ±Ç°Á¬½ÓÊý

»ñÈ¡SQL ServerµÄµ±Ç°Á¬½ÓÊý
[ת]http://www.cnblogs.com/confach/archive/2006/05/31/414156.html
Ê×ÏÈÉùÃ÷:Õâ¸öÎÊÌâÎÒûÓнâ¾ö
µ±ÍøÓÑÎʵ½ÎÒÕâ¸öÎÊÌâʱ,ÎÒÒ²»¹ÒÔΪºÜ¼òµ¥,ÒÔΪSQL ServerÓ¦¸ÃÌṩÁ˶ÔÓ¦µÄϵͳ±äÁ¿Ê²Ã´µÄ.µ«Êǵ½Ä¿Ç°ÎªÖ¹,ÎÒ»¹Ã»Óеõ½Ò»¸ö±È½ÏºÃµÄ½â¾ö·½°¸.¿ÉÄܼܺòµ¥,,Ö»²»¹ýÎÒ²»ÖªµÀ°ÕÁË.Ï£ÍûÈç´Ë..
ÏÂÃæÎÒ˵˵Ïà¹ØµÄ֪ʶ°É.Ï£Íû´ó¼Ò¿ÉÒÔ¸ø³öÒ»¸ö±È½ÏºÃµÄ·½·¨.
ÕâÀïÓм¸¸öÓëÖ®Ïà¹ØµÄ¸ÅÄî.
SQL ServerÌṩÁËһЩº¯Êý·µ»ØÁ¬½ÓÖµ(ÕâÀï¿É²»Êǵ±Ç°Á¬½ÓÊýÓ´!),¸öÈ˾õµÃ,ºÜÈÝÒײúÉúÎó½â.
ϵͳ±äÁ¿
@@CONNECTIONS ·µ»Ø×ÔÉÏ´ÎÆô¶¯ Microsoft® SQL Server™ ÒÔÀ´Á¬½Ó»òÊÔͼÁ¬½ÓµÄ´ÎÊý¡£
@@MAX_CONNECTIONS ·µ»Ø Microsoft® SQL Server™ ÉÏÔÊÐíµÄͬʱÓû§Á¬½ÓµÄ×î´óÊý¡£·µ»ØµÄÊý²»±ØΪµ±Ç°ÅäÖõÄÊýÖµ¡£
 
ϵͳ´æ´¢¹ý³Ì
SP_WHO
Ìṩ¹ØÓÚµ±Ç° Microsoft® SQL Server™ Óû§ºÍ½ø³ÌµÄÐÅÏ¢¡£¿ÉÒÔɸѡ·µ»ØµÄÐÅÏ¢£¬ÒÔ±ãÖ»·µ»ØÄÇЩ²»ÊÇ¿ÕÏеĽø³Ì¡£
ÁгöËùÓлµÄÓû§:SP_WHO ‘active’
Áгöij¸öÌض¨Óû§µÄÐÅÏ¢:SP_WHO ‘sa’
 
ϵͳ±í
Sysprocesses
 sysprocesses ±íÖб£´æ¹ØÓÚÔËÐÐÔÚ Microsoft® SQL Server™ ÉϵĽø³ÌµÄÐÅÏ¢¡£ÕâЩ½ø³Ì¿ÉÒÔÊÇ¿Í»§¶Ë½ø³Ì»òϵͳ½ø³Ì¡£sysprocesses Ö»´æ´¢ÔÚ master Êý¾Ý¿âÖС£
Sysperfinfo
°üÀ¨Ò»¸ö Microsoft® SQL Server™ ±íʾ·¨µÄÄÚ²¿ÐÔÄܼÆÊýÆ÷£¬¿Éͨ¹ý Windows NT ÐÔÄܼàÊÓÆ÷ÏÔʾ.
 
ÓÐÈËÌáÒé˵ΪÁË»ñÈ¡SQL ServerµÄµ±Ç°Á¬½ÓÊý:ʹÓÃÈçÏÂSQL:
SELECT COUNT(*) AS CONNECTIONS from master..sysprocesses
¸öÈËÈÏΪ²»¶Ô,¿´¿´.sysprocessesµÄlogin_timeÁоͿɿ´³ö.
ÁíÍâÒ»¸ö·½ÃæÊǽø³Ì²»ÄܺÍÁ¬½ÓÏàÌá²¢ÂÛ,ËûÃÇÊÇÒ»¶ÔÒ»µÄ¹ØϵÂð,Ò²¾ÍÊÇ˵һ¸ö½ø³Ì¾ÍÊÇÒ»¸öÁ¬½Ó?Ò»¸öÁ¬½ÓÓ¦¸ÃÓжà¸ö½ø³ÌµÄ,ËùÒÔÁ¬½ÓºÍ½ø³ÌÖ®¼äµÄ¹ØϵӦ¸ÃÊÇ1:nµÄ.
ÒòΪsysprocessesÁгöµÄ½ø³Ì°üº¬ÁËϵͳ½ø³ÌºÍÓû§½ø³Ì,ΪÁ˵õ½Óû§Á¬½Ó,¿ÉÒÔʹÓÃÈçÏÂSQL:
SELECT cntr_value AS User_Connections from master..sysperfinfo as p
WHERE p.object_name = 'SQLServer:General Statistics' And p.counter_name = 'User Connections'
¸öÈË»¹ÊÇÈÏΪ²»¶Ô,ÒòΪËüÊÇÒ»¸ö¼ÆÊýÆ÷,¿ÉÄÜ»áÀÛ¼ÓµÄ.
»¹ÓÐÒ»ÖÖ·½°¸ÊÇÀûÓÃÈçÏÂSQL:
select connectnum=count(distinct net_address)-1 from master..sysprocesses
ÀíÓÉÊÇnet_addressÊÇ·ÃÎÊÕß»úÆ÷


Ïà¹ØÎĵµ£º

¼¼Çɺ;÷ÇÏ£º·À·¶SQL×¢Èë¹¥»÷

¡¾Ô­ÎĵØÖ·¡¿Tip/Trick: Guard Against SQL Injection Attacks
¡¾Ô­ÎÄ·¢±íÈÕÆÚ¡¿ Saturday, September 30, 2006 9:11 AM
SQL×¢Èë¹¥»÷ÊǷdz£ÁîÈËÌÖÑáµÄ°²È«Â©¶´£¬ÊÇËùÓеÄweb¿ª·¢ÈËÔ±£¬²»¹ÜÊÇʲôƽ̨£¬¼¼Êõ£¬»¹ÊÇÊý¾Ý²ã£¬ÐèҪȷÐÅËûÃÇÀí½âºÍ·ÀÖ¹µÄ¶«Î÷¡£²»ÐÒµÄÊÇ£¬¿ª·¢ÈËÔ±ÍùÍù²»¼¯Öл¨µãʱ¼äÔÚÕâÉÏÃ棬ÒÔÖÁËûÃǵÄÓ¦Ó㬠......

SQL Server2008°¸ÀýÖ®CyberSavvy ¹«Ë¾

CyberSavvy ¼áÐÅÈí¼þ×Ô¶¯»¯¿ÉÒÔÈÿͻ§ÇáËÉÏíÊÜÉú»î¡£DataPlace ÊǸù«Ë¾µÄÈí¼þ¼´·þÎñ½â¾ö·½°¸£¬Ò²¿É³Æ֮Ϊ“Êý¾Ý¿â¹¤³§”£¬ËüÄܹ»ÈÃÃæÏò¼¼ÊõÒÔ¼°ÃæÏòÉÌÎñµÄÓû§´´½¨²¢ÐÞ¸Ä×Ô¼ºµÄÊý¾Ý¿â£¬¶øCyberSavvy ¹«Ë¾½«Îª¸ÃÊý¾Ý¿âÌṩÍйܷþÎñ¡£Òò´ËCyberSavvy ¹«Ë¾ÐèÒªÅÍʯ°ã¼á¹ÌµÄÊý¾Ý¿â£¬²¢Í¨¹ýÍòÎÞһʧµÄÊý¾Ý´«Êä»úÖÆÀ´Ö ......

SQL Server 2008 °¸Àý֮΢ÈíIT²¿ÃÅ

“¾­¹ý²âÊÔÎÒÃÇ·¢ÏÖSQL Server 2008µ±Öеı¸·ÝѹËõ¹¦ÄÜ¿ÉÒÔ1-3±¶µÄѹËõ±È£¬´Ó¶ø¼«´óµÄ¼õÉÙ±¸·ÝËùÐèµÄ´ÅÅ̿ռ䡣”Alexey Yeltsov, ΢Èíϵͳ¹ÜÀíÔ±Ö÷¹Ü¡£
΢ÈíÔÚÈ«ÊÀ½ç¹²ÓÐ6Íò¶àÃûÔ±¹¤£¬ÔÚ2006ÄêµÄ²ÆÕþÊÕÈ볬¹ýÁË500ÒÚÃÀ½ð£¬Óë´ËͬʱҲ²úÉúÁË´óÁ¿ÄÚ²¿Êý¾Ý£¬¹«Ë¾Ï£Íû¶ÔÕâЩÊý¾Ý½øÐм¯ÖÐÒÔ±ãÌṩ¿Í»§µÄ¼¯³É»¯ÊÓͼ¡£ ......

³£ÓõÄORACLE PL/SQL¹ÜÀíÃüÁîÒ»

Ô­ÎÄ£ºÁõÎä| ³£ÓõÄORACLE PL/SQL¹ÜÀíÃüÁîÒ»
ÊìϤORACLE¹ÜÀíµÄÒ»¶¨¶ÔÕâЩÃüÁî²»»áÄ°Éú£¬²»¹ý¶ÔÓÚÎÒÕâ¸ö¸Õ½Ó´¥ORACLE¹ÜÀíµÄÀ´Ëµ£¬»¹ÊÇÓбØÒª×öϼǼ£¬ÒÔ±ãËæʱ²é¿´¡£
Ò» µÇ¼SQLPLUS
sqlplus Óû§Ãû/ÃÜÂë@Êý¾Ý¿âʵÀý as µÇ¼½ÇÉ«;
Èç:Óû§sys(ÃÜÂëΪ123)ÒÔsysdbaµÄ½ÇÉ«µÇ¼Êý¾Ý¿âORACL£¬ÎÒÃÇ¿ÉÒÔÊäÈ룺sqlplus sy ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ