obrezka_tranc_fajlov_sistemnix_bd_sql

Различия

Показаны различия между двумя версиями страницы.

Ссылка на это сравнение

Следующая версия
Предыдущая версия
obrezka_tranc_fajlov_sistemnix_bd_sql [2025/06/06 09:12]
tro создано
obrezka_tranc_fajlov_sistemnix_bd_sql [2025/08/15 11:07] (текущий)
tro
Строка 1: Строка 1:
 ====== Обрезка (tranc) файлов системних БД SQL ====== ====== Обрезка (tranc) файлов системних БД SQL ======
 <code> <code>
 +-- Connect to temp databse
 USE tempdb; USE tempdb;
 +GO
 +
 +-- Show all file of this databse
 +EXEC sp_helpfile;
 GO GO
  
 -- This command shrinks the primary data file -- This command shrinks the primary data file
-DBCC SHRINKFILE (tempdev, '<target_size_in_MB>');+DBCC SHRINKFILE (tempdev, 0);
 GO GO
  
 -- This command shrinks the log file, examine the last paragraph. -- This command shrinks the log file, examine the last paragraph.
-DBCC SHRINKFILE (templog, '<target_size_in_MB>');+DBCC SHRINKFILE (templog, 0);
 GO GO
 </code> </code>
 +<code>
 +USE tempdb;
 +EXEC sp_helpfile;
 +DBCC SHRINKFILE (tempdev, 0);
 +DBCC SHRINKFILE (templog, 0);
 +</code>
 +
 +
 +Після обрізки бажано ребутнути службу СКУЛЬ бо він може тримати фізично місце на диску під ці файли хоча данних в них вже не буде
  • /sites/data/attic/obrezka_tranc_fajlov_sistemnix_bd_sql.1749201130.txt.gz
  • Последнее изменение: 2025/06/06 09:12
  • tro