PowerShell script exchange
Post Reply
jdoty
Novice
Posts: 9
Liked: 2 times
Joined: Nov 20, 2018 12:25 am
Full Name: Jeff Doty
Contact:

Restore-VESQLDatabase taking more than 20 hours

Post by jdoty »

Hi All,

Little issue. I have been putting together a script to restore a SQL DB to one of our test servers so it can be refreshed for the Devs on a regular bases. I got to the point where it runs the Restore-VESQLDatabase command and the command runs and light green banner appeared with information on it. It got to the point of "Calculating required space" and has been there for 20 hours, so I am thinking something is messed up. Running this restore from the console doesn't take nearly this long.

Restore-VESQLDatabase -Database $database -ServerName $TargetSvr -InstanceName $TargetInstName -File $dbfiles -TargetPath $TargetFolders -force -GuestCredentials $Mycred -verbose

$database = <database name>
$TargetSvr = <target server>
$TargetInstName = <instance name>
$dbfiles = Get-VESQLDatabaseFile -Database $database
$TargetFolders = <Array of database files, matching $dbfiles results, but with the paths changed>
$Mycred = <My veeam restore credentials, which has rights to both servers>

I haven't canceled the task yet, because (hope springs eternal) and I was not sure if I would get an error code except to say I canceled the job. The job does show up in the UI history with three messages:
1/27/2021 1:04:30 PM Application item level restore started
1/27/2021 1:05:52 PM Restoring item <database name>... (Type: Database; Source: $SourceSvr\$SourceInstName; Target: $TargetSvr\$TargetInstName)
1/27/2021 1:05:57 PM Mounting restore point

Any assistance would be appreciated.
PetrM
Veeam Software
Posts: 3229
Liked: 520 times
Joined: Aug 28, 2013 8:23 am
Full Name: Petr Makarov
Location: Prague, Czech Republic
Contact:

Re: Restore-VESQLDatabase taking more than 20 hours

Post by PetrM » 1 person likes this post

Hi Jeff,

At first sight, it does not seem to be related to PowerShell but to mechanics of the restore process itself. I'd recommend to ask our support engineers to check logs in order to clarify what's going on behind the scenes and to determine the operation which takes most of time. Please don't forget to paste a support case ID for our reference.

Thanks!
jdoty
Novice
Posts: 9
Liked: 2 times
Joined: Nov 20, 2018 12:25 am
Full Name: Jeff Doty
Contact:

Re: Restore-VESQLDatabase taking more than 20 hours

Post by jdoty »

Hi PetrM,

Ok, I was afraid of that. I will open a case.

Jeff
oleg.feoktistov
Veeam Software
Posts: 1912
Liked: 635 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Restore-VESQLDatabase taking more than 20 hours

Post by oleg.feoktistov » 1 person likes this post

Hi Jeff,

I think, Petr is right. Your script and restore logic looks correct to me, so there isn't much we can do through the forums here.
It might be worth checking the cause of such performance with support engineers, indeed.

Thanks,
Oleg
jdoty
Novice
Posts: 9
Liked: 2 times
Joined: Nov 20, 2018 12:25 am
Full Name: Jeff Doty
Contact:

Re: Restore-VESQLDatabase taking more than 20 hours

Post by jdoty » 1 person likes this post

Ok Case opened: Case #04613417
Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests