New answers tagged shrink
Here is answer for my own question. Run the below query to get information about log files. select log_reuse_wait_desc from sys.databases where name = 'DBName' It will give output if there is any. I got following output. og_reuse_wait_desc REPLICATION There was some replication related objects remaining the database even after removing the ...
Steps for shrinking the log are going to be Backup transaction log through either SSMS or T-SQL and then perform a shrink commands for SSMS are under the tasks if you right click the database name BACKUP LOG <Databasename> TO DISK N'<path\database_log.ldf'; GO DBCC SHRINKFILE (<FileName>, <TargetSize>) WITH NO_INFOMSGS You will ...
Read How to Shrink SQL Server log for an explanation how the circular nature of the log may prevent shrink after truncation. Is possible that you log's last LSN point into a VLF that is at the tail of the LDF. Counter intuitively you must advance the log, by generating log writes, to allow it to shrink.
You need to create a backup first, dependent on the backup model that is set up for the database before you can shrink the database. You can try running this: USE <databasename> GO BACKUP DATABASE <databasename> TO DISK '<absolute path goes here>\<databasename>.bak'; GO Or you can do that from SSMS and use the graphical tools ...
Top 50 recent answers are included