您的位置:首页 > 数据库 > Oracle

Oracle后台进程之:Slave Processes

2012-11-25 15:51 344 查看
slave processes是代表其他进程执行工作的后台进程。

I/O Slave Processes

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

Innn在底层的操作系统部不支持的时候模仿异步io。在异步io模式中,不需要时间等待传输,并且允许其他的进程服务无需等待传输结束。

For example, assume that an application writes 1000 blocks to a disk on an operating system that does not support asynchronous I/O. Each write occurs sequentially and waits for a confirmation that the write was successful. With asynchronous disk, the application
can write the blocks in bulk and perform other work while waiting for a response from the operating system that all blocks were written.

比如说,假设一个应用程序写1000block到磁盘上,但是操作系统不支持异步io。每个写都是顺序的,而且需要等待确认信息。在异步磁盘上,应用程序可以批量的写blocks并且在等待所有块都写入完成之前执行其他的工作。

To simulate asynchronous I/O, one process oversees several slave processes. The invoker processassigns work to each of the slave processes, who wait for each write to complete and report back to the invoker when done. In true asynchronous I/O the operating
system waits for the I/O to complete and reports back to the process, while in simulated asynchronous I/O the slaves wait and report back to the invoker.

为了模拟异步io,一个进程会监控多个从属进程。调用进程分配工作给每一个slave进程,slave进程会等待所有的写操作完成并且报告给调用进程。在真正的异步io中,os等待io完成,并且报告给进程。当模拟异步io的时候,io 协助进程等待并且报告给调用进程。

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

数据库支持不同类型的io从属进程:

■ 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 one CPU, then the database can distribute I/O over 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.

当使用rman去备份或者恢复的时候,可以使用io slave进程(对于所有的磁盘和磁带设备)。

数据库写slaves 它并不适应多数据库写进程,比如说数据库服务器只有一个cpu,那么数据库可以分步io到多个slave进程中。只有dbwr进程能够扫描buffer cache中lru。不管怎样io slaves 为这些block执行io(写操作)。

Parallel Query Slaves

In parallel executionor parallel processing, multiple processes work together simultaneously to run a single SQL statement. By dividing the work among multiple processes, Oracle Database can run the statement more quickly. For example, four processes handle
four different quarters in a year instead of one process handling all four quarters by itself.

在并行执行或者并行处理中,多个进程同时为运行一个单一的sql语句执行工作。分离工作总量到多个进程中,oracle数据库可以更快的运行语句。比如说,4个进程操作1年中的4个不同时间的工作,而不是一个进程处理所有的工作。

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

并行执行减少了数据比较集中的操作的相应时间(比如说在数据仓库中)。smp和集群系统因为并行执行增加了最大性能的效益,因为语句执行能够分离到不同的cpu上。并行执行能够同样的在oltp和混合系统中受益。

In Oracle RAC systems, the service placement of a particular service controls parallel execution. Specifically, parallel processes run on the nodes on which you have configured the service. By default, Oracle Database runs the parallel process only on the
instance that offers the service used to connect to the database. This does not affect other parallel operations such as parallel recovery or the processing of GV$queries

在oracle rac系统中,特殊服务的布置控制着并行执行。特别是,并行进程运行在一个已经配置好服务的节点上,默认的oracle数据库运行并行进程,只在那些语句运行的实例上面进行。这样不会影响其他的并行操作。比如说并行恢复和处理gv$查询。

Serial Execution

Serial Execution In serial execution, a single server process performs all necessary processing for the sequential execution of a SQL statement. For example, to perform a full table scansuch as SELECT* FROM employees, one server process performs all of the work,
as shown in Figure 15–5.

连续执行(串行),在连续执行中,一个单一的服务器进程执行所有必要的sql语句处理工作。如下图:



Parallel Execution

Parallel Execution In parallel execution, the server process acts as the parallel execution coordinatorresponsible for parsing the query, allocating and controlling the slave processes, and sending output to the user. Given a query planfor a SQL query, the coordinator
breaks down each operatorin 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.

在并行执行中,服务器进程担当一个并行执行协调器的作用。分配和控制从属进程,并且将输出返回给用户。给定一个sql查询的查询计划,协调器打碎每个sql查询操作到并行片中,按照查询的顺序运行它们,并且合并由从属进程执行操作生成的局部结果。

The table is divided dynamically (dynamic partitioning) into load units called granules. Each granule is a range of data blocks of the table readby a single slave process, called a parallel execution server, which uses Pnnnas a name format.

如下图所示,表被动态的分离到多个负载单元中(这里就叫任务颗粒)。每个任务颗粒都是这个表中一定范围的blocks,由单一的从属进程读取。这里从属进程叫做并行执行服务器(Pnnn)



The database maps granules to execution servers at execution time. When an execution server finishes reading the rows corresponding to a granule, and when granules remain, it obtains another granule from the coordinator. This operation continues until the
table has been read. The execution servers send results back to the coordinator, which assembles the pieces into the desired full table scan.

数据库在执行的时候映射颗粒(负载单元)到执行服务器上面(pnnn)。当执行服务器完成了任务颗粒,并且还有其他的颗粒任务残留,那么它将从协调器上面获得其他的任务颗粒。这个操作一直持续到表被读取完毕。最后执行服务器(pnnn)将结果返回给协调服务器(server process),它将合并结果片段到成要求的full table scan。

The number of parallel execution servers assigned to a single operation is the degree of parallelismfor an operation. Multiple operations within the same SQL statement all have the same degree of parallelism.

并行服务器的个数,由一个单一的操作并行级别来分配。sql语句中的多个操作,遵守这个sql语句的并行级别。(一个语句只能有一个并行级别,这个语句中的子操作都需要遵循)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: