2.1.Oracle Instances and Oracle Databases (Oracle architecture)

Source: Internet
Author: User
Tags one table reserved dedicated server

Reprinted from: http://blog.csdn.net/robinson_0612/article/details/5529239

An Oracle server consists of an Oracle instance and an Oracle database. That is: Oracle Server = Oracle Instance + Oracle Database

One, Oracle instance

Oracle instances include a memory structure (SGA) and a series of background processes (Background process), which together are called an Oracle instance: Oracle Instance = SGA + Background proce The SS Oracle memory structure contains the system global area (SGA) and the program Global Zone (PGA), which is the Oracle memories Structures = SGA + PGA SGA, which is shared by the server and background processes the PGA contains a single server into the Data and control information for a process or a single background process, in contrast to the SGA shared by several processes, the PGA is an area that is used only by one process,
The PGA is allocated when the process is created and is reclaimed when the process is terminated. This is generated by the server process. 1.SGA system global Zone SGA,SGA = data buffer + Redo log buffer + shared pool + large pool + Java pool + streaming Pool System The global zone is dynamic and is determined by the parameter sga_max_size. View the SGA size of the current system: Show parameter sga_max_size; To modify: Alter system set sga_max_size=1200m Scope=spfile; Because the allocation of instance memory occurs when the database is started, you need to restart the database for the changes to take effect. ORACLE 10G introduces ASMM (automatic shared memory management), and the DBA simply sets up sga_target,oracle to automatically provision the shared pool, Java pool, large pool, data buffer, stream pool. Canceling auto-leveling is sga_target set to. Data buffers (Database buffer cache): The image size for storing data blocks obtained from data files is determined by db_cache_size: Show parameter db_cache_size; Settings: Alter system set db_cache_size=800m; Redo Log buffers (Redo log buffer): Any modifications to the database are recorded sequentially in the buffer, which is then written to disk by the LGWR process, and the size is determined by the Log_buffer shared pool: The most critical memory fragment in the SGA. A shared pool consists primarily of a library cache (shared SQL and PL + zones) and a data dictionary cache.
Its role is to store frequently used SQL, and under limited capacity, the database system determines when to release SQL from the shared pool based on certain algorithms. The library cache size is determined by shared_pool_size: Show parameter shared_pool_size modify: Alter system set shared_pool_size=120m; Data dictionary caching: the definition and permission information for data files, tables, indexes, columns, users, and other data objects in a stored database is determined by shared_pool_size and cannot be specified by a single large pool (Large pools): Yes An optional zone for Java pools in which some large processes such as Oracle's backup recovery operations, IO server processes, and so on, are reserved for Java programs. If no Java program is necessary to change the default size flow pool of the buffer (stream pool): 2.PGA used by Oracle streams is allocated for each user process to connect to the Oracle database reserved Memory process creation, release at the end of the process, can only be One process uses the PGA to include the following structures: () sort area () Cursor State area () session information area () The stack area is determined by parameter: Pga_aggregate_target 3. Several types of processes: User processes, server processes, background processes, other optional processes User processes are generated in the user connection database, request an Oracle server connection, must first establish a connection, not directly with the Oracle Server connection server process when the connection instance and establish a user session, a standalone server or provide a shared server can generate background process Maintains physical and memory connections to manage database read, write, restore, and monitor tasks. The Server process is primarily connected and communicated with user process, and is exchanged for data by him and user process. On UNIX machines, the Oracle background process is relative to the operating system process, that is, an Oracle background process initiates an operating system process. On Windows machines, Oracle background processes open Task Manager as compared to operating system threads, and we can only see a ORACLE.EXE process,
But with another tool, you can see the threads that are contained in the process. There must be a background process DBWN--the database write process Pmon---The program monitors the process Smon the system monitoring process LGWR--and the log write process CKPT --Checkpoint process optional process: ARCN archive process RECO snnn pnnn dbwn (Database write process) writes a modified block of data from the database buffer cache to a data file on disk Piece: Occurs checkpoint dirty cache reaches limit no free cache timeout occurs tablespace offline table space read-only table is deleted or truncated start backup table space can modify the number of data write processes alter system set Db_writ Er_processes=3 Scope=spfile; Pmon (program monitoring process) clears the failed user process and frees the resources used by the user process. If Pmon will roll back uncommitted work, release the lock and release the SGA resource allocated to the failed process. Purge failed processes rollback TRANSACTION release lock release other resources Smon (System monitoring process) checks for database consistency, when a real-column recovery such as disaster recovery is completed when startup fails, roll forward all files in the redo log, open the database in order for users to access, rollback uncommitted transactions, release pro When tablespace clears temporary space, coalescence free space, recovers transaction activity from files that are not available, recover instance of failed node in OPS cleanup obj$ table reduced rollback segment make rollback segment offline LGWR (log write process) writes changes in redo log buffers to the online redo log file Condition: When committed (commit) redo log buffer reaches 1/3 full every 3 seconds there is more than 1MB redo log buffer not written to disk DBWR the SCN number of the data to be written is greater than the SCN number of the LGWR record, DBWR triggers LGWR write Into the timeout before DBWR process some write log CKPT (checkpoint process) DBWR/LGWR works, resulting in data files, log files, control file inconsistencies, CKPT process is responsible for synchronizing data files, dayLog files and control files Ckpt Update the header information condition of the data File/control file: When the database is switched by immediate, transaction, the normal option shutdown the database according to the initial session file Log_che Ckpoint_interval, Log_checkpoint_timeout, Fast_start_io_target set values to determine whether the user triggers the ARCN (archive process) to back up or archive the full log group at each log switch Condition: When the database is running in archive mode, RECO is responsible for solving the problems in the distributed things. Oracle can connect to multiple databases remotely, and some things are in an outstanding state due to network problems. The RECO process attempts to establish communication with the remote server, and when the failure is eliminated, the reco process automatically resolves all pending sessions. Server process (service processes) are divided into private service processes (dedicated server process) and shared services processes (multitreaded server process) dedicated service processes: A service process that corresponds to multiple Process, and turns to serve the user process. User processes, service processes (Server process), background processes (Background Processes) Start user process: A database user requests a Oralce Server session when the service process is started: when using After a user session is started, the process is started in the background process when connected to an Oracle instance: When an Oracle instance is started, the associated background process is started

  

