Oracle Disk Manager and Oracle Managed Files
Oracle9i or later offers a feature known as Oracle Managed Files (OMF). OMFs manage datafile attributes such as file names, file location, storage attributes, and whether or not the file is in use by the database. OMF is only supported for databases that reside in file systems. OMF functionality is greatly enhanced by Oracle Disk Manager.
The main requirement for OMF is that the database be placed in file system files. There are additional prerequisites imposed upon the file system itself. OMF is a file management feature that:
- Eliminates the task of providing unique file names
- Offers dynamic space management by way of the tablespace auto-extend functionality of Oracle9i or later
OMF should only be used in file systems that reside within striped logical volumes, which support dynamic file system growth. File systems intended for OMF use must also support large, extensible files in order to facilitate tablespace auto-extension. Raw partitions cannot be used for OMF.
By default, OMF datafiles are created with auto-extend capability. This attribute reduces capacity planning associated with maintaining existing databases and implementing new applications. Due to disk fragmentation that occurs as the tablespace grows over time, database administrators have been somewhat cautious when considering auto-extensible tablespaces. Oracle Disk Manager eliminates this concern.
When Oracle Disk Manager is used in conjunction with OMF, special care is given within VERITAS Extension for Disk Manager to ensure that contiguous disk space is allocated to datafiles, including space allocated to a tablespace when it is auto-extended. The table and index scan throughput does not decay as the tablespace grows.
How Oracle Disk Manager Works with Oracle Managed Files
This section contains examples illustrating the relationship between Oracle Disk Manager and OMF.
Note
Before building an OMF database, you need the appropriate init.ora default values. These values control the location of the SYSTEM tablespace, online redo logs, and control files after the CREATE DATABASE statement is executed.
Example
The following example shows the init.ora contents and the command for starting the database instance. To simplify Oracle UNDO management, the new Oracle9i or later init.ora parameter UNDO_MANAGEMENT is set to AUTO. This is known as System-Managed Undo.
$ cat initPROD.ora
UNDO_MANAGEMENT = AUTO
DB_CREATE_FILE_DEST = '/PROD'
DB_CREATE_ONLINE_LOG_DEST_1 = '/PROD'
db_block_size = 4096
db_name = PROD
$ sqlplus /nolog
SQL> connect / as sysdba
SQL> startup nomount pfile= initPROD.ora
The Oracle instance starts.
Total System Global Area 93094616 bytes
Fixed Size 279256 bytes
Variable Size 41943040 bytes
Database Buffers 50331648 bytes
Redo Buffers 540672 bytes
Example
To implement a layout that places files associated with the EMP_TABLE tablespace in a directory separate from the EMP_INDEX tablespace, use the ALTER SYSTEM statement. This example shows how OMF handles file names and storage clauses and paths. The layout allows you to think of the tablespaces as objects in a file system as opposed to a collection of datafiles. Since OMF uses the Oracle Disk Manager file resize function, the tablespace files are initially created with the default size of 100MB and grow as needed. Use the MAXSIZE attribute to limit growth.
The following example shows the commands for creating an OMF database and for creating the EMP_TABLE and EMP_INDEX tablespaces in their own locale.
Note
The directory must exist for OMF to work, so the SQL*Plus HOST command is used to create the directories:
SQL> create database PROD;
The database is created.
SQL> HOST mkdir /PROD/EMP_TABLE;
SQL> HOST mkdir /PROD/EMP_INDEX;
SQL> ALTER SYSTEM SET DB_CREATE_FILE_DEST = '/PROD/EMP_TABLE';
The system is altered.
SQL> create tablespace EMP_TABLE DATAFILE AUTOEXTEND ON MAXSIZE \ 500M;
A tablespace is created.
SQL> ALTER SYSTEM SET DB_CREATE_FILE_DEST = '/PROD/EMP_INDEX';
The system is altered.
SQL> create tablespace EMP_INDEX DATAFILE AUTOEXTEND ON MAXSIZE \ 100M;
A tablespace is created.
Use the ls command to show the newly created database:
$ ls -lFR
total 638062
drwxr-xr-x 2 oracle9i dba 96 May 3 15:43 EMP_INDEX/
drwxr-xr-x 2 oracle9i dba 96 May 3 15:43 EMP_TABLE/
-rw-r--r-- 1 oracle9i dba 104858112 May 3 17:28 ora_1_BEhYgc0m.log
-rw-r--r-- 1 oracle9i dba 104858112 May 3 17:27 ora_2_BEhYu4NA.log
-rw-r--r-- 1 oracle9i dba 806912 May 3 15:43 ora_BEahlfUX.ctl
-rw-r--r-- 1 oracle9i dba 10489856 May 3 15:43
ora_sys_undo_BEajPSVq.dbf
-rw-r--r-- 1 oracle9i dba 104861696 May 3 15:4
ora_system_BEaiFE8v.dbf
-rw-r--r-- 1 oracle9i dba 186 May 3 15:03 PROD.ora
./EMP_INDEX:
total 204808
-rw-r--r-- 1 oracle9i dba 104861696 May 3 15:43
ora_emp_inde_BEakGfun.dbf
./EMP_TABLE:
total 204808
-rw-r--r-- 1 oracle9i dba 104861696 May 3 15:43
ora_emp_tabl_BEak1LqK.dbf
|