国产探花免费观看_亚洲丰满少妇自慰呻吟_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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 栖霞市| 开阳县| 深水埗区| 合肥市| 琼结县| 南溪县| 万宁市| 固原市| 郑州市| 广东省| 响水县| 漠河县| 景洪市| 略阳县| 梅州市| 自治县| 安溪县| 曲水县| 康定县| 来凤县| 华宁县| 黔西县| 宁海县| 东乌珠穆沁旗| 双鸭山市| 错那县| 莎车县| 清流县| 彰化县| 四子王旗| 武隆县| 南城县| 慈利县| 郑州市| 南郑县| 通道| 诏安县| 抚顺县| 随州市| 家居| 绥中县|