> For the complete documentation index, see [llms.txt](https://ajuda.pdvlegal.com.br/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ajuda.pdvlegal.com.br/pdv/configuracao-do-pdv/limpeza-do-banco-de-dados.md).

# Limpeza do banco de dados

Limpe o histórico local do terminal com segurança e preserve cadastros, produtos e configurações do PDV.

{% hint style="danger" %}
**Pré-requisitos:**

1. **Backup dos dados:**
   * *PDV > Configurar > Backup dos Dados > OK*.
2. **Sincronizar vendas:**
   * *PDV > Vendas > +Funções > Sincronizar*.
     {% endhint %}

***

**Passo a Passo para realizar uma limpeza no banco de dados:**

**1 - Acessar a função de limpeza:**

* *PDV > Configurar > Limpeza Banco*.

**2 - Obter a chave de segurança:**

* Acesse **Retaguarda Cloud > Administrativo > Filiais > \[Sua Filial] > Meus Terminais.**
* Clique no **ícone de informação (ℹ️)** do terminal desejado > Copie a chave (validade: **1 hora**).

**3 - Executar limpeza:**

* Insira a chave no PDV > Confirme a operação.

<figure><img src="https://1320237751-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLaIVEmahy7qwD0rmQzED%2Fuploads%2FUvhSqIDdzWk4ALpwppMg%2Fpdv_limpeza_dados.gif?alt=media&amp;token=dbd9315f-a88c-4c5b-acb6-6b4ce4096a72" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
**Após a limpeza:**

* **Dados removidos:** Histórico de vendas local.
* **Dados preservados:** Cadastros, configurações, produtos.
  {% endhint %}

***

### Resolver problemas comuns

{% hint style="danger" %}

* **Problema:** Chave de segurança inválida.
  * *Solução:* Gere uma nova chave no Retaguarda Cloud (ela expira a cada 1 hora).
* **Problema:** Dados não sincronizados.
  * *Solução:* Repita a sincronização (*+Funções > Sincronizar*) antes da limpeza.
* **Problema:** Limpeza não concluída.
  * *Solução:* Reinicie o PDV e repita o processo com uma chave atualizada.
    {% endhint %}

***

### Dicas rápidas

{% hint style="success" %}

* **Agende a limpeza:** Faça fora do horário de pico para evitar interrupções.
* **Verifique o backup:** Confira se o arquivo de backup foi gerado (*PDV > Configurar > Backup*).
* **Uso do Compartilhador:** Após a limpeza, configure o Compartilhador para centralizar dados em múltiplos PDVs.
  {% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://ajuda.pdvlegal.com.br/pdv/configuracao-do-pdv/limpeza-do-banco-de-dados.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
