现在的位置: 首页 > 综合 > 正文

Oracle OMF(Oracle Managed Files ) 说明

2013年02月19日 ⁄ 综合 ⁄ 共 10957字 ⁄ 字号 评论关闭

 

一.官网说明

 Using Oracle Managed Files

http://docs.oracle.com/cd/E11882_01/server.112/e25494/omf.htm#ADMIN003

 

1.1 What Are Oracle Managed Files?

官网链接:

http://docs.oracle.com/cd/E11882_01/server.112/e25494/omf001.htm#i1006122

 

Using Oracle
Managed Files simplifies the administration of anOracle Database. Oracle Managed Files eliminate the need for you, the DBA, todirectly manage the operating system files that comprise an Oracle Database.With Oracle Managed Files, you specify file system directories
in which thedatabase automatically creates, names, and manages files at the database objectlevel. For example, you need only specify that you want to create a tablespace;you do not need to specify the name and path of the tablespace's datafile withthe DATAFILE clause.
This feature works well with a logical volumemanager (LVM).

--使用OMF可以简化Oracle
数据库的管理,通过OMF,可以指定filesystem 目录,之后就可以在这个目录下创建和管理数据库。 比如创建表空间时,不需要指定datafile的名称,默认会将数据文件创建到这个目录下面。

 

The databaseinternally uses standard file system interfaces to create and delete files asneeded for the following database structures:

--Oracle 默认使用标准的文件系统接口来创建和删除如下的数据库结构:

(1)Tablespaces

(2)Redo log files

(3)Control files

(4)Archived logs

(5)Block change tracking files

(6)Flashback logs

(7)RMAN backups

 

Throughinitialization parameters, you specify the file system directory to be
used fora particular type of file. The database then ensures that a unique file, anOracle managed file, is created and deleted when no longer needed.

--在初始化参数里指定特殊类型文件的文件系统目录,这样就可以保证文件的唯一性。

This featuredoes not affect the creation or naming of administrative files such
as tracefiles, audit files, alert logs, and core files.

 

1.2 WhoCan Use Oracle Managed Files?

Oracle Managed Files are most useful forthe following types of databases:

--OMF 在如下情况使用最多:

(1)Databases that are supported by thefollowing:

1)A logical volume manager thatsupports striping/RAID and dynamically extensible
logical volumes

2)A file system that provides large,extensible files

(2)Low end or test databases

 

The OracleManaged Files feature is not intended to ease administration of systems
thatuse raw disks. This feature provides better integration with operating systemfunctionality for disk space allocation. Since there is no operating systemsupport for allocation of raw disks (it is done manually), this feature cannothelp. However, because
Oracle Managed Files require that you use the operatingsystem file system (unlike raw disks), you lose control over how files are laidout on the disks and thus, you lose some I/O tuning ability.

--OMF
没有简化raw disks的管理,OMF 提供了一个整体的磁盘空间分配系统。因为OMF需要使用OS 文件系统,所以可以丢失了一些对磁盘的控制,比如具体的文件存放那个磁盘,I/O性能调整的。

 

1.3 WhatIs a Logical Volume Manager? –什么是LVM

logical
volume manager (LVM) is a software packageavailable with most operating systems. Sometimes it is called a logical diskmanager (LDM). It allows pieces of multiple physical disks to be combined intoa single contiguous address space that appears as one disk to
higher layers ofsoftware. An LVM can make the logical volume have better capacity, performance,reliability, and availability characteristics than any of the underlyingphysical disks. It uses techniques such as mirroring, striping, concatenation,and RAID 5
to implement these characteristics.

--LVM
在大多数系统下都可以用,LVM 也称LDM。LVM 可以让逻辑卷有更好的容量,性能和可靠性。LVM 可以使用mirror,strip,concatenation和RAID技术。

 

Some LVMs allowthe characteristics of a logical volume to be changed after it
is created, evenwhile it is in use. The volume may be resized or mirrored, or it may berelocated to different physical disks.

--一些LVM
允许在其创建之后改变其特性,甚至在使用时,如resize或mirror或relocated到不同的物理磁盘。

 

1.4 WhatIs a File System? –什么是文件系统

file
system is a data structure built inside a contiguousdisk address space. A file manager (FM) is a software package that manipulatesfile systems, but it is sometimes called the file system. All operating systemshave file managers. The primary task of a file
manager is to allocate anddeallocate disk space into files within a file system.

