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
6+ years of experience in building Data Protection, Copy Data Management and Storage management applications, automation software and plugins for private datacenter 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.