Two basic concepts of Oracle Architecture

Source: Internet
Author: User
Tags one table access database oracle database

To understand the Oracle architecture, you must first understand two basic concepts: databases and instances.
One: Database
A database is a collection of data.
Whether the database is in a relational or object-oriented structure, the Oracle database holds its data in a data file. Within it, the database structure data is logically mapped to the file so that different data are stored separately, which is called tablespace.
Table space and file description:
1: Table Space
A table space (tablespace) is a logical partition of a database, with at least one tablespace for each database, called the system table space. A table space can only belong to one database.
Each tablespace consists of one or more files on the same disk, which are called data files. Characteristics of Table spaces:
1) Control of database data disk allocation
2 Limit the amount of disk space that a user can use in the table space
3 table space with online, offline, ReadOnly, ReadWrite properties
To modify the properties of a table space:
sql> alter tablespace table space name attribute;
Query table space Status:
Sql> Select Tablespace_name, status from Dba_tablespaces;
Note: System, Undo, temp Tablespace cannot be set to offline property.
4) Complete the backup and recovery of some database
5 The table space is enlarged by the data file, and the size of the table space is equal to the size of the data file that makes up the table space.
The query table space corresponds to the data file:
sql> Select Tablespace_name, Bytes, file_name from Dba_data_files;
Several operations based on the table space:
1 Query user default table space:
Sql> Select Username, default_tablespace from dba_users;
2 query table and table space to store the table:
Sql> Select table_name, tablespace_name from User_tables;
3 Modify user Default table space:
sql> ALTER user username default tablespace tablespace_name;
4 move data from one table space to another table space:
Sql> ALTER TABLE table_name move tablespace tablespace_name;

2: Data files
Each tablespace consists of one or more files on the same disk, which are called data files (datafile), and data files can belong to only one table space. You can change the size of a data file after it is created. Creating a new table space requires creating a new data file. Once the data file is added to the tablespace, it cannot be removed from the tablespace or contacted with other tablespaces. The database must have three types of files, control file, Redolog file. Other files Prameter file,password file, archived log files are not required by the database, they are only secondary databases.

To view the physical file composition of a database:
1 View data file: Sql> select * from V$datafile;
2 View Control File: Sql> select * from V$controlfile;
3 View Log file: Sql> select * from V$logfile;
II: Examples
A popular example is a means of operating an Oracle database.
A database instance, also called a server, is a collection of storage structures and background processes that are used to access database file sets.
A database can be accessed by multiple instances (called the true Application Cluster option).
Determines the size of the instance and the various parameters that comprise it, either stored in the initialization file of the name Init.ora, or hidden in the server parameter file inside the database. Referencing the file through SPFile, SPFile is stored in the Spfile.ora file.
The database system administrator can modify the initialization file when the instance is started, and modifications to the initialization file will only be valid the next time it is started.

Instance is divided into two parts:
1:memory structure (memory structure)
The memory structure is divided into two parts: the SGA (System Global area) zone is the memory area that is used to store database information, which is shared by the database process. It contains data and control information for Oracle servers,
It is allocated in real memory on the computer where the Oracle server resides, if the actual memory is not enough to write to virtual memory.
Including:
. Share Pool
. Datafase Buffer Cache
. Redo Log Buffer
. Other structures
The PGA (Program Global Area) zone contains data and control information for a single server process or a single background process, and the SGA is shared with several processes the PGA is an area that is used by only one process, and the PGA is allocated at the time the process is created to recycle when the process is terminated

2:background process (background processes)
Including:. Pmon is responsible for cleaning up resources when an Oracle process fails
. Smon Check the consistency of the database if necessary, you will also start the recovery of the database when the database is open
. DBWR is responsible for writing changed data from the database buffer cache to the data file
. Lgwr writes changes in redo log buffers to the online redo log file
. CKPT is responsible for updating database state information in control files and data files whenever changes in the buffer cache are permanently recorded in the database.
. Other

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.