Concept
11 physical storage structure
主要介绍物理存储结构,包括数据文件,日志文件和控制文件的概览
首先是物理存储结构的介绍
介于关系型数据库的特点,管理物理上存储的文件不需要访问其逻辑结构。Oracle数据库Oracle database是在永久磁盘上存储数据文件的文件集。在创建一个数据库(CREAT DATABASE)时我们需要包含以下数据库文件:
Data files and temp files Control files Online redo log files
·数据文件Data files是由数据库创建的物理文件,包含数据的结构比如表,索引等等
·控制文件control file是数据库最根本的文件,根据他可以跟踪数据库的物理组成部分
·联机重做日志文件是记录数据变更的文件集。
A database instance is a set of memory structures that manage database files.通过实例可以管理以上的数据库文件
如图可见数据文件和控制文件是二进制格式储存的
数据库文件的存储机制
最常用的机制包括:
·Oracle ASM(Oracle Automatic Storage Management)
·Operating system file system(最传统也使用最多的存储机制)
·Raw device(裸设备)
一个数据库可以同时拥有以上的存储机制,比如在Operating system file system存储控制文件,在ASM中存储部分数据文件,再在Cluster file system中存储其余的数据文件日志文件等等。
Oracle Automatic Storage Management (Oracle ASM)
ASM是一个专为oracle数据库的文件设计的高性能易于管理的存储方案
ASM相比传统的文件系统存储管理有着一下优点:
·在创建和管理数据库以及管理磁盘空间时,简化了相关的存储任务
·能够分散数据的热区响应并且在各个磁盘上有着相同的性能,采用将数据分布在多个物理磁盘上的方式存储
·存储配置变化过后会自动调整数据
使用ASM存储机制,需要为数据库配备分区磁盘
Oracle Database can store a data file as an Oracle ASM file in an Oracle ASM disk
group,
ASM instance
An Oracle ASM instance is a special Oracle instance that manages Oracle ASM disks.
ASM instance 和 DB instance的关系:Both the ASM and the database instances require shared access to the disks in an ASM disk group. ASM instances manage the metadata of the disk group and provide file layout information to the database instances. Database instances direct I/O to ASM disks without going through an ASM instance. DB instance可以直接负责ASM disks的输入输出,ASM instance负责管理ASM disks的元数据和像DB实例提供文件的分布信息
Oracle-Managed and User-Managed Files
Oracle ASM requires Oracle-managed files
与user-managed files相对,默认的ORACLE数据库管理方式命名文件名的格式
Overview of Data Files
Use of Data Files
在操作系统级,数据库在数据文件里存储数据
Each nonpartitioned schema object and each partition of an object is stored in its own segment.(segment相当于表,索引,表段等)
Each segment belongs to only one tablespace.
·Each tablespace consists of one or more data files, which conform. to the operating system in which Oracle Database is running.
·The data for a database is collectively stored in the data files located in each tablespace of the database.
·A segment can span one or more data files, but it cannot span multiple tablespaces.(多个数据文件可以拥有同一个segment,但一个segment只能属于一个表空间?)
·A database must have the SYSTEM and SYSAUX tablespaces. Oracle Database automatically allocates the first data files of any database for the SYSTEM tablespace during database creation.
The SYSTEM tablespace contains the data dictionary, a set of tables that contains database metadata. Typically, a database also has an undo tablespace and a temporary tablespace (usually named TEMP).
Permanent and Temporary Data Files
Objects in permanent tablespaces are stored in data files.
Locally managed temporary tablespaces have temporary files (temp files).
Temp files are always set to NOLOGGING mode
Online and Offline Data Files
When you take a data file offline in an online tablespace, the tablespace itself remains online. You can make all data files of a tablespace temporarily unavailable by taking the tablespace itself offline
Data File Structure
data file header:contains metadata about the data file such as its size and checkpoint SCN.
Overview of Control Files
The database control file is a small binary file associated with only one database. Each database has one unique control file
Overview of Online Redo log Files
to be continued ......回到家太晚,今天计划的任务没完成,明天继续。。。。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24005010/viewspace-684066/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/24005010/viewspace-684066/