Oracle Process Architecture - Oracle 进程结构篇1

1.Process Architecture

1.1 Introduction to Processes

<<-----进程是操作系统里面的一个机制,它能运行一系列的步骤。这种机制依赖于操作系统,比如,在linux上一个oracle后台进程是一个linux进程。在windows上,一个Oracle后台进程是在进程里面执行的线程。 ----->>

A process is a mechanism in anoperating system that can run a series of steps. The mechanism depends on theoperating system. For example, on Linux an Oracle background process is a Linux process. On Windows, an Oracle background process is a thread of execution within a process.

 

<<----代码模块通过进程运行。所有连接oracle数据库的用户必须通过运行下面的模块来访问数据库实例:1.应用程序或oracle实用工具。2.oracle数据库代码。--->>

Code modules are run by processes.All connected Oracle Database users must run the following modules to access a databaseinstance:

>>Application or Oracle Database utility

A database user runs a database application, such as a precompiler program or adatabase tool such as SQL*Plus, that issues SQL statements to a database.

>>Oracle database code

Each user has Oracle database code executing on his or her behalf thatinterprets and processes the application's SQL statements.

 

<<---- 一个进程一般运行在自己私有的内存区域。大多数进程会定期的写入与其关联的跟踪文件。--->>

A process normally runs in its own private memory area. Most processes can periodically write to an associatedtrace file.

1.1.1 Multiple-Process Oracle Database Systems

<<----多进程oralce也被称为多用户oralce,使用多个进程运行oracle数据库代码不同部分,额外的进程的使用—每一个连接用户一个进程或多个进程被多个用户共享。大多数数据库是多用户的,主要优势是需要多用户同时管理数据--->>

Multiple-processOracle(also called multiuser Oracle) uses several processes to run different parts of the Oracle Database code and additional processes for the users—either one process for each connected user or one or more processes shared by multiple users. Most databases are multiuser because a primary advantages of a database is managing data needed by multiple users simultaneously.

 

<<----数据库实例里面的每一个进程执行一个特定的任务。通过数据库和应用程序不同的分工,分成数个进程。在系统性能良好的情况下,多用户和应用程序能同时连接一个实例。--->>

Each process in a database instance performs a specific job. By dividing the work of the database and applications into several processes, multiple users and applications can connect to an instance simultaneously while the system gives good performance.

1.1.2 Types of Processes

 参考图1

 

                       图1  Oracle Processes and the SGA

 

 

1 shows a SGA and background processes using dedicated server connections. For each user connection, the application is run by a client process that is different from the dedicated server process that runs the database code. Each client process is associated with its own server process, which has its own PGA.

 

<<----一个数据库实例包含或者与其相联系的下列类型的进程:1.客户端进程,运行在应用程序或oracle工具代码里面;2.oralce进程,运行在oracle数据库代码里面。它包含如下的子类型(后台进程,服务器进程,从进程)。--->>

A database instance contains or interacts with the following types of processes:

>>Client processes run the application or Oracle tool code.

>>Oracle processesrun the Oracle database code. Oracle processes including the following subtypes:

1.   Background processes start with thedatabase instance and perform maintenance tasks such as performinginstance recovery,cleaning up processes,writing redo buffers to disk, and so on.

2.   Server processes perform work based on aclient request.For example, these processesparse SQL queries, place them in the shared pool, create and execute aquery plan for each query, andread buffers from the database buffer cache or from disk.

3.   Slave processes performadditional tasks for abackground or server process.

 

 

<<----进程结构的不同依赖于操作系统和oracle数据库配置选择。比如,连接用户代码可以配置为专用服务器或共享服务器连接。在共享服务模式里,每一个服务进程,运行数据库代码可以服务多个客户端进程。 --->>

The process structure varies depending on the operating system and the choice of Oracle Database options. For example, the code for connected users can be configured for dedicated server or shared server connections. In a shared server architecture, each server process that runs database code can serve multiple client processes.

1.2 Client  Processes

<<---- 当一个用户运行一个应用程序时,比如Pro*C或者SQL*Plus,这个操作系统就创建一个客户端进程(有时也被称为用户进程)来运行用户应用程序。客户端进程使用oracle数据库libraries来连接,并提供APIs请求和数据库进行通话。---->>

When a user runs an application such as a Pro*C program or SQL*Plus, the operating system creates a client process (sometimes called a user process) to run the user application. The client application has Oracle Database libraries linked into it that provide the APIs required to communicate with the database.

1.2.1 Client and Server Processes

<<----客户端进程与Oracle进程相比,一个重要的不同在于服务器进程是直接与实例进行交互的。Oracle进程服务于客户端进程可以读取和写入SGA,而客户端进程不行。一个客户端进程能运行在一个主机上,除了数据库主机,而Oracle进程不行。---->>

Client processes differ in important ways from the Oracle processesinteracting directly with the instance. The Oracle processes servicing the client process can read from and write to the SGA, whereas the client process cannot.A client process can run on a host other than the database host, whereas Oracle processes cannot.

 

 

<<----假设用户在客户端主机开启sql*plus,通过网络连接到数据库sample,在不同的主机上:1.在客户端主机,显示的是sqlplus进程。2.在数据库主机,显示的是server process ---->>

For example, assume that a user on a client host starts SQL*Plus and connects over the network to database sample on a different host (the database instance is not started):

SQL> CONNECT SYS@inst1 AS SYSDBA
Enter password: *********
Connected to an idle instance.

On the client host,a search of the processes for either sqlplus or sample shows only the sqlplus client process:

