Oracle RAC Archive Management: Modify the archive location (FRA and other locations)

Source: Internet
Author: User

% T: Number of the redo thread. % S: log serial number. The ID value of % rRESETLOGS. These three matching characters must exist. If the online configuration file format is used, you must restart the database.

10.1 view the location where archive logs are stored
In the DGFRA directory.

SQL> archive log list

Database log mode Archive Mode

Automatic archival Enabled

Archive destination + DGFRA/edwprd/

 

In another case, the location of archived logs is in the quick recovery zone by default.

Use_db_recovery_file_dest

When the quick recovery zone is enabled, the actual storage parameter is log_archive_dest_1 = 'location = + DGFRA/EDWPRD /'

SQL> show parameter log_archive_dest

NAME TYPE VALUE

-----------------------------------------------------------------------------

Log_archive_dest string

Log_archive_dest_1 string LOCATION = + DGFRA/EDWPRD/

Log_archive_dest_10 string

Log_archive_dest_2 string

V $ database stores the archived log information: SELECTname, log_mode FROM v $ database;

 

10.2 modify the location of archived logs
The archive location cannot be modified when fra is opened.

SQL> alter system setlog_archive_dest = '/Oracle ';

Alter system set log_archive_dest = '/oracle'

ERROR at line 1:

ORA-02097: parameter cannot be modifiedbecause specified the value is invalid

ORA-16018: cannot use LOG_ARCHIVE_DEST withLOG_ARCHIVE_DEST_n or

DB_RECOVERY_FILE_DEST

Modify archiving location

SQL> alter system set log_archive_dest_1 = 'location =/oracle 'scope = both;

System altered.

SQL> alter database open;

10.3 enable and disable the log archiving Mode
Close Archiving:

Database mount status

Srvctl start database-d edwprd-o mount

Alter database noarchivelog;

Alter database open

Enable Archiving:

SQL> alter database archivelog;

ERROR at line 1:

ORA-01126: database must be mounted in thisinstance and not open in any

Instance

So only one instance can start the database

10.4 archive log storage FRA (USE_DB_RECOVERY_FILE_DEST)
The DB_RECOVERY_FILE_DEST parameter is the default flashrecovery area path, which stores files such as archive logs, flash logs, and rman backup files.

Modify the location log_archive_dest_1 of the archive log to be empty and put it in the default quick response area.

SQL> altersystem set log_archive_dest_1 = ''scope = both;

System altered.

SQL> shutdown

SQL> startup

SQL> archivelog list;

Database logmode Archive Mode

Automaticarchival Enabled

Archivedestination USE_DB_RECOVERY_FILE_DEST

Oldest onlinelog sequence 28

Next logsequence to archive 29

Current logsequence 29

SQL> altersystem archive log current;

System altered.

10.5 display archived logs
Col name format a46

SQL> selectname, thread #, sequence #, first_change # from v $ archived_log;

 

Name thread # SEQUENCE #

------------------------------------------------------------------

FIRST_CHANGE #

-------------

+ DGFRA/edwprd/41527_8da-87869.dbf 1 27

403045

 

+ DGFRA/edwprd/41528_836987869.dbf 1 28

458452

 

+ DGFRA/edwprd/2_rj836987869.dbf 2 1

414064

Name thread # SEQUENCE # FIRST_CHANGE #

-------------

+ DGFRA/edwprd/archivelog/2014_03_11/thread_1_s 1 29 481779

Eq_29.264.841909501

+ DGFRA/edwprd/archivelog/2014_03_11/thread_2_s 2 2 436041

Eq_2.265.841909507

Name indicates the file Name of the archived log, and sequence # indicates the log serial number corresponding to the archived log, and firs_change # indicates the starting SCN value of the archived log.

You can query the dynamic performance view v $ archive_dest to obtain the directory where the archived logs are located.

SELECT destination FROM v $ archive dest;

To display log history information.

SELECT * FROM v $ loghist;

 

SQL> select * from v $ loghist;

 

