GTUTO
https://www.gtuto.com/sql-server-limiter-log-ldf/
Export date: Thu Apr 18 22:44:26 2024 / +0000 GMT

SQL Server limiter log.ldf


Avec SQL SERVER de Microsoft, La taille des des fichier log_ldf  devient rapidement ingérable.



J'ai même vu certains éditeurs recommander à leurs client de changer de serveur lorsque le disque dur est plein.

Se sont les log de transactions SQL qui ne sont jamais effacés. Il est très simple d'en limiter la taille :

 

Instruction SQL à envoyer au serveur pour supprimer les données inutiles ( par l'éditeur du soft).

ALTER DATABASE [MaDB] SET RECOVERY SIMPLE WITH NO_WAIT

DBCC SHRINKDATABASE ([MaDB], 1, TRUNCATEONLY)

ALTER DATABASE [MaDB] SET RECOVERY FULL WITH NO_WAIT

pour limiter les logs à 500Mo au lieu de purger

ALTER DATABASE SharePoint_Config SET RECOVERY SIMPLE WITH NO_WAIT

DBCC SHRINKFILE(SharePoint_Config_log, 1000)

ALTER DATABASE SharePoint_Config SET RECOVERY FULL WITH NO_WAIT

 

En mode graphique administrateur SQL :

o to the Object Explorer pane in SSMS and right click on the database in question. Choose tasks -> shrink -> files. Change the file type option to Log, click the "Reorganize pages before releasing unused space" option, and set the value to 1 MB. Hit OK.

If this doesn't work, check to see if your database is set up with a Full database recover model. Right click the database and go to properties. Choose Options, and check the Recover model option. Set to simple (if you can!!!), then shrink the logs.
Post date: 2016-01-23 15:21:08
Post date GMT: 2016-01-23 15:21:08

Post modified date: 2016-01-23 15:24:42
Post modified date GMT: 2016-01-23 15:24:42

Export date: Thu Apr 18 22:44:26 2024 / +0000 GMT
This page was exported from GTUTO [ https://www.gtuto.com ]
Export of Post and Page has been powered by [ Universal Post Manager ] plugin from www.ProfProjects.com