SQL managed instance PITR latest backup time
Hello.
I have installed SQLMI1 and SQLMI2 and i try to simulate if SQLMI1 goes down and i try to restore database/s from LATEST PITR backup time to SQLMI2.
Once i take down (stop) SQLMI1 from portal it obviously dont take any PITR backups anymore.
I create new SQLMI2 in same region and subcsription and via portal i am trying to restore database from SQLMI1.
I get error:
If i try to do restore from Powershell
$RestorePITRtime=Get-Date #get current time
$RestorePITRtime=$RestorePITRtime.ToUniversalTime() #convert to UTC
Restore-AzSqlInstanceDatabase -FromPointInTimeBackup -ResourceGroupName $srcResourceGroupName -InstanceName $srcInstanceName -Name $Database -PointInTime
$RestorePITRtime
-TargetInstanceDatabaseName $Database"_restored" -TargetResourceGroupName $dstResourceGroupName -TargetInstanceName $dstInstanceName
i get same error
It looks like i have to specify time of restore right before SQLMI1 went down, BUT HOW i could know the time of last backup on SQLMI1.
- I can try to figure out time when SQLMI1 went down, but is this good approach?
- Does anyone know how to retrieve latest PITR backup time/point?