Changing the individual database recovery model is very simple with the Microsoft SSMS. But recently in one of our Nimesa customer environments, he had 200 databases in a non-production instance and all the databases are in the simple recovery model.
That user wanted to do POC of Nimesa Application-aware backup and Point in time recovery for MS SQL database server, Log backups are not possible with the simple recovery model, so I executed a small PowerShell script which changes all the databases to the FULL recovery model from the simple recovery model
Get-SqlDatabase -ServerInstance NW1\CLUST2
The above Powershell command gets all the databses on the Server instance
Then with a foreach loop, executed below query to change the database to the FULL recovery model
ALTER DATABASE [$dbName] SET RECOVERY FULL WITH NO_WAIT
Passionate Developer with 7 years of extensive experience working for Data center related products. Contributed and lead the efforts in Solutioning and engineering in Nimesa Technologies for developing Dataprotection and Copy data management product for Private and Public Clouds
This is my personal weblog, opinions expressed here represent my own and not those of my employer.
All content provided on this blog is for informational purposes only and i will not be liable for any errors, losses, or damages from the display or use of this information.