% ps -ef | grep -e sample -e sqlplus | grep -v grep
clientuser 29437 29436  0 15:40 pts/1    00:00:00 sqlplus           as sysdba

On the database host, a search of the processesfor either sqlplus or sample shows a server processwith a nonlocal connection, but no client process:

% ps -ef | grep -e sample -e sqlplus | grep -v grep serveruser 29441     1  0 15:40 ?        00:00:00 oraclesample (LOCAL=NO)

1.2.2 Connections and Sessions

<<----一个连接是一个客户端进程与一个数据库实例之间的物理的通讯通道。他是被确立的有效使用的进程通信机制或网络软件。典型的,一个连接发生在客户端进程和服务器进程之间,或者调度器。但它也能发生在客户端进程和CMANOracle Connection Manager)之间。--->>

A connection is a physical communication pathway between a client process and a database instance. A communication pathway is established using available interprocess communication mechanisms or network software. Typically, a connection occurs between a client process and aserver process or dispatcher, but it can also occur between a client process and Oracle Connection Manager (CMAN).

 

<<----一个会话是一个逻辑条目在数据库实例内存里,它代表了当前用户登录到数据库的状态。例如,当一个用户使用密码通过数据库验证,这个用户就创建了一个会话。一个会话的生命周期是从已认证到用户断开连接或退出数据库应用程序。--->>

A session is a logical entity in the database instance memory that represents the state of a current user login to a database. For example, when a user is authenticated by the database with a password, a session is established for this user.A session lasts from the time the user is authenticated by the database until the time the user disconnects or exits the database application.

 

<<----一个独立的连接能有0,1,或者多个会话在上面创建。这个会话是独立的:一个会话的提交不会对其他会话的事务照成影响。 --->>

A single connection can have 0, 1, or more sessions established on it. The sessions are independent: a commit in one session does not affect  transactions in other sessions.

 

<<---- 一个单数据用户允许多个会话同时存在。如图2所示,用户hr有多个连接到数据库。在专用服务器连接里面,数据库为每一个连接创建了一个服务端进程。在专有服务器里,只有一个客户端进程被创建使用。在共享服务器里,多个客户端进程访问一个单一的共享服务器进程。----->>

Multiple sessions can existconcurrently for a single database user. As shown in2, user hr can havemultiple connections to a database. Indedicated server connections, the database creates aserver process on behalf of each connection. Only theclient process that causes the dedicated server to be created uses it. In a shared server connection,many client processes access asingle shared server process.

                  图2 One Session for Each Connection

 

                 

 

                  图3  Two Sessions in One Connection

 

1.3 Server  Processes

<<---- Oracle数据库创建服务端进程处理来自客户端进程连接实例的请求。一个客户端进程总是通过一个单独的服务端进程与数据库进行交互。服务端进程的创建是为了数据库应用程序能执行一个或多个下面的任务:1.分析和运行通过应用程序发生的SQL语句,包括创建和执行查询计划;2.执行PL/SQL代码;3.从数据文件读取数据块到数据库高效缓冲区;4.返回结果,应用程序能够处理的信息。----->>

Oracle Database creates server processes to handle the requests of client processes connected to the instance. A client process always communicates with a database through a separate server process.

Server processes created on behalf of a database application can perform one or more of the following tasks:

>>Parse and run SQL statements issued through the application, including creating and executing the query plan

>>Execute PL/SQL code

>>Read data blocks from data files into the database buffer cache (the DBWn background process has the task of writing modified blocks back to disk)

>>Return results in such a way that the application can process the information

1.3.1 Dedicated server Processes

<<-----在专有服务连接里,一个客户端连接仅且只和一个服务端进程交互。在Linux系统,20个客户端进程连接到数据库实例,那么就有20个服务端进程提供服务。---->>

In dedicated server connections, the client connection is associated with one and only one server process. On Linux, 20 client processes connected to a database instance are serviced by 20 server processes.

 

<<-----每一个客户端进程直接地和服务端进程进行交互。在会话期间,这个服务端进程是专有的服务于客户端进程。服务器进程存储着特有的进程信息和UGA在它的PGA里面。---->>

 Eachclient process communicates directly with itsserver process. Thisserver process is dedicated to its client process for the duration of the session. Theserver process storesprocess-specificinformation and the UGA in its PGA.

1.3.2 Shared Server Processes

<<-----在共享服务连接里,客户端应用程序通过网络连接到一个调度进程,而不是服务端进程。例如,20个客户端进程能连接到一个单独的调度进程。 ---->>

In shared server connections,client applications connect over a network to adispatcher process, not a server process. For example, 20 client processes can connect to a single dispatcher process.

 

 

<<-----调度进程接收来自客户端连接请求,并且放入到大池里的请求队列中。首先一个有效的共享服务进程从队列里面获取请求并且对它进行处理。之后,共享服务把处理结果放入调度响应队列中。这个调度进程监控队列,传输结果给客户端。 ---->>

The dispatcher process receives requests from connected clients and puts them into arequest queue in thelarge pool. The first available shared server process takes therequest from the queue andprocesses it. Afterward, theshared server place the result into thedispatcher response queue. Thedispatcher process monitors this queue andtransmits the result to theclient.

 

 

<<-----与专有服务进程一样,一个共享服务进程也有它自己的PGA,但是会话的UGA是放在SGA里面,因此,许多共享服务能访问会话数据。 ---->>

Like a dedicated server process, a shared server process has its own PGA. However, the UGA for a session is in the SGA so that any shared server can access session data.

 

 

待续..........

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值