Tuesday, June 15, 2021

Why and How to enable archive log mode in Oracle

 Why ?

You will need to enable archivelog mode if you need any one of the below ::

  • To restore your DB to last change occur in case of failure in the case of an operating system or disk failure.

  • To take online backup -hot backup- backup while database is open.

  • To use Data guard feature (standby DB) you need to enable this as well.

How ?

Before you enable archive log mode , you can check the current situation mode and set the location the archive log:

  1. To check current archive log status
archive log list;
       2.To set archive log location

alter system set log_archive_dest_1='LOCATION=/disk/archive' scope=spfile ;
The following steps switch the database archiving mode from NOARCHIVELOG to ARCHIVELOG:
  1. Shut down the database instance.

    SHUTDOWN immediate ;
  2. Start a new instance and mount, but do not open, the database.

    STARTUP MOUNT;
    

    To enable or disable archiving, the database must be mounted but not open.

  3. Change the database archiving mode. Then open the database for normal operations.

    ALTER DATABASE ARCHIVELOG;
    ALTER DATABASE OPEN;

** In case you need to stop archive log mode, in mount state you may use the below :

ALTER DATABASE NOARCHIVELOG;

No comments:

Post a Comment

Why and How to install Grid 19c on RHEL 8?

  Why ? Simply we will be requested to install Oracle Grid RAC DB on Redhat RHEL 8, below is my note for this installation . How ? 1-  OS in...