After 10 Gb of Oracle, two features OFA and OMF are introduced in terms of directory structure and file management. OFA (Oracle Flexiable Architecture) is a feature of directory structure constraints. The directory structure distribution of diagnostic files such as diag, logs, and data files is fixed by OFA. OMF (Oracle Managed File) is a File structure that converts the original user's File name and location into Oracle for management.
OMF mainly involves data files and log files. In the process of file management, such as adding and deleting operations, we do not need to pay attention to the details of the file name and location. In short, OMF solves three problems:
Ü file storage location. OMF and OFA are linked. From the perspective of Oracle, the best-practice file deployment structure is the key point for successful database installation and configuration. After entering ASM, Oracle itself has a strong "desire to manage ". OMF allows you to configure the path by default to meet most of your needs;
Ü file name and creation. In traditional file management, we need to explicitly specify the file name (including path ). With OMF, We are freed from this work. We only need to specify the file size (or even not) to create an operation;
Ü files are automatically deleted. After a traditional data file is created, the tablespace drop tablespace xxx cannot be deleted unless we use the including clause. With OMF, drop tablespace can automatically delete data files;
In OMF, the two parameters play a decisive role: db_create_file_dest and db_create_online_log_dest_n. These two parameters play a decisive role in controlling OMF behavior. The following describes how two parameters affect database behavior through a series of parameter experiments.
Oracle OMF Functions
Oracle tablespace creation and deletion, omf, partition table Creation
1. Environment Introduction
We still chose Oracle 11gR2 for the test. The specific version is 11.2.0.4.
SQL> select * from v $ version;
BANNER
----------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0-Production
PL/SQL Release 11.2.0.4.0-Production
CORE 11.2.0.4.0 Production
TNS for Linux: Version 11.2.0.4.0-Production
NLSRTL Version 11.2.0.4.0-Production
The default system parameters are as follows:
SQL> show parameter db_create;
NAME TYPE VALUE
-----------------------------------------------------------------------------
Db_create_file_dest string/u01/app/oradata
Db_create_online_log_dest_1 string
Db_create_online_log_dest_2 string
Db_create_online_log_dest_3 string
Db_create_online_log_dest_4 string
Db_create_online_log_dest_5 string
According to the official explanation, db_create_file_dest is responsible for the general file directory structure, including data files and log files. Db_create_online_log_dest_n is responsible for the online log directory structure, and n is the number of members of a single online redo log group. The value of N and the number specified by maxlogfile when the database is created.
The current data files and logs are as follows:
SQL> select file_name, file_id, tablespace_name from dba_data_files;
FILE_NAME FILE_ID TABLESPACE_NAME
-----------------------------------------------------------------------------------------------------
/U01/app/oradata/ORA11G/datafile/o1_mf_users_9mnjs074 _. dbf 4 USERS
/U01/app/oradata/ORA11G/datafile/o1_mf_undotbs1_9mnjs068 _. dbf 3 UNDOTBS1
/U01/app/oradata/ORA11G/datafile/o1_mf_sysaux_9mnjs04h _. dbf 2 SYSAUX
/U01/app/oradata/ORA11G/datafile/o1_mf_system_9mnjrzty _. dbf 1 SYSTEM
/U01/app/oradata/ORA11G/datafile/o1_mf_system_9ppkjccb _. dbf 5 SYSTEM
SQL> select group #, member from v $ logfile;
GROUP # MEMBER
------------------------------------------------------------------------------
3/u01/app/oradata/ORA11G/onlinelog/o1_mf_3_9mnjx4n0 _. log
3/u01/app/fast_recovery_area/ORA11G/onlinelog/o1_mf_3_9mnjx54c _. log
2/u01/app/oradata/ORA11G/onlinelog/o1_mf_2_9mn1_zpq _. log
2/u01/app/fast_recovery_area/ORA11G/onlinelog/o1_mf_2_9mnjx15f _. log
1/u01/app/oradata/ORA11G/onlinelog/o1_mf_00009mnjwtj9 _. log
1/u01/app/fast_recovery_area/ORA11G/onlinelog/ow.mf_00009mn1_vdm _. log
6 rows selected
In the current OMF configuration,/u01/app/oradata is the top-level file structure. The data file adopts the OMF automatic naming mechanism. The Online Redo Log group contains two members, one in the/u01/app/oradata directory, and the other in the recovery area.
Note: The db_create_file_dest parameter is file_dest, not datafile_dest. This parameter is a unified parameter located at the upper layer of the OMF parameter system. If no other directory is specified for log. Db_create_file_dest is responsible for data files and log files. This is also true from the actual situation.
For more details, please continue to read the highlights on the next page: