dataplat / dbatools

🚀 SQL Server automation and instance migrations have never been safer, faster or freer
https://dbatools.io
MIT License
2.39k stars 788 forks source link

Test-DbaLastBackup and/or Restore-DbaDatabase: Add a wait parameter for time between each database restore #9206

Open wsuhoey opened 6 months ago

wsuhoey commented 6 months ago

Summarize Functionality

Is it possible to add a parameter to Test-DbaLastBackup that is something like -Wait where it accepts a number in seconds to wait between each database restore test? For example, let's say I do a command like: TestDbaLastBackup -SqlInstance $servers -Verbose -Wait 5 it will then wait 5 seconds between each database (perhaps via something like a Start-Sleep in the foreach loop that handles each database to test) after it fully completes each database test (i.e. after 6. And the test database is finally dropped)

The main reason I'm requesting this is because I am getting errors/alerts like During restore restart, an I/O error occurred on checkpoint file '\\path\to\nas\RestoreCheckpointDB9.CKP' (operating system error (null)). The statement is proceeding but cannot be restarted. Ensure that a valid storage location exists for the checkpoint file. and I've confirmed that DB9 is the test database being restored, and I think the command might be going too fast for SQL Server and the NAS network share location to cleanup the .CKP file before moving on to the next database.

Is there a command that is similiar or close to what you are looking for?

Yes

Technical Details

No response