怎样查询磁盘的可用空间,数据文件及日志文件大小及利用率

<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 728x15, 创建于 08-4-23MSDN */ google_ad_slot = "3624277373"; google_ad_width = 728; google_ad_height = 15; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 160x600, 创建于 08-4-23MSDN */ google_ad_slot = "4367022601"; google_ad_width = 160; google_ad_height = 600; //--> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>

1.Tocheckthe availablediskspace,youmay usetheundocumentedsystemextendedstoredprocedurexp_fixeddrives, whichcanreturntheavailablefreespace(MB)foreachfixeddrive.Youcanrunitasfollows:

Execmaster.dbo.xp_fixeddrives


2.Asforthedatabasedatafileandtransactionlogspaceallocationandutilization,youmayusethefollowingquerytoquerythis:

1)Youmaycheckthefilesize(inMB)byquerythesysfilestableasfollows:

selectname,convert(float,size)*(8192.0/1024.0)/1024.fromdbo.sysfiles

2)Tochecktheutilization,youmayusesp_spaceused:

Execsp_spaceused

Thedatabase_sizecolumnisthesumofdatafilesandlogfiles,andthe"unallocatedspace"columnisthetotalunallocatedspaceinthedatabase.

Tocheckthelogfile'sutilization,youmayuse:

DBCCSQLPERF(LOGSPACE)

Formoreinformationregardingthesysfilestable,dbccsqlperf(logspace)andsp_spaceused,pleaserefertoBooksOnline.

Infact,youcanviewthesimilarinformationinSQLEnterpriseManager:inEnterpriseManager,rightclickthedatabase,clickView->Taskpad,thenyoucanseethedataandlogfilessizeandutilizationattheright


<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 728x15, 创建于 08-4-23MSDN */ google_ad_slot = "3624277373"; google_ad_width = 728; google_ad_height = 15; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 160x600, 创建于 08-4-23MSDN */ google_ad_slot = "4367022601"; google_ad_width = 160; google_ad_height = 600; //--> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
阅读更多
文章标签: 磁盘 float
个人分类: 数据库
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