Habilitar a funcionalide de Flashback no banco de dados é uma tarefa simples que envolve o parâmetro DB_FLASHBACK_RETENTION_TARGET e a ativação do Flashback na base de dados. Sendo assim, neste post estarei abordando a ativação desta funcionalidade .
Segue abaixo o exemplo:
- Configuração do parâmetro DB_FLASHBACK_RETENTION_TARGET para definir o tempo de retenção a cada snapshot do Flashback:
SQL> select instance_name, status from v$instance; INSTANCE_NAME STATUS ---------------- ------------ orabol2 OPEN SQL> ALTER SYSTEM SET DB_FLASHBACK_RETENTION_TARGET=1440; System altered. SQL> show parameters DB_FLASHBACK_RETENTION_TARGET NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_flashback_retention_target integer 1440
- Ativação do Flashback na base de dados:
SQL> ALTER DATABASE FLASHBACK ON; Database altered.
- Validação das configurações definidas através das views V$FLASHBACK_DATABASE_STAT e V$DATABASE:
SQL> SELECT FLASHBACK_ON FROM V$DATABASE; FLASHBACK_ON ------------------ YES SQL> set pages 2000 SQL> set lines 2000 SQL> select * from V$FLASHBACK_DATABASE_STAT; BEGIN_TIM END_TIME FLASHBACK_DATA DB_DATA REDO_DATA ESTIMATED_FLASHBACK_SIZE --------- --------- -------------- ---------- ---------- ------------------------ 26-FEB-17 26-FEB-17 40960 0 1536 0 SQL>
- Caso decida desabilitar o Flahsback, segue o exemplo:
SQL> ALTER DATABASE FLASHBACK OFF; Database altered. SQL> SQL> SQL> SELECT FLASHBACK_ON FROM V$DATABASE; FLASHBACK_ON ------------------ NO
Hi! I am Bruno, a Brazilian born and bred, and I am also a naturalized Swedish citizen. I am a former Oracle ACE and, to keep up with academic research, I am a Computer Scientist with an MSc in Data Science and another MSc in Software Engineering. I have over ten years of experience working with companies such as IBM, Epico Tech, and Playtech across three different countries (Brazil, Hungary, and Sweden), and I have joined projects remotely in many others. I am super excited to share my interests in Databases, Cybersecurity, Cloud, Data Science, Data Engineering, Big Data, AI, Programming, Software Engineering, and data in general.
(Continue reading)