国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

怎樣查詢磁盤的可用空間,數據庫數據文件及日志文件大小及利用率

2024-07-21 02:06:26
字體:
來源:轉載
供稿:網友
國內最大的酷站演示中心!

1. to check the available disk space, you may use the undocumented system extended stored procedure xp_fixeddrives,  which can return the available free space (mb) for each fixed drive. you can run it as follows:

exec master.dbo.xp_fixeddrives


2. as for the database data file and transaction log space allocation and utilization, you may use the following query to query this:

1) you may check the file size (in mb) by query the sysfiles table as follows:

select name, convert(float,size) * (8192.0/1024.0)/1024. from dbo.sysfiles

2) to check the utilization, you may use sp_spaceused:

exec sp_spaceused

the database_size column is the sum of data files and log files, and the "unallocated space" column is the total unallocated space in the database.

to check the log file's utilization, you may use:

dbcc sqlperf(logspace)

for more information regarding the sysfiles table, dbcc sqlperf(logspace) and sp_spaceused, please refer to sql server books online.

in fact, you can view the similar information in sql enterprise manager: in enterprise manager, right click the database, click view -> taskpad, then you can see the data and log files size and utilization at the right

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 桐柏县| 海淀区| 仁布县| 峨眉山市| 天台县| 淄博市| 灵山县| 淮安市| 彭山县| 桃园县| 十堰市| 咸阳市| 灵石县| 上虞市| 灵丘县| 平阴县| 徐水县| 西乌珠穆沁旗| 清镇市| 句容市| 河津市| 津市市| 齐河县| 长春市| 潼关县| 怀来县| 开封市| 汨罗市| 遵义市| 合作市| 贵溪市| 河池市| 泾阳县| 城口县| 东至县| 维西| 石渠县| 张家界市| 浮梁县| 广平县| 灵川县|