怎样查询磁盘的可用空间,数据文件及日志文件大小及利用率
2008-04-26 20:27
507 查看
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
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
相关文章推荐
- 怎样查询磁盘的可用空间,数据库数据文件及日志文件大小及利用率
- MS Sql Server查询磁盘的可用空间,数据库数据文件及日志文件的大小及利用率
- Sql Server查询磁盘的可用空间,数据库数据文件及日志文件的大小及利用率
- MS Sql Server查询磁盘的可用空间,数据库数据文件及日志文件的大小及利用率
- MS Sql Server查询磁盘的可用空间,数据库数据文件及日志文件的大小及利用率
- ORACLE ASM中查询表空间使用情况、数据文件路径、裸设备磁盘总大小剩余大小
- Linux被占用的日志文件清理后磁盘空间释放,但ll查看仍然显示曾经达到的最大大小,此时copy该文件也是按曾经最大的值占用空间
- Oracle查询表空间的使用情况和数据文件是否拓展及剩余可拓展大小
- Oracle 11g笔记——调整表空间和数据文件的大小、移动数据文件、联机重做日志文件、控制文件
- 『ORACLE』查询表空间使用率和数据文件大小(11g)
- Oracle 删除数据后释放数据文件所占磁盘空间
- 查看Oracle数据库表空间大小(空闲、已使用),是否要增加表空间的数据文件
- Ubuntu 查看文件以及磁盘空间大小管理
- 通过查询Android系统setting源代码掌握如何获取SD卡大小和可用空间
- 00039.Oracle查询表空间文件大小
- 解决MongoDB 日志文件过大,清理后还占用很大磁盘空间的问题
- oracle查询数据表占用空间的大小
- Sqlserver查询数据库文件大小和剩余空间
- 用备份控制文件做不完全恢复下的完全恢复(数据文件备份<旧>--新建表空间--控制文件备份<次新>--日志归档文件<新>)
- linux下使用 du查看某个文件或目录占用磁盘空间的大小