Skip to content

Commit

Permalink
Merge pull request #1 from gassantos/develop
Browse files Browse the repository at this point in the history
Documentação para Restauração SQL Server
  • Loading branch information
gassantos committed Sep 26, 2021
2 parents 336cc16 + 50b12e6 commit 1064f41
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 2 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
# MBA-SQLCourse
Repositório de material complementar para Estruturação e Manipulação de Dados em SQL
# Repositório de material complementar para SQL

* O conteúdo apresentado nesse repostório é disponibilizado aos alunos do **MBA em Ciência de Dados (PPGAd/UFF)**, pertinente à disciplina de ***Estruturação e Manipulação de Dados em SQL***. Para conhecer mais sobre o programa de pós-graduação, acesse a [página oficial](https://www.posadmuff.com.br).

## **Material Complementar para SQL Server em Docker**

* [Criar Ambiente SQL Server (Docker)](https://github.com/gassantos/MBA-SQLCourse/blob/main/SQLServer/Procedimento.md)
* [Restaurar Backup no SQL Server (Docker)](https://github.com/gassantos/MBA-SQLCourse/blob/main/SQLServer/Restore.md)
43 changes: 43 additions & 0 deletions SQLServer/Restore.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Restauração de Backup no SQL Server via Azure Data Studio

Após concluídas as etapas pertinentes ao [Procedimento SQL Server](https://github.com/gassantos/MBA-SQLCourse/blob/main/SQLServer/Procedimento.md), será iniciar os banco de dados (OLTP e DW) a partir dos arquivos de backup **_AdventureWorks_** disponíveis para o SQL Server 2017.

Caso não tenha feito o download dos arquivos de backup mencionados, acesse os links abaixo:

* [AdventureWorks (OLTP)](https://github.com/Microsoft/sql-server-samples/releases/download/adventureworks/AdventureWorks2017.bak)
* [AdventureWorks (DW)](https://github.com/Microsoft/sql-server-samples/releases/download/adventureworks/AdventureWorksDW2017.bak)

## **A) Enviar arquivo para MSSQL (Docker)**

1. Vá até o diretório onde estão os arquivos de backup:

Exemplo: ```bash cd ~/Downloads```

2. Acesse o *CONTEINER_ID* do MSSQL, executando:

```bash
docker ps | grep mssql | awk {'print $1'}
```

3. E faça a cópia do arquivo de backup para o contêiner:

```bash
docker cp "diretorio-backup-file" conteiner_id:/home
```

## **B) Restaurar backup via Azure Data Studio**

1. Inicie o Azure Data Studio
2. Vá em **SERVIDORES** e clique em **localhost** para conectar à instância
3. Clique com o botão direito em *localhost* e vá em **Gerenciar**
4. Agora você está na **Página Inicial** do SGBD, conforme a imagem:
![Iniciar a restauração](images/Inicia-Restauracao.png)

Comece o processo clicando em **Restaurar**.

1. Selecione o backup que será utilizado, conforme o diretório enviado via **_docker cp_** e confirme em **OK**. ![Iniciar a restauração](images/Seleciona-Backup.png)
2. Na etapa seguinte, defina a fonte de restauração como ***Arquivo de backup***. ![Iniciar a restauração](images/Restaura-Tela1.png)
3. Após definida a fonte de restauração, as demais informações serão automaticamente preenchidas, então basta confirmar no botão **Restaurar**. ![Iniciar a restauração](images/Restaura-Tela2.png)
4. Agora é só aguardar a **Restauração finalizar** e correr pro abraço :wink: ![Iniciar a restauração](images/Fim-Restauracao.png)

Procedimento de restore finalizado com sucesso :bowtie:
Binary file added SQLServer/images/Fim-Restauracao.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SQLServer/images/Inicia-Restauracao.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SQLServer/images/Restaura-Tela1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SQLServer/images/Restaura-Tela2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SQLServer/images/Seleciona-Backup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1064f41

Please sign in to comment.