Call Us! 1-800-555-5555

Habilitar el modo archivelog en Oracle 11g

Primero nos aseguramos que la DB no está en modo archivelog:


SQL> archive log list
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     165
Current log sequence           167

Ahora configuramos el destinos de los ficheros de archivado:


SQL> alter system set log_archive_dest_1='location=/u01/app/oracle/oradata/ORCL/archive' scope=spfile;
System altered.

Paramos la instancia y la arrancamos montandola:


SQL> shutdown immediate

Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup mount;
ORACLE instance started.

Total System Global Area  422670336 bytes
Fixed Size                  1300352 bytes
Variable Size             310380672 bytes
Database Buffers          104857600 bytes
Redo Buffers                6131712 bytes
Database mounted.

Arrancamos el proceso de archivado y abrimos la base de datos:


SQL> alter database archivelog;
Database altered.
SQL> alter database open;
Database altered.

Por último comprobamos que el sistema de archivado está funcionando:


SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /u01/app/oracle/oradata/ORCL/archive
Oldest online log sequence     165
Next log sequence to archive   167
Current log sequence           167
SQL> select name, log_mode from v$database;

NAME      LOG_MODE
--------- ------------
TEST      ARCHIVELOG

SQL> alter system switch logfile;

System altered.

SQL> /

System altered.

SQL> !ls -lrt /u01/app/oracle/oradata/ORCL/archive
total 44496
-rw-r----- 1 oracle oracle 45509632 2009-03-20 14:43 1_167_677948664.dbf
-rw-r----- 1 oracle oracle     1024 2009-03-20 14:43 1_168_677948664.dbf
SQL>

Links

http://apunhiran.blogspot.com/2009/03/how-to-enabling-archivelog-mode-in.html

Post to Twitter