--文件系统是一个连续磁盘空间上的一个数据结构,FM
软件可以管理多个文件系统,File manager 有时也称为file system。 所有的操作系统都有file managers。 File manager 的主要任务是分配和收集file system 上的磁盘空间。

 

A file systemallows the disk space to be allocated to a large number of files.
Each file ismade to appear as a contiguous address space to applications such as OracleDatabase. The files may not actually be contiguous within the disk space of thefile system. Files can be created, read, written, resized, and deleted. Eachfile has a name
associated with it that is used to refer to the file.

       --file system 允许磁盘空间分配给大量的文件。每个文件看起来在一个连续的磁盘空间上,但是实际上并不是一个连续的空间。 文件可以被创建,读取,resize,和
删除.

 

A file system iscommonly built on top of a logical volume constructed by an
LVM. Thus all thefiles in a particular file system have the same performance, reliability, andavailability characteristics inherited from the underlying logical volume. Afile system is a single pool of storage that is shared by all the files in thefile system.
If a file system is out of space, then none of the files in thatfile system can grow. Space available in one file system does not affect spacein another file system. However some LVM/FM combinations allow space to beadded or removed from a file system.

 

An operatingsystem can support multiple file systems. Multiple file systems
are constructedto give different storage characteristics to different files as well as todivide the available disk space into pools that do not affect each other.

 

1.5 Benefitsof Using Oracle Managed Files

Consider the following benefits ofusing Oracle
Managed Files:

--使用OMF有如下好处:

(1)They make the administration of thedatabase easier.

       --简化数据库管理

There is no needto invent filenames and define specific storage requirements.
A consistent setof rules is used to name all relevant files. The file system defines the characteristicsof the storage and the pool where it is allocated.

 

(2)They reduce corruption caused byadministrators specifying the wrong file.

       --降低管理员指定错误文件的可能性。

Each Oraclemanaged file and filename is unique. Using the same file in two differentdatabases
is a common mistake that can cause very large down times and loss ofcommitted transactions. Using two different names that refer to the same fileis another mistake that causes major corruptions.

 

(3)They reduce wasted disk spaceconsumed by obsolete files.

       --减少空间浪费

Oracle Databaseautomatically removes old Oracle Managed Files when they are
no longer needed.Much disk space is wasted in large systems simply because no one is sure if aparticular file is still required. This also simplifies the administrative taskof removing files that are no longer required on disk and prevents the mistakeof deleting
the wrong file.

--DB
会自动移除长时间不用的旧OMF文件。

 

(4)They simplify creation of test anddevelopment databases.

       --简化测试库的创建

You can minimizethe time spent making decisions regarding file structure and
naming, and youhave fewer file management tasks. You can focus better on meeting the actualrequirements of your test or development database.

 

(5)Oracle Managed Files makedevelopment of portable third-party tools easier.

Oracle ManagedFiles eliminate the need to put operating system specific file
names in SQLscripts.

 

1.6 OracleManaged Files and Existing Functionality

Using OracleManaged Files does not eliminate any existing functionality. Existing
databasesare able to operate as they always have. New files can be created as managedfiles while old ones are administered in the old way. Thus, a database can havea mixture of Oracle managed and unmanaged files.

 

二. Enabling the Creation and Use of Oracle
Managed Files

The followingtable lists the initialization parameters that enable the use of Oracle ManagedFiles.

启动OMF的初始化参数如下表:

Initialization Parameter

Description

DB_CREATE_FILE_DEST

Defines the location of the default file system directory or Oracle ASM disk group where the database creates datafiles or tempfiles when no file specification is given in the create operation. Also used as the default location for redo log and control files
if DB_CREATE_ONLINE_LOG_DEST_n are
not specified.

DB_CREATE_ONLINE_LOG_DEST_n

Defines the location of the default file system directory or Oracle ASM disk group for redo log files and control file creation when no file specification is given in the create operation. By changing n,
you can use this initialization parameter multiple times, where n specifies a multiplexed copy
of the redo log or control file. You can specify up to five multiplexed copies.

DB_RECOVERY_FILE_DEST

