I have a SQL Server 2008 Express Database which is 7.8 GB in size
DataFile 1.2 GB
LogFile 6.6 GB
Recovery Model = Full
Auto Shrink = False
On a Live database, what is the best way to reduce the size of this database?
Before you can shrink a database running in full recovery model, you must backup the transaction log. So the procedure is to run a transaction log backup, and then shrink the log file.
If you have never performed a transaction log backup then you will continue to suffer from run-away log files and shrinking it will only be a band-aid solution.
ALTER DATABASE [MY_DATABASE] SET RECOVERY SIMPLE WITH NO_WAITand you can use windows task scheduler to create a full backup on whatever schedule makes sense for your application. Database backup codeBACKUP DATABASE [MY_DATABASE] TO DISK = N'C:\mydatabase.bak' WITH NOFORMAT, NOINIT, NAME = N'My Database backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10But, don't try any of this in production, yet. The backup is fine, it won't hurt you. Before change anything production related, try them in a dev/test environment first and evaluate the results.