Redo Files, Redo Group and Redo Thread in Oracle Database

Redo log files used to maintain logs of all transactions performed against the Oracle database mainly for disaster recovery. An Oracle database must have at least two redo log files. These files are written in a circular fashion by the LGWR process. 

If Oracle database is running in archivelog mode, then ARCH process copies the log file to ARCHIVE_LOG_DEST directory at the time of LOG SWITCH. 

Following is the SQL which provides basic information about Redo Log files on my Oracle 18c XE database.

select 
    log.thread#,
    log.group#, 
    file.member,
    log.archived,
    log.status,
    (bytes/1024/1024) SIZE_MB
from
    v$log log, 
    v$logfile file
where 
    f.group# = l.group#
order by 1,2 ;

THREAD#  GROUP#   MEMBER                                  ARC STATUS     SIZE_MB
------- ------- ----------------------------------------- --- ---------- --------
      1       1 C:\ORACLEXE\18.0.0\ORADATA\XE\REDO01.LOG  NO  INACTIVE   200
      1       2 C:\ORACLEXE\18.0.0\ORADATA\XE\REDO02.LOG  NO  CURRENT    200
      1       3 C:\ORACLEXE\18.0.0\ORADATA\XE\REDO03.LOG  NO  INACTIVE   200
Following are the detail about columns generated by above SQL 
- THREAD# - This column is basically useful in RAC environment where multiple instances concurrently access single database and each instance has its own thread of redo. 
- GROUP# - A redo log group consist of Redo log file and optionally its identical copies. Here we have 3 redo log groups with one file each. 
- MEMBER - All the member files in each Redo log group. 
- ARCHIVED - If file has been archived by ARCH process, happens only if Oracle database is running in archivelog mode. 
- STATUS - CURRENT, INACTIVE, ACTIVE, CLEARING and UNUSED 
- SIZE_MB - Size of the redo log file in MB. 

Related Posts - 

No comments:

Post a Comment