Ekinlikler
31 Mar 23 - 2 Nis 23
En büyük SQL, Fabric ve Power BI öğrenme etkinliği. 31 Mart – 2 Nisan. 400 ABD doları tasarruf etmek için FABINSIDER kodunu kullanın.
Bugün kaydolunBu tarayıcı artık desteklenmiyor.
En son özelliklerden, güvenlik güncelleştirmelerinden ve teknik destekten faydalanmak için Microsoft Edge’e yükseltin.
Applies to:
SQL Server
Azure SQL Database
Azure SQL Managed Instance
Returns space usage information for the transaction log.
Not
All transaction log files are combined.
Column name | Data type | Description |
---|---|---|
database_id | smallint | Database ID. In Azure SQL Database, the values are unique within a single database or an elastic pool, but not within a logical server. |
total_log_size_in_bytes | bigint | The size of the log |
used_log_space_in_bytes | bigint | The occupied size of the log |
used_log_space_in_percent | real | The occupied size of the log as a percent of the total log size |
log_space_in_bytes_since_last_backup | bigint | The amount of space used since the last log backup Applies to: SQL Server 2014 (12.x) and later, SQL Database. |
On SQL Server and SQL Managed Instance, requires VIEW SERVER STATE
permission.
On SQL Database Basic, S0, and S1 service objectives, and for databases in elastic pools, the server admin account, the Microsoft Entra admin account, or membership in the ##MS_ServerStateReader##
server role is required. On all other SQL Database service objectives, either the VIEW DATABASE STATE
permission on the database, or membership in the ##MS_ServerStateReader##
server role is required.
Requires VIEW SERVER PERFORMANCE STATE permission on the server.
The following query returns the total free log space in megabytes (MB) available in tempdb
.
USE tempdb;
GO
SELECT
(total_log_size_in_bytes - used_log_space_in_bytes)*1.0/1024/1024 AS [free log space in MB]
FROM sys.dm_db_log_space_usage;
Ekinlikler
31 Mar 23 - 2 Nis 23
En büyük SQL, Fabric ve Power BI öğrenme etkinliği. 31 Mart – 2 Nisan. 400 ABD doları tasarruf etmek için FABINSIDER kodunu kullanın.
Bugün kaydolunEğitim
Modül
SQL Server kaynaklarını en iyi performans için yapılandırma - Training
SQL Server kaynaklarını en iyi performans için yapılandırma
Belgeler
sys.dm_db_log_info (Transact-SQL) - SQL Server
sys.dm_db_log_info (Transact-SQL) dinamik yönetim işlevi, işlem günlüğünden sanal günlük dosyası (VLF) bilgilerini döndürür.
İşlem günlüğü hakkında bilgi edinin. Her SQL Server veritabanı, sistem hatası olduğunda ihtiyacınız olan tüm işlemleri ve veritabanı değişikliklerini kaydeder.
Günlük Dosyası Otomatik Küçültme Olay Sınıfı - SQL Server
Günlük Dosyası Otomatik Küçültme Olay Sınıfı