브랜드

Impact-Company-Logo-English Black-01-177x54

슈나이더 일렉트릭 코리아 웹사이트에 방문해 주셔서 감사합니다.

슈나이더 일렉트릭 코리아 웹사이트 방문자 분들 모두 환영합니다.
		
오늘 무엇을 도와드릴까요?
How to shrink the transaction log file in SQL Server

Article available in these languages: Czech

Issue
When it is observed that a SQL Server transaction log file (.ldf) has grown significantly it may be desirable to reduce the size of this database log file.

Product
Struxureware Power Monitoring
Power Monitoring Expert
ION Enterprise
ION EEM

Environment
SQL Server 2005, SQL Server 2008 R2, SQL Server 2012, SQL Server 2014, SQL Server 2016, SQL Server 2017, SQL Server 2019


Cause
Transaction log files store all of the transactions and the database modifications made by these transactions as updates and changes to the database occur.
As more and more transactions modify the database and there is more transaction activity than maintenance activity on the transaction log, these logs will grow.
In particular, if there was some unusual amount of activity on the database, this would cause the logs to grow quickly.  Another possible cause could be that the Automatic grow file option has been set too high such that the transaction log file will grow by x% resulting in an exponential file growth.

Resolution
*Warning: Irreparable database damage can occur. This procedure should only be performed by users familiar with SQL Server Management Studio. Databases should be backed up prior to performing this procedure.*


If you know that a transaction log file contains unused space that you will not need, you can reclaim the excess space by reducing the size of the transaction log. This process is known as shrinking the log file. Shrinking data files recovers space by moving pages of data from the end of the file to unoccupied space closer to the front of the file. When enough free space is created at the end of the file, data pages at the end of the file can deallocated and returned to the file system.

To shrink a data or log file using SQL Management Studio:
  1. In Object Explorer, connect to an instance of the SQL Server Database Engine and then expand that instance.
  2. Expand Databases and then right-click the database that you want to shrink.
  3. Point to Tasks, point to Shrink and then click Files.
  4. Select the file type and file name.
  5. Optionally, select the Release unused space check box. Selecting this option causes any unused space in the file to be released to the operating system and shrinks the file to the last allocated extent. This reduces the file size without moving any data.
  6. Optionally, select the Reorganize files before releasing the unused space check box. If this is selected, the Shrink file to value must be specified. By default, the option is cleared.  Selecting this option causes any unused space in the file to be released to the operating system and tries to relocate rows to unallocated pages.
  7. Optionally, enter the maximum percentage of free space to be left in the database file after the database has been shrunk. Permissible values are between 0 and 99. This option is only available when Reorganize files before releasing unused space is activated.
  8. Optionally, select the Empty file by migrating the data to other files in the same filegroup check box. Selecting this option moves all data from the specified file to other files in the filegroup. The empty file can then be deleted. This option is the same as executing DBCC SHRINKFILE with the EMPTYFILE option.
  9. Click OK.
To watch a video on how to shrink the ION_Data Transaction log, visit article FA284384

슈나이더 일렉트릭 Korea

자세히 알아보기
제품군
자세히 알아보기
제품군

도움이 필요하신가요?

  • 제품 선택기

    애플리케이션에 적합한 제품과 액세서리를 빠르고 쉽게 찾을 수 있습니다.

  • 견적 받기

    영업 관련하여 온라인으로 문의하시면 전문가가 연락드립니다.

  • 구매처

    해당 지역의 가장 가까운 슈나이더 일렉트릭 대리점을 쉽게 찾을 수 있습니다.

  • 지원 센터

    한 곳에서 모든 요구 사항에 대한 지원 리소스를 찾아보십시오.

  • 제품 문서
  • 소프트웨어 다운로드
  • 제품 선택기
  • 제품 대체 및 교체
  • 지원 및 연락처 센터
  • 영업소 검색
  • 견적 받기
  • 슈나이더 일렉트릭 커뮤니티
  • 채용
  • 회사 소개
  • 부정 행위 보고
  • 접근성
  • 뉴스룸
  • 투자자
  • Ecostruxure
  • 작업 검색
  • 블로그
  • 개인정보 취급방침
  • 쿠키 공지
  • 사용 약관
  • Change your cookie settings