MoreCore Platform
Disaster Recovery
Recovery Procedures
Recovery Proc - 5B
MOR-PROC-021 Version 1 Last Review Date: Nov, 2024

Restore an Azure SQL Database via PIT backup

1. Failure Scenario

This recovery plan relates to the following Failure Scenarios:

Failure Scenario IDTitleLink
5BDatabase CorruptionLink

2. Backup Components

Backup IDEnvironmentResource TypeResourceLink
TBCProdAzure SQL Database PITR backupcmms-prodSR to add link
TBCTestAzure SQL Database PITR backupcmms-testSR to add link

3. Required Credentials and Permissions

EnvironmentServiceCredentialLocationPermission
ProdAzure PortalAbility to modify prod database resources.
ProdSQL Server (Primary)NAIP is in SQL Server whitelist.
ProdSQL Server (Secondary)NAIP is in SQL Server whitelist.
TestAzure PortalAbility to modify test database resources.

4. Required Software

SoftwarePurposeNotesLink
SQL Server Management Studio (SSMS)Perform database updates
BrowserPerform Azure Portal stepsNA

5. Recovery Procedure

Backup and Restore

  • Check backups: Azure provides automated backups (for services like Azure SQL Database). Verify that you have a recent backup of the database, which can help you restore it to a working state.

Use Data Recovery Options

  • Azure SQL Database Point-in-Time Restore: If your Azure SQL database is corrupted, you should perform a point-in-time restore to revert to a time before the corruption occurred.

How To Restore SQL Database in Azure Portal

1. Navigate to https://portal.azure.com/#home (opens in a new tab)

2. Click the "Search resources, services, and docs (G+/)" field.

3. Type "sql"

4. Click "SQL databases"

5. Click "cmms-test (cbc/cmms-test)"

6. Click "Restore"

7. Click here - Select a Date and Time that you are confident the corruption had not occurred.

8. Select an Appropriate Date & Time to Restore from

9. Click here.

10. Click "Review + create"

11. Click "Create"

turn off Geo Replication

1. Navigate to https://portal.azure.com/#view/HubsExtension/BrowseResource/resourceType/Microsoft.Sql%2Fservers%2Fdatabases (opens in a new tab)

2. Click the "Search resources, services, and docs (G+/)" field.

3. Type "sql"

4. Click "SQL databases"

5. Click "cmms-test (cbc/cmms-test)"

6. Click "Replicas"

7. Click here.

8. Click this icon.

9. Click here.

10. Click here.

Rename the Original Database
MORPROC021001
MORPROC021002
Rename the newly created database to Original Name
MORPROC021001
MORPROC021002
Rename the old Geo replicated Database
MORPROC021001
MORPROC021002
turn on Geo replication

1. Navigate to https://portal.azure.com/#home (opens in a new tab)

2. Click the "Search resources, services, and docs (G+/)" field.

3. Type "sql"

4. Click "SQL databases"

5. Click "cmms-test (cbc/cmms-test)"

6. Click "Replicas"

7. Click here.

8. Click "Toggle"

9. Click here.

10. Click "Review + create"

11. Click "Create"

Rebuild the Database (if needed)

  • If you can't recover the database or the corruption is beyond repair, consider rebuilding the database from scratch, using any available backups or exports.

Key Points to Remember:

  • Restore from backup is usually the most effective way to resolve database corruption.
  • Run diagnostic checks to identify the scope of the corruption.
  • Contact Azure support if you're unable to resolve the issue using available tools and methods.