Defines the location of the Fast
Recovery Area, which is the default file system directory or Oracle ASM disk group where the database creates RMAN backups when no format option is used, archived logs when no other local destination is configured, and flashback logs. Also used as the default
location for redo log and control files or multiplexed copies of redo log and control files if DB_CREATE_ONLINE_LOG_DEST_n are
not specified.

 

The file systemdirectories specified by these parameters must already exist;
the database doesnot create them. The directory must also have permissions to allow the databaseto create the files in it.

 

The defaultlocation is used whenever a location is not explicitly specified
for theoperation creating the file. The database creates the filename, and a file thuscreated is an Oracle managed file.

 

Both of theseinitialization parameters are dynamic, and can be set using the ALTERSYSTEM or ALTER
SESSION statement.

--这些参数可以使用alter
system 或者 alter session 动态修改。

 

2.1 Settingthe DB_CREATE_FILE_DEST
Initialization Parameter

Includethe DB_CREATE_FILE_DEST initialization parameter in yourinitialization parameter file to identify the default location for the databaseserver to create:

-- DB_CREATE_FILE_DEST 指定如下参数的默认位置:

(1)Datafiles

(2)Tempfiles

(3)Redo log files

(4)Control files

(5)Block change tracking files

 

You specify thename of a file system directory that becomes the default location
for thecreation of the operating system files for these entities. The followingexample sets /u01/app/oracle/oradata as the default directory to usewhen creating Oracle Managed Files:

DB_CREATE_FILE_DEST= '/u01/app/oracle/oradata'

 

SQL> show parameter db_create_file_dest

NAME                                 TYPE        VALUE

----------------------------------------------- -------

db_create_file_dest                  string

--默认为空

 

2.2 Settingthe DB_RECOVERY_FILE_DEST
Parameter

Includethe DB_RECOVERY_FILE_DEST and DB_RECOVERY_FILE_DEST_SIZE parametersin
your initialization parameter file to identify the default location for theFast Recovery Area.

       --这2个参数指定默认FRA的位置,FRA 可以包含如下文件:

The Fast Recovery Area contains:

(1)Redo log files or multiplexedcopies of redo log files

(2)Control files or multiplexed copiesof control files

(3)RMAN backups (datafile copies,control file copies, backup pieces, control file autobackups)

(4)Archived logs

(5)Flashback logs

 

可以通过如下SQL 查看保存的文件类型:

SQL> select file_type fromv$flash_recovery_area_usage;

 

更多内容参考:

闪回恢复区
(Flash Recovery Area)

http://blog.csdn.net/tianlesoftware/article/details/5808279

 

RMAN
backup recovery area 命令

http://blog.csdn.net/tianlesoftware/article/details/5806756

 

You specify thename of file system directory that becomes the default location for creation ofthe operating system files for these entities. For example:

DB_RECOVERY_FILE_DEST ='/u01/app/oracle/fast_recovery_area'

DB_RECOVERY_FILE_DEST_SIZE = 20G

 

2.3 Setting the DB_CREATE_ONLINE_LOG_DEST_n
InitializationParameters

Includethe DB_CREATE_ONLINE_LOG_DEST_n initialization parameters in yourinitialization
parameter file to identify the default locations for thedatabase server to create:

(1)Redo log files

(2)Control files

 

You specify thename of a file system directory or Oracle ASM disk group that
becomes thedefault location for the creation of the files for these entities. You canspecify up to five multiplexed locations.

       --可以指定文件系统目录或者ASM disk group来存放这些文件, 最多可以指定5个路径。

 

For the creationof redo log files and control files only, this parameter overrides
any defaultlocation specified inthe DB_CREATE_FILE_DEST and DB_RECOVERY_FILE_DEST initializationparameters.

 

If you do notspecify a DB_CREATE_FILE_DEST parameter, but you do specifythe DB_CREATE_ONLINE_LOG_DEST_n parameter,
then only redo log filesand control files can be created as Oracle Managed Files.

       --如果没有指定DB_CREATE_FILE_DEST 参数,那么就需要指定DB_CREATE_ONLINE_LOG_DEST_n 参数,并且只有redolog
和 control file 可以在OMF 里创建。

 

It is recommended that you specify at leasttwo parameters. For example:

--推荐至少指定2个参数:

DB_CREATE_ONLINE_LOG_DEST

抱歉!评论已关闭.