mercoledì 11 luglio 2012

Oracle Database: How to enable Archive Mode

Some days ago I went into this error while trying to perform a backup of a running 11gR2 database using rman:

ORA-196602: cannot backup or copy active file in NOARCHIVELOG mode

The solution was easy: ArchiveLog needs to be enabled to perform a hot backup of a running database.

Using SQLPlus connect to database.

[oracle@orcl ~]$ /u01/app/oracle/product/11.2.0/db_1/bin/sqlplus sys/password as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Tue Jul 10 09:32:39 2012

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Release 11.2.0.3.0 - 64bit Production


Stop and dismount database and shutdown instance.

SQL> shutdown immediate;

Database closed.
Database dismounted.
ORACLE instance shut down.

Restart instance.

SQL> startup mount;

ORACLE instance started.

Total System Global Area 1653518336 bytes
Fixed Size                  2228904 bytes
Variable Size            1325403480 bytes
Database Buffers          318767104 bytes
Redo Buffers                7118848 bytes
Database mounted.

Enable ArchiveLog

SQL> alter database archivelog;

Database altered.
Re-open database

SQL> alter database open;

Database altered.
If everything went fine the following command should return Archive Mode as output:

SQL> select log_mode from v$database;

LOG_MODE
------------
ARCHIVELOG

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     294
Next log sequence to archive   296
Current log sequence           296

Nessun commento:

Posta un commento