Oracle 11g archive log study _ 1, oracle11g ARCHIVE _ 1

Source: Internet
Author: User

Oracle 11g archive log study _ 1, oracle11g ARCHIVE _ 1

Oracle Database Operations are recorded in the redo log for undo (rollback) Or redo (redo) in case of database exceptions ). Redo logs are divided into online logs and archive logs.

Oracle has three online log files by default. Generally, these files are filled with one order and then written to the next one. The online log files filled with logs are archived. Data may be entered in sequence or randomly in each online log.

 

The online log and archive log are composed of many parts. The file header contains 1st parts, including the block size and total number of parts, and 2nd parts are used as the database header, contains database information (such as the version number, Database ID, and file number ). By default, the block size is 512 bytes, which may be 1 k or 2 k (I haven't met yet), so the redo log file size must be an integer multiple of 512 bytes.

The data format of the 1st block is as follows:

Typedef struct fh0 {unknown unknown0; uint32_t unknown1; uint32_t unknown2; uint32_t unknown3; uint32_t unknown4; uint32_t blocksize; // the size of each block (in bytes), 512/1024... uint32_t blockcount; // The total number of blocks of the current file (excluding the first block) uint32_t unknown5; uint8_t nouse [480];} Redo_fh0;Redo_fh0

 

The data format of the 2nd block is as follows:

Typedef struct scn {javasscnbase; javasscnwrapper; javasfiller;} Redo_scn; typedef struct fh1 {Redo_bh blockhead; uint32_t unknown0; javascomvsn; // Compatibility Vsn mongodbid; mongodbname [8]; // "ORCL" (sid) uint32_t controlseq; uint32_t filesize; uint32_t blocksize; using filenum; uint16_t filetype; uint32_t activid; using nouse0 [36]; // 0 includescript [64]; uint32_t nab; // next available block uint32_t resetcount; Redo_scn resetscn; uint32_t hws; // The last 3 bytes are 0 bytes thread; Redo_scn lowscn; required lowscntime; Redo_scn nextscn; required bytes; unknown unknown11; Redo_scn enablescn; required enablescntime; Redo_scn hour; required bytes; required unknown13 [52]; Redo_scn hour; required prevresetcount; uint8_t nouse1 [1, 152]; // 0 uint8_t unknown14 [36]; uint8_t nouse2 [28]; // 0} Redo_fh1;Redo_fh1

 

The 1st block is completely different from other blocks. It does not contain block headers and is not included in the total number of blocks. Starting from 2nd data blocks, the first 16 bytes of all data blocks are block headers. format:

Typedef struct bh {uint32_t signature; // signature uint32_t blocknum; // block number uint32_t sequence; // The serial number uint16_t offset; // The highest bit 1 needs to filter out uint16_t checksum;} Redo_bh;Redo_bh

 

The following is a detailed study of archiving logs.

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.