SQL> archive log list
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination /u01/app/oracle/product/11.2.0/Db_1/dbs/arch
Oldest online log sequence 416
Current log sequence 418
Tambien se puede verificar con el siguiente query
SQL> select log_mode from v$database;
LOG_MODE
------------
NOARCHIVELOG
Antes de habilitarlo tenemos dos opciones para dejar los archivelogs :
1 - Usar FRA (Fast Recovery Area)
2 - Usar un path especifico
Opción 1 -
Usando FRA. Es una alternativa a partir de Oracle 10g
1 - Verificar si esta configurada en los parametros db_recovery_file_dest y db_recovery_file_dest_size sino configurarla.
SQL> show parameters recovery
NAME TYPE VALUE
------------------------------------ ----------- ------------------------
db_recovery_file_dest string
db_recovery_file_dest_size big integer 0
recovery_parallelism integer 0
Configurar el FRA. Darle un tamaño y el path.
SQL> alter system set db_recovery_file_dest_size=10G;
System altered.
SQL> alter system set db_recovery_file_dest='/FRA';
System altered.
Para habilitar Archivelog Mode hay que bajar la base, montarla, modificar y abrir la base.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 8985837568 bytes
Fixed Size 2177168 bytes
Variable Size 6140462960 bytes
Database Buffers 2818572288 bytes
Redo Buffers 24625152 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 USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 416
Next log sequence to archive 418
Current log sequence 418
Opción 2 -
Asignar una ubicación, en este ejemplo /archives
SQL> alter system set log_archive_dest_1='LOCATION=/archives';
System altered.
Ver default formato de archives
SQL> show parameters log_archive_format
NAME TYPE VALUE
------------------------------------ ----------- ------------------------
log_archive_format string %t_%s_%r.dbf
Cambiar el formato en el spfile, no se puede cambiar dinamicamente. Va a tomarlo la próxima vez que reiniciemos la instancia.
SQL> alter system set log_archive_format='ORCL_%t_%s_%r.arc' scope=spfile;
System altered.
Para habilitar Archivelog Mode hay que bajar la base, montarla, modificar el modo de ARCHIVELOG y luego abrir la base.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 8985837568 bytes
Fixed Size 2177168 bytes
Variable Size 6140462960 bytes
Database Buffers 2818572288 bytes
Redo Buffers 24625152 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 /archives
Oldest online log sequence 416
Next log sequence to archive 418
Current log sequence 418
No hay comentarios:
Publicar un comentario