Two basic concepts of Oracle architecture: database and instance

Source: Internet
Author: User
To understand the Oracle architecture, you must first understand two basic concepts: databases and instances.

  I. Database

A database is a collection of data.

Whether the database adopts a relational structure or an object-oriented structure, the Oracle database stores the data in the data file. internally, the logical ing of database structure data to files allows different data to be stored separately. These logical partitions are called tablespaces.

Table space and file introduction:

1: tablespace

A table space is the logical division of a database. Each database has at least one table space, called a system table space. A table space can only belong to one database.

Each tablespace is composed of one or more files on the same disk. These files are called data files. tablespace features:

1) control database data disk allocation

2) restrict the disk space that users can use in the tablespace

3) tablespaces have the online, offline, readonly, and readwrite attributes.

Modify the properties of a tablespace:

SQL> alter tablespace name attribute;

Query the table space status:

SQL> select tablespace_name, status from dba_tablespaces;

Note: The system, undo, and temp tablespace cannot be set as the offline attribute.

4) backup and recovery of some databases

5) The tablespace is expanded by a data file. The tablespace size is equal to the size of the data file that constitutes the tablespace.

Query the ing between a table space and a data file:

SQL> select tablespace_name, bytes, file_name from dba_data_files;

Table space-based operations:

1) query the user's default tablespace:

SQL> select username, default_tablespace from dba_users;

2) query the table and the tablespace that stores the table:

SQL> select table_name, tablespace_name from user_tables;

3) modify the user's default tablespace:

SQL> alter User Username default tablespace tablespace_name;

4) move data from one tablespace to another:

SQL> ALTER TABLE table_name move tablespace tablespace_name;

2: Data Files

Each tablespace is composed of one or more files on the same disk. These files are called data files. data files can only belong to one tablespace. the data file size can be changed after being created. to create a new tablespace, you must create a new data file. once a data file is added to a tablespace, it cannot be moved from the tablespace or be associated with other tablespaces. the three types of files required by the database are data file, control file, and redolog file. other files, such as prameter file, password file, and archived log files, are not required by the database. They only support the database.

View the physical file composition of the database:

1) view data files: SQL> select * from V $ datafile;

2) view the control file: SQL> select * from V $ controlfile;

3) view log files: SQL> select * from V $ logfile;

Ii. Instances

In general, instances are a means of operating Oracle databases.

A database instance is also called a server. It is used to access the storage structure of the database file set and the collection of background processes.

A database can be accessed by multiple instances (called the true application cluster option ).

Determines the size and composition of the instance. ora initialization file, or hidden in the server parameter file in the database. this file is referenced through spfile, which is stored in spfile. ora file.

When the instance starts, it reads the initialization file. The database system administrator can modify the file. Modifications to the initialization file are only valid at the next startup.

Instances are divided into two parts:

1: memory structure (memory structure)

Memory structure is divided into two parts: the SGA (system global area) area is the memory area used to store database information, which is shared by the database process. It contains data and control information of the Oracle server,

It is allocated in the actual memory of the computer where the Oracle server resides. If the actual memory is insufficient, it is written into the virtual memory.

Including:

. Share pool

. Datafase buffer cache

. Redo log Buffer

. Other Structures

The program global area contains the data and control information of a single server process or a single background process. The SGA shared with several processes is the opposite. PGA is only used by one process, PGA is allocated during Process Creation and recycled upon Process Termination

2: background process)

Including:. pmon is responsible for clearing resources when an oracle process fails.

. SMON checks Database Consistency and starts database recovery when the database is opened if necessary

. Dbwr is responsible for writing changed data from the database buffer cache to the data file

. Lgwr writes changes in the redo log buffer to the online redo log file.

. Ckpt updates the database status information in control files and data files whenever changes in the buffer cache are permanently recorded in the database. Article Source: http://oracle.chinaitlab.com/serial/796546.html

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.