brain/04 Ressourcen/IT/SQL-Transaktionslog verklei...

34 lines
573 B
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
tags:
- upnote-import
---
# SQL-Transaktionslog verkleinern
## Auflistung aller DB-Files
```
SELECT
DB_NAME(database_id) AS DatabaseName,
name AS LogicalName,
physical_name AS PhysicalPath,
type_desc AS FileType,
size * 8 / 1024 AS SizeMB,
growth AS GrowthSetting,
is_percent_growth AS IsPercentGrowth
FROM sys.master_files
ORDER BY database_id, type;
```
Recovery-Mode auf SIMPLE einstellen
```
ALTER DATABASE krah_dwext SET RECOVERY SIMPLE
```
DB-File verkleinern, hier 100 MB
```
DBCC SHRINKFILE (##LogicalName##, 102400)
```