# Disaster Recovery

Data Stream as a stand alone product is not disaster tolerant but works in conjunction with industry leading products to form a disaster recovery process.

{% hint style="success" %}
Disasters are never a planned event but planning for one is critical to minimizing impact.&#x20;
{% endhint %}

## Microsoft SQL Agent

Data Stream recommends the use of [Ola Hallengren Scripts](https://ola.hallengren.com/).

{% hint style="warning" %}
Don't forget to set a backup schedule for each Microsft SQL Agent Job. \[[Reference](https://docs.microsoft.com/en-us/sql/ssms/agent/schedule-a-job?view=sql-server-2017)]
{% endhint %}

### Ola Hallengren Scripts

Download the scripts [here](https://ola.hallengren.com/scripts/MaintenanceSolution.sql).

<div align="left"><img src="https://490106859-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LTSxUDgh5E8mrrG8_9m%2F-LTd9sYqIxh0yoYnizxX%2F-LTdBESBUYugG6dkW14M%2FOlaHallengrenSqlBackupJobs.png?alt=media&#x26;token=600cac8c-1b5d-48ab-ba8a-7213e5d68a0c" alt="Once you have successfully executed the Ola Hallengren Scripts, the Microsoft SQL server agent should contain the following jobs."></div>

## Load Balancing Fail-over

### Manual Fail-over

When the mirrored database is synchronized, the database owner or system administrator can initiate manual fail-over to the secondary server.

```sql
USE master;
GO

ALTER DATABASE [DataStream] SET PARTNER FAILOVER;
```

{% hint style="warning" %}
Validation of mirroring status is critical to a successful fail-over. \[[Reference](https://support.getdatastream.com/support/load-balancing#validation)]
{% endhint %}

### Automatic Fail-over

Automatic fail-over occurs when the fast startup is disabled and computer is properly shutdown.

{% hint style="danger" %}
Automatic fail-over will not occur in a loss of power disaster.
{% endhint %}

#### Disabling Fast Startup

<div align="left"><img src="https://490106859-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LTSxUDgh5E8mrrG8_9m%2F-LThdx2qg-tm8xS5644Z%2F-LThfA7TpEgvn-dFMemX%2FDisableFastStartup.png?alt=media&#x26;token=98a2a167-cfda-42bc-ba62-5f0ac2272de2" alt=""></div>
