While restoring Sites using power shell, once can come across such a kind of error as given below:
“Restore-SPSite : No content databases are available for this operation but the site collection is scheduled for deletion in at least one content database. Either wait for the deletion operation to complete or create a content database, and then try the operation again. To create a content database, click “Content databases” on the Application Management page, select the Web application to use, and then click “Add a content database”.
That actually means that a site is already exist with this content database.
To resolve this issue.
- Use the command ‘Get-SPDeletedSite’ to see all the marked sites that are scheduled for deletion.
- Delete the site collection that you think is hosting the above backed up content databa using Remove-SPDeletedSite command. From Get-SPDeletedSite you get the SiteID which will be used in Remove-SPDeletedSite.
- Check with Get-SPDeletedSite once again if the site is deleted.
- Then move to the Central Admin > Monitoring > Review Timerjobs > look for “Run Gradual Site Deletion” Timer Job for your required webapplication.
- After running this TImer job, try restoring the Site collection again.
Hope this helps.