THREAD # SEQUENCE # FIRST_CHANGE # FIRST_TIME SWITCH_CHANGE #

---------------------------------------------------------

1 1 1 09-3? -14 32404

1 2 32404 09-3? -14 59939

1 3 59939 09-3? -14 74190

1 4 74190 09-3? -14 89573

1 5 89573 09-3? -14 100136

1 6 100136 09-3? -14 116032

1 7 116032 09-3? -14 130603

1 8 130603 09-3? -14 146094

1 9 146094 09-3? -14 163597

1 10 163597 09-3? -14 191251

1 11 191251 09-3? -14 221978

THREAD # is used to identify the redo THREAD number, SEQUNCE # is used to identify the log serial number, FIRST_CHANGE # is used to identify the start SCN value corresponding to the log serial number, FIRST_TIME is used to identify the occurrence time of the start SCN. SWICTH_CHANGE # The SCN value used to identify log switching.

Displays archived process information.

During log switching, the ARCH process automatically copies the redo log content to the archive log. To speed up archiving, multiple ARCH processes should be enabled. query the dynamic performance view V $ ARCHIVE_PROCESSES to display information about all archiving processes!

SQL> select * from v $ archive_processes;

Process status LOG_SEQUENCESTAT

------------------------------------

0 ACTIVE 0 IDLE

1 ACTIVE 0 IDLE

2 STOPPED 0 IDLE

3 STOPPED 0 IDLE

4 STOPPED 0 IDLE

5 STOPPED 0 IDLE

6 STOPPED 0 IDLE

7 STOPPED 0 IDLE

8 STOPPED 0 IDLE

9 STOPPED 0 IDLE

10 STOPPED 0 IDLE

Porcess identifies the ARCH process number, status identifies the status of the ARCH process (ACTIVE: ACTIVE, STOPPED: not started), and log_sequence identifies the log serial number that is being archived, state is used to identify the working state of the ARCH process.

10.6 archiving location description
If no backup database is used, you only need to store the archived logs to the local directory. to configure the local archive location, you can use the initialization parameters LOG_ARCHIVE_DEST and LOG_ARCHIVE_DUPLEX_DEST. The first parameter is used to set the first archive location, and the second parameter is used to specify the second archive location.

Alter system SETlog_archive_duplex_dest = 'd: demoarchive2 ';

The initialization parameter LOG_ARCHIVE_DEST_n can be used to configure the local and remote archiving locations. The initialization parameters LOG_ARCHIVE_DEST and LOG_ARCHIVE_DUPLEX_DEST can only be used to configure the local archiving location.

The initialization parameter LOG_ARCHIVE_DEST_n can be configured with up to 10 archiving locations, while the initialization parameters LOG_ARCHIVE_DEST and LOG_ARCHIVE_DUPLEX_DEST can be configured with up to two archiving locations.

The initialization parameter LOG_ARCHIVE_DEST_n cannot be used with the initialization parameters LOG_ARCHIVE_DEST and LOG_ARCHIVE_DUPLEX_DEST.

Because the initialization parameters LOG_ARCHIVE_DEST_n cannot be used with the initialization parameters LOG_ARCHIVE_DEST and LOG_ARCHIVE_DUPLEX_DEST, the initialization parameters LOG_ARCHVE_DEST and LOG_ARCHIVE_DUPLEX_DEST must be disabled. when you use the initialization parameter LOG_ARCHIVE_DEST_n to configure the local archiving location, you must specify the LOCALTION option. you must specify the SERVICE Option When configuring the remote archiving location.

Use the initialization parameter LOG_ARCHIVE_DEST_STATE_n to control the availability of the archive location. if this parameter is set to ENABLE (default), the corresponding archiving location is activated. If this parameter is set to DEFER, the corresponding archiving location is disabled. when the disk of the archived log is damaged or filled up, the DBA must temporarily disable the archive location.

Alter system setlog_archive_dest_state_3 = defer; (disabled)

Alter system setlog_archive_dest_state_3 = enable; (Enabled ).

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.