Oracle体系结构与术语

ORACLE Architecture and Terminology

This section will provide a basic understanding of ORACLE including the concepts and terminology of the ORACLE Server. It is important that you read through this section to familiarize yourself with the concepts and terminology to be used throughout this manual. Most of the information contained in this section is DIRECTLY extracted from "ORACLE7 Server Concepts Manual'' and all credit should be attributed to ORACLE.

Before you can begin to use ORACLE, you must have a basic understanding of the architecture of ORACLE to help you start thinking about an ORACLE database in the correct conceptual manner.

Figure 1 illustrates a typical variation of ORACLE's memory and process structures; some of the memory structures and processes in this diagram are discussed in the following section. For more information on these memory structures and processes, see page 1-15 of  "ORACLE7 Server Concepts Manual.''

Oracle体系结构与术语_第1张图片

Figure 1. ORACLE Architecture

 

Memory Structures and Processes

The mechanisms of ORACLE execute by using memory structures and processes. All memory structures exist in the main memory of the computers that constitute the database system. Processes are jobs or tasks that work in the memory of these computers.


Memory Structures


内存结构 = SGA + PGA


SGA (a shared memory region) = database + redo log buffers + shared pool
: data and control information for one oracle instance
PGA (a memory buffer): data and control information for a server process
an oracle instance = SGA + background processes


ORACLE creates and uses memory structures to complete several jobs. For example, memory is used to store program code being executed and data that is shared among users. Several basic memory structures are associated with ORACLE: the system global area (which includes the database and redo log buffers, and the shared pool) and the program global area.

System Global Area (SGA ) is a shared memory region allocated by ORACLE that contains data and control information for one ORACLE instance.

An ORACLE instance contains the SGA and the background processes.

The SGA is allocated when an instance starts and deallocated when the instance shuts down. Each instance that is started has its own SGA.

The Program Global Area (PGA ) is a memory buffer that contains data and control information for a server process. A PGA is created by ORACLE when a server process is started. The information in a PGA depends on the configuration of ORACLE.


Processes

Processes =  user processed + ORACLE processes

A process is a "thread of control'' or a mechanism in an operating system that can execute a series of steps. Some operating systems use the terms job or task. An ORACLE database system has two general types of processes: user processes and ORACLE processes.

A user process is created and maintained to execute the software code of an application program (such as a PRO*C program) or an ORACLE tool (such as SQL*PLUS). The user process also manages the communication with the server processes. User processes communicate with the server processes through the program interface.

ORACLE processes are called by other processes to perform functions on behalf of the invoking process. ORACLE creates a server process to handle requests from connected user processes. ORACLE also creates a set of background processes for each instance (see "ORACLE7 Server Concepts Manual'' pages 1-18, 1-19).
Database Structures

The relational model has three major aspects:

Structures
    Structures are well-defined objects that store the data of a database. Structures and the data contained within them can be manipulated by operations.

Operations
    Operations are clearly defined actions that allow users to manipulate the data and structures of a database. The operations on a database must adhere to a pre-defined set of integrity rules.

Integrity Rule
    Integrity rules are the laws that govern which operations are allowed on the data and structures of a database. Integrity rules protect the data and the structures of a database.

An ORACLE database has both a physical and a logical structure. By separating physical and logical database structure, the physical storage of data can be managed without affecting the access to logical storage structures.


Logical Database Structure
Logical storage structure = tablespace, segment, extent
:dictate how the physical space of a database is used
An ORACLE database's logical structure is determined by:

  • one or more tablespaces.
  • the database's schema objects (e.g., tables, views, indexes, clusters, sequences, stored procedures).

The logical storage structures, including tablespaces, segments, and extents, dictate how the physical space of a database is used. The schema objects and the relationships among them form the relational design of a database.

 

 

Tablespaces and Data Files

Oracle体系结构与术语_第2张图片

Oracle体系结构与术语_第3张图片

 

Oracle体系结构与术语_第4张图片

Figure 3. The Relationship Among Segments, Extents and Data Blocks

Oracle体系结构与术语_第5张图片

Oracle体系结构与术语_第6张图片

After a data block becomes full, as determined by PCTFREE, the block is not considered for the insertion of new rows until the percentage of the block being used falls below the parameter PCTUSED. Before this value is achieved, the free space of the data block can only be used for updates to rows already contained in the data block. For example, assume that you specify the following parameter within a CREATE TABLE statement:
pctused 40

In this case, a data block used for this table's data segment is not considered for the insertion of any new rows until the amount of used space in the blocks falls to 39/% or less (assuming that the block's used space has previously reached PCTFREE).

No matter what type, each segment in a database is created with at least one extent to hold its data. This extent is called the segment's initial extent.

If the data blocks of a segment's initial extent become full and more space is required to hold new data, ORACLE automatically allocates an incremental extent for that segment. An incremental extent is a subsequent extent of the same or incremented size of the previous extent in that segment.

Every non-clustered table in an ORACLE database has a single data segment to hold all of its data. The data segment for a table is indirectly created via the CREATE TABLE/SNAPSHOT command.

Storage parameters for a table, snapshot, or cluster control the way that a data segment's extents are allocated. Setting these storage parameters directly via the CREATE TABLE/SNAPSHOT/CLUSTER or ALTER TABLE/SNAPSHOT/CLUSTER commands affects the efficiency of data retrieval and storage for that data segment.

For more information on Data Blocks, Segments and Extents, see "ORACLE7 Server Concepts Manual.''


Physical Database Structure

An ORACLE database's physical structure is determined by the operating system files that constitute the database. Each ORACLE database is comprised of these types of files: one or more data files, two or more redo log files, and one or more control files. The files of a database provide the actual physical storage for database information. For more information on these physical storage files, see "ORACLE7 Server Concepts Manual.''

Figure 5. Maintaining the Free Space of Data Blocks with PCTFREE and PCTUSED

你可能感兴趣的:(oracle,server,table,database,Parameters,structure)