oracle db architecture

26
Oracle DB Architecture Simon Huang [email protected]

Upload: simon-huang

Post on 05-Dec-2014

317 views

Category:

Technology


2 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Oracle db architecture

Oracle DBArchitecture

Simon Huang

[email protected]

Page 2: Oracle db architecture

Agenda• 基本架構

• 資料庫引擎架構

• RAC(Real Application Clusters)架構

Page 3: Oracle db architecture

參考文件• Oracle Database Documentation Library

http://www.oracle.com/pls/db112/homepage

• E10897

Oracle Database 2 Day DBA 11g Release 2 (11.2)

• E17264

Oracle Database 2 Day + Real Application Clusters Guide 11g Release 2 (11.2)

Page 4: Oracle db architecture

基本架構

Page 5: Oracle db architecture

以Instance為基礎

DB1

DB2

DB3

Instance1

Instance2

Instance3

DBnInstancen

Page 6: Oracle db architecture

Instance• In Windows

Services

• In Unix-like

Processes

Page 7: Oracle db architecture

比較詳細的Oracle DB結構

Page 8: Oracle db architecture

資料庫引擎架構

Page 9: Oracle db architecture

基本Instance概觀

Page 10: Oracle db architecture

Background Processes• Database writer (DBWRn)

The database writer writes modified blocks from the database buffer cache to the files on a disk.

Oracle Database allows a maximum of 36 database writer processes.

• Log writer (LGWR) The log writer process writes redo log entries to disk.

Redo log entries are generated in the redo log buffer of the System Global Area (SGA) and the log writer process writes the redo log entries sequentially into an online redo log file.

• Checkpoint (CKPT) At specific times, all modified database buffers in the SGA are written to the data

files by a DBWR.

The checkpoint process signals DBWRn, updates the data files and control files of the database, and records the time of this update.

• System monitor (SMON) The system monitor performs instance recovery when a failed instance is

restarted.

• Process monitor (PMON) The process monitor performs a recovery when a user process fails.

It cleans up the cache and frees resources that the failed process was using.

Page 11: Oracle db architecture

Other Background Processes• Archiver (ARCn)

Archiver processes copy the online redo log files to archival storage when the log files are full or a log switch occurs.

• Manageability monitor (MMON)

This process performs various management-related background tasks, for example:

Issuing alerts whenever a given metric violates its threshold value

Taking snapshots by spawning additional processes

Capturing statistical values for SQL objects that have been recently modified

• Job Queue Processes (CJQ0 and Jnnn)

Job queue processes run user jobs, often in batch mode. A job is a user-defined task scheduled to run one or more times.

Page 12: Oracle db architecture

System Global Area(SGA)• Database buffer cache

Before data stored in the database can be queried or modified, it must be read from a disk and stored in the buffer cache.

All user processes connected to the database share access to the buffer cache.

For optimal performance, the buffer cache should be large enough to avoid frequent disk I/O operations.

• Shared pool SQL statements that can be reused

Information from the data dictionary such as user account data, table and index descriptions, and privileges

Stored procedures, which are executable code that is stored in the database

• Redo log buffer This buffer improves performance by caching redo information

until it can be written to the physical online redo log files stored on disk.

Page 13: Oracle db architecture

Other SGA Component• Result cache

The result cache buffers query results.

If a query is run for which the results are stored in the result cache, then the database returns the query results from the result cache.

This SGA component speeds the execution of frequently run queries.

• Large pool This optional area is used to buffer large I/O requests for various

server processes.

• Java pool The Java pool is an area of memory that is used for all session-

specific Java code and data within the Java Virtual Machine (JVM).

• Streams pool The Streams pool is an area of memory that is used by the Oracle

Streams feature

Page 14: Oracle db architecture

Program Global Area(PGA)• A Program Global Area (PGA) is a memory area used by a

single Oracle Database server process.

• When we connect to an Oracle database instance, we create a session that uses a server process for communication between the client and database instance.

• Each server process has its own PGA.

• The PGA is used to process SQL statements and to hold logon and other session information.

• The amount of PGA memory used and the contents of the PGA depend on whether the instance is running in dedicated server or shared server mode.

• The total memory used by all individual PGAs is known as the total instance PGA memory, or instance PGA.

• Setting the size of the instance PGA in Database Control Files, not individual PGAs.

Page 15: Oracle db architecture

Detail View of 11g

Page 16: Oracle db architecture

Detail View of 12c

Page 17: Oracle db architecture

Real Application Clusters(RAC)

Page 18: Oracle db architecture

基本架構

Page 19: Oracle db architecture

RAC基本系統需求• Clustering OS

Windows Server Enterprise Edition, 啟用Cluster服務

Unix-like,安裝啟用Cluster套件

• Oracle Grid Infrastructure Oracle Automatic Storage Management(ASM)

Oracle Clusterware

• Server Hardware (for each node) Physical memory (at least 1.5 gigabyte (GB) of RAM)

An amount of swap space equal to the amount of RAM

Temporary space (at least 1 GB) available in /tmp

All servers that are used in the cluster must have the same chip architecture, for example, all 32-bit processors or all 64-bit processors

• Oracle Universal Installer verifies that your server and operating system meet the listed requirements.

Page 20: Oracle db architecture

Shared Storage需求• SAN or NAS

• Fiber Channel or iSCSI and Logical Unit Number(LUN)

• RAID 5, 6 or 10

• At least 5.5 GB of available disk space for

The Grid home directory

The binary files for Oracle Clusterware, Oracle Automatic Storage Management (Oracle ASM) and their associated log files

• At least 4 GB of available disk space for the Oracle Database home directory, or Oracle home directory.

• Oracle ASM

Page 21: Oracle db architecture

Network Hardware需求• Each node must have at least two network interface cards (NIC).

• One adapter is for the public network interface and the other adapter is for the private network interface (the interconnect).

• For Public interface The names must be the same for all nodes.

Support TCP/IP.

• For Private interface The names must be the same for all nodes as well.

Support the user datagram protocol (UDP).

Using high-speed network adapters and a network switch(Gigabit Ethernet or better).

Supports TCP/IP

Every node in the cluster must be able to connect to every private network interface in the cluster.

• The host name of each node must conform to the RFC 952 standard, which permits alphanumeric characters.

• Host names using underscores ("_") are not allowed.

Page 22: Oracle db architecture

IP Address需求• GNS virtual IP address (GNS installations only)

GNS: Grid Naming Service

• Single Client Access Name (SCAN)

• Virtual IP address

• Public IP address

• Private IP address

Page 23: Oracle db architecture

RAC Example (Simple)

Page 24: Oracle db architecture

RAC Example (Complex)

Page 25: Oracle db architecture

Tools for Oracle Clusterware, ASM and RAC• Oracle Universal Installer (OUI)

• Cluster Verification Utility (CVU) OUI runs CVU after the Oracle Clusterware installation to verify your

environment.

• Oracle Enterprise Manager

• SQL*Plus

• Server Control (SRVCTL)

• Cluster Ready Services Control (CRSCTL)

• Database Configuration Assistant (DBCA)

• Oracle Automatic Storage Management Configuration Assistant (ASMCA)

• Oracle Automatic Storage Management Command Line utility (ASMCMD)

• Listener Control (LSNRCTL)

Page 26: Oracle db architecture

Q & A