2.1.3 background process

Source: Internet
Author: User

1, SMON (System Monitor)

Execute routine recovery

(1) Redo: reapply the data recorded in the redo log but not written into the data file. The transaction data can be restored because all committed transactions have recorded the redo log.

(2) Open the database. When you open a database, it includes both submitted data and uncommitted data (locking ).

(3) undo. Cancel uncommitted data. After the database is opened, Oracle automatically uses the Undo segment to roll back uncommitted data.

 

2, pmon (Process Monitor)

Pmon is used to monitor the execution of the server process and clear the server process when the server process fails. When accessing the Oracle server, Oracle assigns a server process to the user process on the server side. If the user process address is unexpectedly terminated, pmon can poll the server process and perform the following operations:

  • Returns the current transaction of the user.
  • Releases the table and row locks occupied by server processes.
  • Release other resources occupied by the user.

 

3, dbwr (Database writer)

Dbwr is used to write dirty buffer data cached by data to data files. When a DML operation is performed, the server process modifies the buffer and marks the buffer as a "dirty buffer". In the future, the dirty buffer data will be written to the data file by the background process dbwr.

By default, there is only one dbw0 process. You can set the initialization parameter db_writer_processes to define a maximum of 10 dbwr processes (dbw0 ~ Dbw9 ). The dbwr process starts to work in the following situations:

  • The system sends a checkpoint ).
  • The server process cannot find the idle buffer.
  • Deletes or truncates a table.
  • Alter table... offline normal ).
  • Start table space backup (alter tablespace... begin backup ).

 

4, lgwr (log writer)

Lgwr is used to write all the content recorded in the redo log buffer to the redo log. When you execute DML or DDL statements, the server process first writes transaction changes to the redo log buffer before modifying the cache. Note that Oracle always "logs first and then modify" (records changes first and then modifies data ). Therefore, before writing dirty buffer data to a data file, Oracle first writes transaction changes to the redo log. That is to say, before dbwr works, lgwr first writes transaction changes to the redo log.

In the following cases, the lgwr process starts to work:

  • Commit a transaction (COMMIT ).
  • Every three seconds.
  • When the redo information exceeds 1 MB.
  • The redo log buffer is 1/3 full.
  • Before the dbwr process writes the dirty buffer to the data file.

 

5, ckpt (Checkpoint Process)

Ckpt is used to issue a checkpoint. The checkpoint synchronizes the data files, control files, and redo logs of the database. When a Check Point is sent, the background process ckpt writes the SCN (System Change number) at the checkpoint time to the control file and data file header, at the same time, the background process dbwr will be prompted to write all the dirty buffer data to the data file.

When a Check Point is sent, not only the background processes ckpt and dbwr must start to work, but also the lgwr will write the redo log buffer to the redo log, this ensures the consistency of data files, control files, and redo logs.

Ckpt starts to work in the following cases:

  • Log switch.
  • Close the routine (except for shutdown abort ).
  • Manual checkpoint operation (alter system checkpoint ).
  • The checkpoint is forcibly issued by the initialization parameter fast_start_mrrt_target.

 

6, arch (archive process)

Arch is used to copy the transaction changes in the redo log to the archive log.

Started only in archivelog mode.

By default, there are only two processes (arc0 and arc1). By initializing the log_archive_max_processes parameter, you can define up to 10 archiving processes (arc0 ~ Arc9 ).

In archivelog mode, archive logs are automatically generated during log switching.

You can query the dynamic performance view v $ bgprocess to display information about all background processes.

SQL> select name, description from V $ bgprocess where paddr <> '00 ';

Name Description
---------------------------------------------------------------------
Pmon process cleanup
Psp0 process spawner 0
Mman Memory Manager
Dbw0 dB writer process 0
Lgwr redo etc.
Ckpt checkpoint
SMON system monitor process
Reco distributed recovery
Cjq0 Job Queue Coordinator
Qmnc AQ Coordinator
Mmon manageability monitor process
Mmnl manageability monitor process 2

12 rows have been selected.

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.