Home TechnologySoftwareOracle Subscribe to RSS

How Oracle Database Writes To The Redo Log?

I need information about redo log.

Answer Question

1 Answer - Sort by: Date | Rating

    The redo log of a database consists of two or more redo log files. The database requires
    a minimum of two files to guarantee that one is always available for writing while the
    other is being archived (if the database is in ARCHIVELOG mode).
    LGWR writes to redo log files in a circular fashion. When the current redo log file fills,
    LGWR begins writing to the next available redo log file. When the last available redo
    log file is filled, LGWR returns to the first redo log file and writes to it, starting the
    cycle again. The numbers next to each line indicate the sequence in which LGWR writes to each redo log file.
    Filled redo log files are available to LGWR for reuse depending on whether archiving
    is enabled.
    ¡ If archiving is disabled (the database is in NOARCHIVELOG mode), a filled redo log
    file is available after the changes recorded in it have been written to the datafiles.
    ¡ If archiving is enabled (the database is in ARCHIVELOG mode), a filled redo log file
    is available to LGWR after the changes recorded in it have been written to the
    datafiles and the file has been archived.

    Oracle Database uses only one redo log files at a time to store redo records written
    from the redo log buffer. The redo log file that LGWR is actively writing to is called the
    current redo log file.
    Redo log files that are required for instance recovery are called active redo log files.
    Redo log files that are no longer required for instance recovery are called inactive redo
    log files.
    If you have enabled archiving (the database is in ARCHIVELOG mode), then the
    database cannot reuse or overwrite an active online log file until one of the archiver
    background processes (ARCn) has archived its contents. If archiving is disabled (the
    database is in NOARCHIVELOG mode), then when the last redo log file is full, LGWR
    continues by overwriting the first available active file.

    A log switch is the point at which the database stops writing to one redo log file and
    begins writing to another. Normally, a log switch occurs when the current redo log file
    is completely filled and writing must continue to the next redo log file. However, you
    can configure log switches to occur at regular intervals, regardless of whether the
    current redo log file is completely filled. You can also force log switches manually.
    Oracle Database assigns each redo log file a new log sequence number every time a
    log switch occurs and LGWR begins writing to it. When the database archives redo log
    files, the archived log retains its log sequence number. A redo log file that is cycled
    back for use is given the next available log sequence number.
    Each online or archived redo log file is uniquely identified by its log sequence number.
    During crash, instance, or media recovery, the database properly applies redo log files
    in ascending order by using the log sequence number of the necessary archived and
    redo log files.
    0 0

    Globaltech 

    answered 3 years ago

      More

      More

         
         

        Ask a Question via Twitter

        Send a question to @askblurtit and we will publish it online and send you a reply everytime you receive an answer.

        Blurtit Store

        Get T-shirts, hoodies, caps and more at the Blurtit store

        Blurtit International