Oracle9i introduces a new feature that simplifies tablespace creation. This new feature, Oracle Managed Files (OMF), makes life easier for Oracle DBAs by removing the tedium from creating and managing Oracle data files.
Before OMF, Oracle DBAs had to take several manual steps before adding a data file. A simple example of these steps follows, but note that you must know the location of the directory that contains the Oracle data files:
create tablespace users_02 add 'c:oracleoradatadiogenesusers02.dbf' size 20m ;
In this example, you must know the following information to create a new tablespace: - The proper file location
- The proper filename
- The proper file size
Prior to OMF, you needed to execute queries to get the filenames and file locations, interrogating the dba_data_files view to find the appropriate location for a new data file, as shown in Listing A..
| Listing A |  |  | SQL> select file_name from dba_data_files; FILE_NAME ------------------------------------------------ C:ORACLEORADATADIOGENESSYSTEM01.DBF C:ORACLEORADATADIOGENESUNDOTBS01.DBF C:ORACLEORADATADIOGENESCWMLITE01.DBF C:ORACLEORADATADIOGENESDRSYS01.DBF C:ORACLEORADATADIOGENESEXAMPLE01.DBF C:ORACLEORADATADIOGENESINDX01.DBF C:ORACLEORADATADIOGENESTOOLS01.DBF C:ORACLEORADATADIOGENESUSERS01.DBF C:ORACLEORADATADIOGENES16K_TS.DBF | | sidebarend-->| Listing A |  |  | SQL> select file_name from dba_data_files;
FILE_NAME ------------------------------------------------
C:ORACLEORADATADIOGENESSYSTEM01.DBF
C:ORACLEORADATADIOGENESUNDOTBS01.DBF
C:ORACLEORADATADIOGENESCWMLITE01.DBF
C:ORACLEORADATADIOGENESDRSYS01.DBF
C:ORACLEORADATADIOGENESEXAMPLE01.DBF
C:ORACLEORADATADIOGENESINDX01.DBF
C:ORACLEORADATADIOGENESTOOLS01.DBF
C:ORACLEORADATADIOGENESUSERS01.DBF
C:ORACLEORADATADIOGENES16K_TS.DBF |
Using the output of the previous query, the C:OracleOradataDiogenes directory is the proper location to add a new Oracle data file.
Viewing tablespace information was also cumbersome. You had to write a query to join dba_tablespaces with dba_data_files to get the file sizes, as shown in Listing B.
| Listing B |  |  | column file_name format a40
column tablespace format a15
column bytes format 999,999,999
select
file_name,
t.tablespace_name tablespace,
bytes
from
dba_data_files d,
dba_tablespaces t
where
t.tablespace_name = d.tablespace_name ; |
The output is shown in Listing C.
| | Listing C |  |  | FILE_NAME TABLESPACE BYTES ---------------------------------------- --------------- ------------ C:ORACLEORADATADIOGENESSYSTEM01.DBF SYSTEM 340,787,200 C:ORACLEORADATADIOGENESUNDOTBS01.DBF UNDOTBS 209,715,200 C:ORACLEORADATADIOGENESCWMLITE01.DBF CWMLITE 20,971,520 C:ORACLEORADATADIOGENESDRSYS01.DBF DRSYS 20,971,520 C:ORACLEORADATADIOGENESEXAMPLE01.DBF EXAMPLE 159,907,840 C:ORACLEORADATADIOGENESINDX01.DBF INDX 26,214,400 C:ORACLEORADATADIOGENESTOOLS01.DBF TOOLS 10,485,760 C:ORACLEORADATADIOGENESUSERS01.DBF USERS 26,214,400 C:ORACLEORADATADIOGENES16K_TS.DBF TS_16K 10,485,760 | sidebarend-->| Listing C |  |  | FILE_NAME TABLESPACE BYTES ---------------------------------------- --------------- ------------ C:ORACLEORADATADIOGENESSYSTEM01.DBF SYSTEM 340,787,200 C:ORACLEORADATADIOGENESUNDOTBS01.DBF UNDOTBS 209,715,200 C:ORACLEORADATADIOGENESCWMLITE01.DBF CWMLITE 20,971,520 C:ORACLEORADATADIOGENESDRSYS01.DBF DRSYS 20,971,520 C:ORACLEORADATADIOGENESEXAMPLE01.DBF EXAMPLE 159,907,840 C:ORACLEORADATADIOGENESINDX01.DBF INDX 26,214,400 C:ORACLEORADATADIOGENESTOOLS01.DBF TOOLS 10,485,760 C:ORACLEORADATADIOGENESUSERS01.DBF USERS 26,214,400 C:ORACLEORADATADIOGENES16K_TS.DBF TS_16K 10,485,760 |
Oracle Corporation recognized that this was a lot of work just to add a data file, so it developed OMF to reduce the complexity involved in specifying all the detailed file information. Some of the benefits of OMF are:
- Easier Oracle file management—All files are placed into the proper OS directory.
- Easier third-party application integration—Third-party apps don’t have to be aware of OS-specific environments.
- Reduction of Oracle file management errors—No risk of human error.
- Enforcement of Optimal Flexible Architecture (OFA) standards—OMF will comply with the OFA standards for filename and file locations.
- Default file sizes—OMF allows files to have standard, uniform sizes.
|