SQL Server 查詢資料大小

來源:互聯網
上載者:User

標籤:資料庫   from   邏輯   ase   檔案路徑   font   包括   logic   情況   

SELECT DB_NAME(database_id) AS [Database Name],[Name] AS [Logical Name],[Physical_Name] AS [Physical Name],((size * 8) / 1024/1024) AS [Size(GB)],[differential_base_time] AS [Differential Base Time]FROM sys.master_files

1、查詢各個磁碟分割的剩餘空間:
Execmaster.dbo.xp_fixeddrives

2、查詢資料庫的資料檔案及記錄檔的相關資訊(包括檔案組、當前檔案大小、檔案最大值、檔案增長設定、檔案邏輯名、檔案路徑等)
select* from [資料庫名].[dbo].[sysfiles]
轉換檔大小單位為MB:
selectname, convert(float,size) * (8192.0/1024.0)/1024. from [資料庫名].dbo.sysfiles

3、查詢當前資料庫的磁碟使用方式:
Execsp_spaceused

4、查詢資料庫伺服器各資料庫記錄檔的大小及利用率
DBCCSQLPERF(LOGSPACE)

SQL Server 查詢資料大小

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.