I restored a Production database to test environment. In Prod it's configured to Transactional Replication and database around 400GB, log file alone 120GB.
I tried Database set to Simple recovery and shrink DBCC Shrinkfile
still log file size same (I know shrinking is not an ideal solution, but I want to make it small). There are no long running transactions and blocking
Here is what I followed:
* Backup database
ALTER DATABASE DatabaseName SET RECOVERY SIMPLE
GO
DBCC SHRINKFILE (databasenaem_log,5)
GO
ALTER DATABASE DatabaseName SET RECOVERY FULL
GO
I checked the sys.databases, log_reuse_wait_desc column and it shows "replication", this may be the reason log file won't allow shrinking. The problem is that there is no replication (publisher or subscriber) on the on the Database or server.
select name, log_reuse_wait_desc from sys.databases
Do I need to set up replication and turn off?