Friday, October 25, 2013

How to enable archivelog mode in 11g

ERROR:

SQL> alter system set log_archive_dest_1='/archivelogs/OTMTESTA' scope=spfile;
alter system set log_archive_dest_1='/archivelogs/OTMTESTA' scope=spfile
*
ERROR at line 1:
ORA-32017: failure in updating SPFILE
ORA-16179: incremental changes to "log_archive_dest_1" not allowed with SPFILE

Solution:
SQL> select  name from v$database;
NAME
---------
OTMTESTA

SQL> archive log list;
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     7
Current log sequence           9

SQL> alter system set log_archive_start=TRUE scope=spfile;

System altered.

SQL> alter system set log_archive_dest_1='LOCATION=/archivelogs/OTMTESTA' scope=spfile;

System altered.

SQL> show parameter log_archive_format

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
log_archive_format                   string      %t_%s_%r.dbf

SQL> alter system set log_archive_format='arch_%t_%s_%r.arc' SCOPE=spfile;

System altered.

SQL> shut immediate;
SQL> startup mount;
SQL> show parameter log_archive_format

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
log_archive_format                   string      arch_%t_%s_%r.arc

SQL> alter database archivelog ;

Database altered.

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /archivelogs/OTMTESTA

SQL> alter database open;

Database altered.

++++++++++++++++++++++++++++

No comments:

Post a Comment