MS SQL database includes MDF file and LDF file.
MDF is actual data of an application and LDF file is a transaction log file which records the queries and the result. It can be optimized through "Shrink option for the file.
<How To Check Size of LDF and Reduce the size of the file>
1. Run SQL Management studio as administrator
2. Copy the below query and click on [Execute]
sp_helpdb BioStar;
![](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/24066262955/original/x1LsgM0ZEfWt1V_zuqTDHjTogP3M0xk_CA.png?1583280754)
3. Confirm the size of BioStar_log
4. Stop BioStar Server
5. Mouse right click on BioStar DB name and go Tasks>Shrink>Files
![](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/24066262953/original/HMZJYXlgqdtEjSIBSVh1NbVCCLveuq3Nog.png?1583280753)
![](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/24066262953/original/HMZJYXlgqdtEjSIBSVh1NbVCCLveuq3Nog.png?1583280753)
6. Click File Type>Log and click on [OK]
![](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/24066262954/original/SxBwIFr46ZMfi9D4Ga5zi8gUwhy3MZTwug.png?1583280753)
7. Copy the below query and click on [Execute] and check the result.
sp_helpdb BioStar;