I have a database on SQL Server Express used for 3 Asp.net applications. The Recovery Model is Full.
Every day I execute a backup with this code
BACKUP DATABASE @databaseName TO DISK = @file WITH INIT, SKIP, NOREWIND, NOUNLOAD, STATS = 10
BACKUP LOG @databaseName TO DISK = @fileLog WITH NOFORMAT, NOINIT, NAME = N'Database-Transaction Log Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
When the Start Mode of Application Pools are on OnDemand the LDF is reduced every day; when I use AlwaysRunning the log is not reduced.
I want use application pools with always running. Can I use shrink to reduce log size? Even if users are using websites?
ALTER DATABASE [DatiMachinaWeb] SET RECOVERY SIMPLE
DBCC SHRINKFILE(DatiMachinaWeb_log)
ALTER DATABASE [DatiMachinaWeb] SET RECOVERY FULL
Am I wrong? How can i solve? Thanks