Friday, March 4, 2011

Changing Archive log location in Oracle 11gR2

In this case the archive log has already been enabled and set up /home/test/archive. I will be changing the
archive log location to the new destination /home/test

SQL> startup mount;
ORACLE instance started.

Total System Global Area 1.0289E+10 bytes
Fixed Size                  2215712 bytes
Variable Size            5268046048 bytes
Database Buffers         4999610368 bytes
Redo Buffers               18743296 bytes
Database mounted.
SQL> alter system set log_archive_dest_1='location=/home/test' scope=spfile;

System altered.

SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /home/test/archive
Oldest online log sequence     23
Next log sequence to archive   25
Current log sequence           25
SQL>


We see that the Archive destination is still pointing to the old location ie. /home/test/archive


SQL> shutdown immediate;
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.

Total System Global Area 1.0289E+10 bytes
Fixed Size                  2215712 bytes
Variable Size            5268046048 bytes
Database Buffers         4999610368 bytes
Redo Buffers               18743296 bytes
Database mounted.
Database opened.
SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /home/test
Oldest online log sequence     23
Next log sequence to archive   25
Current log sequence           25
SQL> 

SQL> select name, log_mode from v$database;

NAME LOG_MODE
--------- ------------
TESTGM ARCHIVELOG

SQL>
 
We see that the archive log location has been updated to the new location /home/test


No comments: