Changing the Oracle Database Archiving mode

Consultando modo atual no Oracle (neste caso, o recurso está em archivelog mode):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
[oracle@oel7 ~]$ sqlplus / as sysdba
  
SQL*Plus: Release 19.0.0.0.0 - Production on Mon Jan 4 22:45:53 2021
Version 19.3.0.0.0
  
Copyright (c) 1982, 2019, Oracle.  All rights reserved.
  
  
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
  
SQL> ARCHIVE LOG LIST;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            +DG_RECO
Oldest online log sequence     17
Next log sequence to archive   19
Current log sequence           19
SQL>

Para desabilitar o log mode do banco, é necessário que o mesmo esteja no status MOUNTED.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
SQL> shu immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
  
Total System Global Area 2583690520 bytes
Fixed Size                  8899864 bytes
Variable Size             553648128 bytes
Database Buffers         2013265920 bytes
Redo Buffers                7876608 bytes
Database mounted.
SQL>

Para definir o NOARCHIVELOG mode, basta rodar o seguinte comando:

1
2
3
SQL> ALTER DATABASE NOARCHIVELOG;
  
Database altered.

Abrindo o banco e verificando o seu novo modo:

1
2
3
4
5
6
7
8
9
10
11
SQL> ALTER DATABASE OPEN;
  
Database altered.
  
SQL> ARCHIVE LOG LIST;
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            +DG_RECO
Oldest online log sequence     17
Current log sequence           19
SQL>

Para habilitar o archive log mode, basta fazer o processo inverso, como abaixo:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
SQL> shu immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> STARTUP MOUNT;
ORACLE instance started.
  
Total System Global Area 2583690520 bytes
Fixed Size                  8899864 bytes
Variable Size             553648128 bytes
Database Buffers         2013265920 bytes
Redo Buffers                7876608 bytes
Database mounted.
SQL> ALTER DATABASE ARCHIVELOG;
  
Database altered.
  
SQL> ALTER DATABASE OPEN;
  
Database altered.
  
SQL> ARCHIVE LOG LIST;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            +DG_RECO
Oldest online log sequence     17
Next log sequence to archive   19
Current log sequence           19
SQL>

2 thoughts on “Changing the Oracle Database Archiving mode”

  1. Pingback: Preparing the Primary Database for Oracle Data Guard – Bruno Santos da Silva

  2. Pingback: Preparing the Primary Database for Oracle Data Guard – SWIV

Leave a Comment

Your email address will not be published.