Top Banner
Process Architecture • Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some operating systems use the terms job or task • An Oracle database server has: – User processes – Oracle processes
31

Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.

Dec 13, 2015

Download

Documents

Moses Crawford
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.

Process Architecture

• Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some operating systems use the terms job or task

• An Oracle database server has:– User processes– Oracle processes

Page 2: Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.

User and Oracle Processes

• User (Client)Processes– Used to run the software

code of an application program

– Manage communication with the server process through the program interface

– Two types:• Connection• Session

• Oracle Processes– Used to run Oracle

database server code– Two Types:

• Server Processes• Background Process

Page 3: Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.

Connection- Definition

• A physical path between your client process and the database instance.

• The connection is made between the client process and either a dedicated server or dispatcher.

Page 4: Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.

Sessions are where you execute SQL commands, commit transactions and run stored procedures.

Session- Definition

• A session is a logical entity that exists in the instance. It is a†collection of data structures in memory that represent a unique session.

Page 5: Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.

Differentiating between Connection and Session

• One or many Sessions may share the same physical connection to the database

OR• There could be a connection to the database with no

associated sessionsOR• A physical connection could be drop leaving a session

intact (idle) and would remain so until the connection was reestablished

Page 6: Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.

Sever Process

• Handles requests of user processes connected to the instance

• Perform system functions:– Run SQL statements– Read data blocks from data file into the shared database

buffers of the SGA– Returns results in a readable format for the application

• Two configurations for Server Processes:– Dedicated server configuration– Shared server configuration

Page 7: Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.

Dedicated Server Configuration

• For each user the database application is run by a different user processes that one that runs the Oracle process

Page 8: Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.

Dedicated Server Configuration- Diagram

Page 9: Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.

Shared Server

• The database application is run by a different user process than the one that runs the Oracle database server code

Page 10: Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.

Shared Server- Diagram

Page 11: Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.

Dedicated Server vs. Shared Server

• Dedicated Server– No waiting for long transactions– Scalability (Provided sufficient CPU and RAM are

available)– Recommended configuration

• Shared Server– Reduces the number of threads– Reduces the memory needed– Maximize concurrent users

Page 12: Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.

Background Processes

• Database Writer (DBWn)• Log Writer (LGWR)• Checkpoint (CKPT)• System Monitor (SMON)• Process Monitor (PMON)• Archiver (ARCn)• Recoverer (RECO)• Dispatcher(Dnnn)

Page 13: Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.

Background Processes - Diagram

Page 14: Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.

Database Writer (DBWn)

Page 15: Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.

Utilizes the Least Recently Used (LRU) algorithm for buffer management

Database Writer (DBWn)

• Manages the buffer cache so that users processes can always find free buffers

• Writes dirty buffers from the data buffer cache to the database when:– # of free buffers gets too low– Directed by the checkpoint process

Page 16: Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.

Checkpoint (CKPT)

Page 17: Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.

Checkpoint (CKPT)

• Coordinates the process of seeing that all transactions completed or rolled back prior to the checkpoint time have been written to back-up storage

• Writes a checkpoint number to the redo log file

• Writes a checkpoint number to the header of each tablespace and to the control file

Page 18: Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.

Log Writer (LGWR)

Page 19: Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.

Switch occurs only if the prior checkpoint for the next Redo Log File is complete

Log Writer (LGWR)

• Clears the Redo Log Buffer by writing its contents to a Redo Log File

• LGWR initiates a checkpoint when redo log file is full and then switches to the next Redo Log File

Page 20: Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.

Archiver (ARCn)

Page 21: Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.

Archiver (ARCn)

• Copies redo log files to a designated storage device after a log switch occurs

• ARCn begins writing when a log file becomes inactive

• The system will hang if the ARCn has not completed writing before that redo log file is used again

Page 22: Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.

System Monitor (SMON)

Page 23: Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.

SMON regularly checks if it is needed or can be called by other processes when needed

System Monitor (SMON)

• Performs recovery at start-up• Responsible for cleaning up temporary

segments no loner in use• Recovers terminated transactions skipped

during start-up, once system is available

Page 24: Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.

Process monitor (PMON)

Page 25: Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.

PMON regularly checks if it is needed or can be called by other processes when needed

Process monitor (PMON)

• Performs automatic processes recovery when a user process fails

• Responsible for cleaning up the database buffer cache

• Reclaims memory and other resources allocated to the failed process

• Checks status or dispatcher and server, restarts if necessary

Page 26: Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.

Recoverer (RECO)

Page 27: Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.

RECO fails to connect to remote serve it automatically tries again at timed interval

Recoverer (RECO)

• Used to resolve failures involving distribute transactions

• Can automatically complete the Commit or Rollback Commands, locally

• Remove all related pending transactions, globally

Page 28: Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.

Dispatcher (Dnnn)

Page 29: Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.

Dispatcher (Dnnn)

Page 30: Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.

Dispatcher (Dnnn)

• Directs multiple incoming network session requests to a pool of shared server processes– Places a single program interface call on to a

common request queue– Removes the result from its own response queue– Returns completed request to appropriate user

Page 31: Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.

References

• Oracle Database Concepts - Chapter 9 Process Architecture

• Oracle Database Developer’s Guide- Chapter 4 Managing Oracle Database Processes

• Expert Oracle Database Architecture - Thomas Kyle