Ii. Oracle Database

1 collection of a series of physical files2 including control files, data files, online log files, parameter files, password files, etc.3That is: OracleDatabase =Controlfile+DataFile+Logfiel+SPFile+..4     1. Control files (controlfile)5 database name, checkpoint information, time stamp for database creation6 all data files, online log files, archived log file information7 backup information, etc.8              9     2. Data files (datafile)Ten contains all the data for users and Applications One        --Viewing data file information A        -        -     3. Online log Files the records all user operations on the database, with at least two log group files in one database and at least one log member in each log group - multiple log members in a log group are mirror-to-phase relationships -        -     4. Archive log Files + Oracle can run in two modes, archive mode and non-archive mode. In archive mode, in order to save all changes to the user, - after the online log file is switched and overwritten, the system saves them as a contiguous set of file series, which is the archive log file.  + the user recovers unexpected data loss, exceptions, and so on.  A        at     5. parameter files (pfile and SPFile) -Initsid.ora or Init.ora files, usually located in: $ORACLE _base/Admin/<Sid>/Pfile - initialization files record the startup parameters of many databases, such as memory, control files, number of processes, etc., when the database is started (Nomount loading) -     -     6. Other Files - Password file: Authentication for Oracle with SYSDBA rights users. in Alert log file: Alarm log file (Alert.log or Alrt.ora), record database startup, shutdown, and some important error messages -To view the path:SelectValue fromV$parameterwhereName=' background_dump_dest '; to     +     7. Logical organizational structure of the database - table space, segment, area, Block the A database consists of one or more table spaces, and a table space can belong to only one database * A table space consists of one or more data files, and one data file can belong to only one table space $ A data file consists of one or more operating system blocks, each operating system block can only be counted as one data filePanax Notoginseng A table space can contain one or more segments, one segment can belong to only one table space - A segment consists of one or more zones, each of which can belong to only one segment the A zone consists of one or more Oracle blocks, and each Oracle block can belong to only one zone + a zone can belong to only one data file, the space of the data file may be assigned to one or more zones AAn Oracle block consists of one or more operating system blocks, and an operating system block is part of an Oracle block

III. Relationship of Oracle instances and Oracle databases

1. An instance can load and open just one database    2. A database can be loaded and opened by multiple instances 3. The relationship between an instance and a database is one-to-many relationships

  

2.1.Oracle Instances and Oracle Databases (Oracle architecture)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.