fbpx
en English
ar Arabiczh-CN Chinese (Simplified)nl Dutchen Englishfr Frenchde Germanit Italianpt Portugueseru Russianes Spanish

How to Change Archivelog Destination in Oracle

In this article, we are going to learn how to change archive log destination in the oracle database production (LIVE) environment step by step.

Sometimes we face disk space issues in the production environment due to high archive generation. So, here we are going to discuss how to change the archive destination in a standalone and Oracle RAC environment.

Steps to change archive log destination in a standalone database

Use the below steps to change the archive destination in the standalone database.

STEP -1 Find current archive destination

The below commands will show you the current archive valid destination.

SQL> archive log list
CHECK ARCHIVE DEST IN STANDALONE

Or

SQL> col DESTINATION for a65
SQL> set lin 300 pagesize 400
SQL> select destination,status from v$archive_dest where status='VALID';
Change Archive Log Destination

STEP -2 Create new archive destination

Create a new destination and assign the oinstall group to oracle.

# mkdir -p /u02/archive
# chown -R oracle.oinstall /u02

STEP -3 Now change archive destination

SQL> alter system set log_archive_dest_1='LOCATION=/u02/archive' scope=both;

System altered.

Now check the currently updated archive destination.

SQL> select destination,status from v$archive_dest where status='VALID';
Change Archive Log Destination

STEP -4 Check whether archives is genrated on the new location?

We change the archivelog location, now check archives on the new archive destination.

SQL> alter system switch logfile;
SQL> alter system switch logfile;
SQL> exit

$cd /u02/archive
$ls -l

Finally, the archive location has been changed without any downtime on the standalone database.

How to change the archivelog destination in oracle RAC environment?

Here we are going to learn how to change archivelog destination in oracle RAC environment step by step.

RAC environment

SQL> show parameter log_archive_dest_1
ARCHIVE LOCATION IN RAC

Before changing the archive you must be sure the diskgroup must be available. So, use sid=’*’ in the command to change the parameter value for all the instances.

alter system set log_archive_dest_1='LOCATION=+ARCHIVE_2' scope=both sid='*'

System altered.

Check updated destination

SQL> select destination,STATUS from v$archive_dest where statuS='VALID';

DESTINATION     STATUS
-----------	------- 
+ARCHIVE_2	VALID

I hope you learn from this article, if yes please write your views in the comment section.

You Must Read: How to delete old archives in RAC

2 thoughts on “How to Change Archivelog Destination in Oracle”

  1. Hello sir,
    Hope you are fine.
    You are doing a great job. I have learnt so many things from you. your way of teaching is very easy.
    I have an issue to discuss. can I get your WhatsApp number. please
    I have configured data guard from your tutorial. but when I run this statement “select sequence#,first_time,next_time,applied from v$archived_log order by sequence#;” on standby it show me ” no rows selected”
    please guide in resolving and also share the pre-data guard installation video or script too.
    thank you so much.

    Reply

Leave a Comment