Oracle Process Architecture - Oracle 进程结构篇5

来源:互联网 发布:直接翻译软件界面 编辑:程序博客网 时间:2024/06/02 23:57

前言:接上一篇 Oracle Process Architecture - Oracle 进程结构篇4

           http://blog.csdn.net/nature_ann/article/details/17144185

1. Slave Processes 从属进程

<<----从属进程是为了其他进程执行工作的后台进程。本部分介绍一些Oracle数据库使用的从属进程。---->>

Slave processes are background processes that perform work on behalf ofother processes. This section describes some slave processes used by Oracle Database.

1.1 I/O Slave Processes I/O从属进程

<<---- I/O从属进程为不支持异步I/O的系统和设备模拟异步I/O。异步I/O没有传输时间的要求,它可以让其他进程在传输完成之前开始。---->>

I/O slave processes (Innn) simulate asynchronous I/O for systems and devices that do not support it. Inasynchronous I/O, there is no timing requirement for transmission, enabling other processes to start before the transmission has finished.

<<---- 比如,一个应用程序在一个不支持异步I/O的操作系统上写1000个块到磁盘,每次写都是顺序发生,并且等待一个写入成功的确认。在异步磁盘上,一个应用程序可以大容量的写人到数据库,并且在等待操作系统对所有的块被写入做出响应的同时,执行其他的工作---->>

For example, assume that anapplication writes1000 blocks to a disk on anoperating system that does not support asynchronous I/O. Each write occurssequentially and waits for aconfirmation that the write was successful. With asynchronous disk, theapplication can write the blocks inbulk and perform other work while waiting for a response from the operating system that all blocks were written.

<<----为了模拟异步I/O,由一个进程监督几个从属进程。调用者进程将工作分配给每一个从属进程,从属进程会等待每一个写操作的完成,并且完成后报告调用者。在真正的异步I/O中,操作系统会等待I/O完成,并在完成时报告主进程,而在模拟异步I/O中,从属进程会等待,并在完成时报告调用者。 ---->>

To simulate asynchronous I/O, one process oversees severalslave processes. Theinvoker process assigns work to each of the slave processes, who wait foreach write to complete andreport back to the invoker when done. Intrue asynchronous I/O the operating system waits for theI/O to complete andreports back to theprocess, while in simulated asynchronous I/O theslaves wait andreport back to theinvoker.

