Selasa, 28 Februari 2017

Shrink file log.ldf dalam Sql Server

Cara mengecilkan Log.ldf pada SQL Server 2014 :

Masuk / Login SQL Server Manager.
Check recovery model and switch to simple mode.
select @@VERSION
Output :
Microsoft SQL Server 2014 - 12.0.4213.0 (X64)
                Jun  9 2015 12:06:16
                Copyright (c) Microsoft Corporation
                Enterprise Edition: Core-based Licensing (64-bit) on Windows NT 6.3 <X64> (Build 9600: )

Klik kanan pada database misalkan SharePoint_Config > Properties

















Database Properties – SharePoint_config
Pilih Options     
Recovery model               : Full       => dirubah menjadi Simple
Klik OK






















Klik OK
Langkah selanjutnya :
Klik kanan pada database Tasks > Shrink > Files (click)



Setelah di click :
File type               : Data    => rubah menjadi Log
Klik OK
Note sebelum klik OK, copy.
Pilih Shrink action             : Realease unused space.
Curently allocated space (LDF)   : 267436.13 MB   (space)                 => sebelum
Curently allocated space (LDF)   : 0.80 MB             (space)                 => setelah OK






















Proses hapus log :






















Setelah selesai Shrink File – SharePoint_Config_log

Klik kanan pada database misalkan SharePoint_Config > Properties
Database Properties – SharePoint_config
Pilih Options :
Recovery model               : Simple                => rubah menjadi Full



Cara cepat mengecilkan log .ldf :
DBCC SHRINKFILE(test_SSIS_log, 50);
GO

-- test_SSIS_log  => log ldf
-- 50   => diupdate menjadi 50 mb log ldfnya

-- check log ldf setelah di eksekusi


Terima kasih.

Tidak ada komentar:

Posting Komentar