question

SaiVijaya avatar image
SaiVijaya asked

Need automation script to restore multiple databases at a time with overwrite and no recovery option

Hi All,

We are trying to restore FULL and T-log databases with overwrite and No recovery options from a backup folder. Can someone help me with the script for automation.

We want to join these databases to AG. It is taking 5 hours time manually.

Please help me.

t-sqlbackup-restoresql server 2017
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Jeff Moden avatar image
Jeff Moden answered

IIRC (guessing because I don't personally use it), you can visit https://dbatools.io/ to find a possible PowerShell solution.

If I had such a requirement, I'd write one that would work from T-SQL. It'll help you learn things that you don't currently know.

Also, as a disclaimer... we don't use AG so no help in that area. Sorry.

10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.