<<----数据库支持不同类型的I/O从属进程,包括以下几个:1.恢复管理的I/O从属进程(当使用rman备份或还原数据时,磁盘和磁带设备会使用I/O从属进程。2.数据库写入从属进程(如果计算机只有一个CPU,数据库使用多个写进程是不现实的,数据库可以通过多个从属进程来分布I/ODBWR是扫描高速缓冲区LRU列表中的快以写入到磁盘的唯一进程。而I/O从属进程为这些快执行I/O。)---->>

The database supports different types of I/O slaves, including the following:

>>I/O slaves for Recovery Manager (RMAN)

When using RMAN to back up or restore data, you can make use of I/O slaves for both disk and tape devices.

>>Database writer slaves

If it is not practical to use multiple database writer processes, such as when the computer has oneCPU, then the database can distribute I/Oover multiple slave processes. DBWR is the only process that scans the buffer cache LRU list for blocks to be written to disk. However, I/O slaves perform the I/O for these blocks.

1.2 Parallel Query Slaves 并行查询从属进程

<<----在并行执行或并行处理中,多个进程协同工作,来运行一个单一的SQL语句。通过在多个进程间分配工作,oracle数据库可以更快地运行语句。比如,四个进程分别处理一年中不同的四个季度而不是一个进程处理所有的四个季度。---->>

In parallel execution orparallel processing, multiple processes work together simultaneously to run a single SQL statement. By dividing the work amongmultiple processes, Oracle Database can run the statement more quickly. For example,four processes handlefour different quarters in a year instead ofone process handlingall four quarters by itself.

<<----并行执行减少了在大数据库(如数据仓库)上密集型操作响应的时间。对称多处理(SMP)和集群系统在并行执行获得了最大的性能优势,因为语句处理可以在多个CPU之间划分。并行执行也能使某些类型的OLTP和混合系统受益。 ---->>

Parallel execution reduces response time for data-intensive operations on large databases such asdata warehouses.Symmetric multiprocessing (SMP) andclustered system gain the largest performance benefits from parallel execution because statement processing can be split up amongmultiple CPUs. Parallel execution can also benefit certain types ofOLTP and hybrid systems.

<<----RAC系统里,特定服务的服务配置控制并行执行。具体而言,并行进程运行在那些配置服务的节点上。默认情况下,oracle数据库只在提供数据库连接服务的实例上运行并行进程。这并不影响其他并行操作,如并行恢复或对视图GV$的查询的处理。---->>

In Oracle RAC systems, theservice placement of aparticular service controlsparallel execution. Specifically,parallel processes run on the nodes on which you have configured theservice. By default, Oracle Database runs theparallel process only on the instance that offers the service used toconnect to the database. This does not affect other parallel operations such asparallel recovery or theprocessing of GV$ queries.

1.2.1 Serial Execution 串行执行

<<----在串行执行里,一个单个服务器进程,执行顺序执行的某个sql语句所有必需的处理。比如,执行一个全表扫描(Select * from employees,由一个服务器进程执行所有的工作。如下图:4.3.2.1---->>

In serial execution, asingle server process performs all necessaryprocessing for the sequential execution of aSQL statement. For example, to perform afull table scan such as SELECT * from employees, oneserver process performsall of the work, as shown in Figure 1.2.1

 

                         Figure 1.2.1 Serial Full Table Scan

1.2.2 Parallel Execution 并行执行

<<----在并行执行中,服务器进程担当并行执行协调器的角色,负责解析查询,分配和控制从属进程,并将输出发送给用户。给定一个SQL查询的查询计划,协调器将sql查询中的每一个运算符分解成平行片,并且按查询中的指定顺序运行它们,集成部分结果由执行操作的从属进程产生。---->>

In parallel execution, theserver process acts as theparallel execution coordinator responsible forparsing the query,allocating andcontrolling theslave processes, and sending output to the user. Given aquery plan for a SQL query, the coordinatorbreaks down each operator in a SQL query into parallel pieces, runs them in the order specified in the query, and integrates the partial results produced by the slave processes executing the operators.

<<---- 下图显示了表employees的并行扫描。表被动态划分(动态分区)为多个加载单元,这些加载单元被称为颗粒。每一个颗粒是一个由单个从属进程读取的表的数据块范围,这些从属进程叫做并行执行服务。名称格式为Pnnn---->>

Figure 1.2.2 shows a parallel scan of theemployees table. The table is divided dynamically (dynamic partitioning) into load units calledgranules. Each granule is a range of data blocks of the table read by a single slave process, called aparallel execution server, which usesPnnn as a name format.

                             Figure 1.2.2 Parallel Full Table Scan

<<----数据库在执行时映射颗粒到执行服务器。当一个执行服务器完成某个颗粒对应行的读取,而此时还有其他的颗粒将要读取,执行服务器会从协调器那里获取另一个颗粒。这个操作将继续,直到这个表读完为止。执行服务器向协调器发送执行结果,协调器再将这些片断合并,为全表扫描所用。---->>

The database maps granules to execution servers at execution time. When anexecution server finishes reading the rowscorresponding to a granule, and when granules remain, it obtains another granule from thecoordinator. This operation continues until the table has been read. Theexecution servers send results back to thecoordinator, whichassembles the pieces into the desired full table scan.

<<---- 分配给单个操作的并行服务器的数量是操作的并行度。同一SQL语句中的多个操作具有相同的并行度。---->>

The number of parallel execution servers assigned to a single operation is thedegree of parallelism for an operation.Multiple operations within thesame SQL statement all have thesame degree of parallelism.

 

 

At this point,  the oracle process architecture is end.

 

 

 

 

 

 

 

 

0 0
原创粉丝点击