Oracle Managed File (OMF) System


Oracle Managed Files simplify the administration of certain types of Oracle databases. These files help with administration by eliminating the need for the database administrator to directly manage the files associated with the Oracle database. Oracle Managed Files are created and deleted by the Oracle Server based on parameters specified in the PFILE or the SPFILE initialization file.

Initialization File Parameters for OMF

To take advantage of OMF, parameters need to be specified in the parameter files. These parameters and their explanation follow:

  • DB_CREATE_FILE_DEST Provides the default location for the data files.

  • DB_CREATE_ONLINE_LOG_DEST_n Provides the default location for the online redo logs and control files. You can specify up to a maximum of five locations for this parameter.

Both of these parameters do not have to be set to use OMF; they are independent parameters. Setting one allows you to use that functionality while leaving the other manually managed.

Furthermore, these parameters are dynamic parameters, meaning that they can be altered at any time by using the ALTER SYSTEM SET command.

Remember, you can specify up to five locations for the DB_CREATE_ONLINE_LOG_DEST_n parameter.


OMF Naming Conventions

Oracle not only controls the maintenance of the database files, but it also controls the naming of these files. Table 4.4 shows what each of these filenames typically looks like.

Table 4.4. Oracle Managed File Types

File Type

Filename Format Examples

Control files

ora_%u.ctl

Redo log files

ora_%g_%u.log

Data files

ora_%t_%u.dbf

Temporary data files

ora_%t_%u.tmp

Undo files

ora_%t_%u.dbf


The wildcards %g, %t, and %u have the following definitions:

  • %g The redo log file group number.

  • %t The tablespace name, truncated as necessary to ensure that it fits into the maximum filename. By placing the tablespace name before the uniqueness string, you allow all the data files for a given tablespace to appear together in an alphabetical listing of files.

  • %u An eight-character character string that guarantees uniqueness.

  • ora_ Signifies that the file is an Oracle Managed File.

For example, if you want to create a database with Oracle Managed Files for the data files (data files, temp files, and undo files), control files, and online redo log files, and have the control files and log files created in their own separate directories, you would set the initialization parameters as follows:

On Unix:

 DB_CREATE_FILE_DEST = '/mydatabse/mydb1/' DB_CREATE_ONLINE_LOG_DEST_1 = '/mydblogs1/mydb1/' DB_CREATE_ONLINE_LOG_DEST_2 = '/mydblogs2/mydb1/' 

On Windows:

 DB_CREATE_FILE_DEST = 'c:\mydatabse\mydb1\' DB_CREATE_ONLINE_LOG_DEST_1 = 'c:\mydblogs1\mydb1\' DB_CREATE_ONLINE_LOG_DEST_2 = 'c:\mydblogs2\mydb1\' 

Then issue the CREATE DATABASE statement as follows:

 CREATE DATABASE mydb1; 

This allows the control files and redo log files to be duplexed across the /mydblogs1 (c:\mydblogs1) and /mydblogs2 (c:\mydblogs2) directories.

If the CREATE DATABASE statement fails when you are using OMF, any files that have been created are removed. Although this is true of dropping tablespaces in general with OMF (that the system also drops the data files at the same time as the tablespace), it is important to remember that simply failing the CREATE DATABASE statement will clean up after itself.


You can find out the internally generated filenames by selecting from the DBA_DATAFILES data dictionary view for the data files, or the V$LOGFILE data dictionary view for log files.



    Oracle 9i Fundamentals I Exam Cram 2
    Oracle 9i Fundamentals I Exam Cram 2
    ISBN: 0789732653
    EAN: 2147483647
    Year: 2004
    Pages: 244
    Authors: April Wells

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net