Oracle data file structure, oracle Data Structure

Source: Internet
Author: User

Oracle data file structure, oracle Data Structure

Oracle data structures are divided into physical and logical structures.


Physical Structure: data block of the Operating System-> data file datafiles

Logical Structure: Minimum database block --> extent --> segement --> tablespace --> databases

 

One tablespace can have multiple datafiles, and one datafiles can belong to only one tablespace.

For segement, you can remove the datafiles file, but for extent and blocks, it must be on a datafiles file.


Oracle's main data files include: parameter files spfile, password files orapwd, and data files datafiles online redo log files control files archive log files

 

Communication between the datafile data file and the instance's db buffer cache through the dbw0 Process

The redo log file communicates with the redo log buffer cache of the instance through lgwr.

 

 

There are usually several groups of redo log files, when a file is full, the next redo log file will be written. If all the redo log files are full, the data in the first redo log file will be overwritten from the beginning.

 

There are usually three groups of control files. If one file is corrupted, the damaged file will be repaired through the other two control files and the database will be started, we recommend that you store three groups of control files to different disk blocks. When the database is started, oracle reads the relevant indicators in the control file to complete database Initialization Configuration and start the oracle database instance.

 

 

 



Oracle Database Data File Table tablespace user relationship

Well, this involves the physical and logical structure of the database.
First, you need to understand that the physical structure of the database is determined by the operating system file of the database. Each Oracle database consists of three types of files: data files, log files, and control files. Database files provide real physical storage for database information.
Each Oracle database has one or more physical data files ). A database data file contains all the database data. Data in logical database structures (such as tables and indexes) is physically stored in database data files. Data files are usually in *. dbf format, for example, userCIMS. dbf. A data file has the following features: ①. A data file is associated with only one database; ②. Once a data file is created, it only increases or decreases; ③. A tablespace (logical unit of database storage) it consists of one or more data files.
Next, let's talk about the logical structure of Oracle: the logical structure of Oracle includes tablespaces, segments, data blocks, and schema objects ).
Oracle databases are logically composed of multiple tablespaces, which physically contain one or more data files. The data file size is an integer multiple of the block size. The objects stored in the tablespace are called segments, such as data segments, index segments, and rollback segments. Segments are composed of zones, which are the smallest unit allocated to disks. The increase of segments is achieved by increasing the number of segments. The size of each partition is an integer multiple of the size of the data block. The size of each partition can be different. The data block is the smallest I/O unit in the database and also the unit of the memory data buffer, and data file storage space units. The block size is set by the DB_BLOCK_SIZE parameter, and its value should be set to an integer multiple of the operating system block size.
(1) Table space)
A tablespace is the largest logical unit in a database. Each tablespace consists of one or more data files. A data file can only be associated with one tablespace. Each database has a SYSTEM tablespace that is automatically created during database creation or database installation. It is used to store the SYSTEM's data dictionary tables, Program SYSTEM units, and process functions, packages and triggers can also be used to store user data tables and index objects. Table spaces have the online and offline attributes. You can set any table space other than tablespace me to offline.
(2) segment (segment)
Database segments can be divided into data segments, index segments, rollback segments, and temporary segments.
(3) Zone
The partition is the minimum unit for disk space allocation. The disk is divided by zone. At least one zone is allocated each time. Block Storage and segments, which are composed of continuous data blocks.
(4) data blocks
A data block is the smallest unit of data organization and management in a database. It is the unit of data file disk storage space and the smallest unit of database I/O. The data block size is determined by the DB_BLOCK_SIZE parameter, the default value of DB_BLOCK_SIZE varies with Oracle versions.
Mode object
A schema object is an application that includes tables, clustering, views, index sequence generators, synonyms, hashing, program units, and database chains.
Finally, let's talk about the relationship between Oracle users, tablespaces, and data files:
One user can use one or more tablespaces. One tablespace can also be used by multiple users. There is no affiliation between the user and the tablespace. The tablespace is a logical concept used to manage data storage. The tablespace is only related to the data file, and the data file is physical, a tablespace can contain multiple data files, and a data file can only belong to one tablespace.
To sum up, the best way to explain databases, tablespaces, data files, tables, and data is to imagine a cabinet filled with stuff. The database is actually a Cabinet, the drawer in the cabinet is a tablespace, the folder in the drawer is a data file, the paper in the folder is a table, and the information written on the paper is data .... Remaining full text>

Each ORACLE database has one or more physical data files. What are the characteristics of the data files?

D: The specific explanation is as follows!
The physical structure of the Oracle database includes datafile, redo log files, and control files.

1. Data Files

Features:

A. A data file can belong to only one database
B. When the database space is used up, the data files can be automatically expanded according to the predefined settings.

C. One or more data files form a logical structure in the database-tablespace

When necessary, the data in the data file is read through database operations and cached in the memory structure of Oracle. For example, when a user needs to access data in a database table, if the data requested by the user has not been put into the cache, the database reads the data from the corresponding data file and puts it into the memory.

Newly created or modified data may not be written into the data file immediately. In order to reduce disk access to improve performance, the changed data is stored in the memory, and the corresponding data files are concentrated in the appropriate time. This process is written by the background process database write process (DBWn) (database writer process, DBWn.

2. control file:

The control file contains content that describes the physical structure of the database.

For example, it contains the following information:

Database Name

Name and location of the data file and redo log file

Timestamp of database creation

Oracle can use multiple control files, that is, maintain multiple identical control files at the same time to prevent database faults caused by Control File Corruption.

Each time an Oracle database instance is started, the content in the control file is used to determine which database files and redo log files are required to perform database operations. When the physical structure of the database changes (for example, when a new data file is created or the log file is redone), Oracle automatically modifies the control file to reflect these changes. In addition, control files are also used for database recovery.

3. redo log files:

Each Oracle database has two or more redo log files ). This group of files is called the redo log of the database as a whole. A redo log is composed of redo records ).

Main function: Record operations on data.

Multiplexed redo log: stores multiple redo logs with the same content on different disks.

The information in the redo log can only be used to recover data that cannot be written into data files due to system or media faults.

Rolling forward: restores the redo log information in the Restoration Operation.

4. archiving log files:

Redo log files can be automatically archived. When the database runs in ARCHIVELOG mode, Oracle will automatically archive and redo log files.

5. parameter file:

Contains the list of database and instance configuration parameters.

6. Alarm and tracking and debugging log files:

The database alarm logs record the messages and error messages generated during database operation in chronological order.

7. Backup file:

The recovery file replaces the original file with the backup file.

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.