Before OMF (managed files) is available, the database administrator needs to care about two issues when creating data files. The first is what kind of name should be taken for this data file, and the second is to consider whether the newly created data file will be duplicated with the existing data file. When an enterprise has a large database and hundreds of data files, this operation becomes very difficult. Therefore, a mechanism is required to automatically manage data files. The OMF file hosting mechanism is provided in the Oracle database.
I. Related configuration during use
The OMF file hosting mechanism is equivalent to a batch processing. When you create a data file, the system automatically creates a data file based on certain rules by entering a command without parameters such as name and storage location. Therefore, before using this managed file function, the administrator needs to establish relevant rules in the database. Although the system sometimes uses the default configuration, I do not recommend this. For a complex database system, it is a good habit to create a data file system in advance based on the actual situation of the enterprise. The default settings of the system are usually for Small and Medium-sized applications and cannot meet the requirements of large databases. Therefore, the administrator needs to configure relevant rules based on the actual situation. Specifically, the following parameters are involved.
1. The DB_CREATE_FILE_DEST parameter. As the name suggests, this parameter is mainly used to specify the default storage location of data files. After setting this parameter, the Administrator does not need to enter the specific file location when creating the data file. Note that this address is also related to temporary files, redo log files, and control files.
The second is the DB_RECOVERY_FILE_DEST parameter. This parameter is used to define the default location of redo logs, control files, RMAN backup files, archiving logs, and Flash logs. When the administrator sets this parameter, the system will rewrite its default settings.
The third is the DB_CREATE_ONLINE_LOG_DEST_N parameter. This parameter is also used to define the default location of the redo log file and control file. Some people may ask, if this parameter is different from the location defined in the previous parameter, what should we do? This involves a priority issue. Generally, if this parameter is set, the settings of the first two parameters will be overwritten. The system uses the location defined by this parameter. Someone may ask, why is this parameter followed by a character N? In fact, this is mainly for the need to create a copy. The specific content will be described in detail in the following content.
Ii. Use OMF to create data files
After the preceding rules are configured, you can use the OMF file hosting function to create data files. Run the ALTER Tablespace add datafile command. Note that the path and name of the data file to be created are not specified in this command. These are automatically supplemented by the system according to pre-defined rules. When using this command, I think you need to pay attention to the following points.
First, how can I archive logs and control multiple copies of files? When you manually create an archive log file and a control file, we always create multiple archive log files with the same name or a copy of the control file in different locations. In this case, when an archive log file or control file is faulty, you can also make up for it through copies. How can this function be implemented when a data file is automatically created through OMF-managed files? In fact, the implementation method is also very simple. When DB_CREATE_ONLINE_LOG_DEST_N is set, the system automatically creates a copy of the relevant file. This is the role of the last character n.
2. What should I do if I create a tablespace? Before OMF's file hosting function is available, creating tablespaces is independent of creating data files. That is to say, after creating a tablespace, the administrator needs to manually create a data file based on the actual situation. However, with the OMF file hosting function, this situation has undergone fundamental changes. In other words, you only need to run the Create Tablespace command without creating the actual data file involved. The system will automatically Create the relevant data file. If multiple image locations are specified, a copy of the redo log file or control file is automatically created.
Iii. Limitations of OMF file hosting and Countermeasures
Although the OMF file can improve the automation capability of data file creation, such as automatic naming and automatic identification of duplicate names. However, it also has certain limitations in the specific use process. In general, the main advantage of OMF hosting files is that you don't have to worry about creating existing files (including data files, redo log files, control files, and so on ). The main limitations of OMF are that they do not have the advantages of capacity management and balance I/O. This will have a certain impact on the performance of subsequent systems. In practice, OMF hosted files are often used in combination with ASM, another Oracle function. ASM (Automatic Storage Management) is an effective supplement to the OMF managed file management function.
4. Notes for using OMF and ASM
Generally, OMF cannot balance the I/O and capacity management functions. The defects can be compensated by the Automatic Storage Management Mechanism of ASM. In the process of combining the two, you need to pay attention to the following content.
Problems related to the first bare device. A bare device is a storage device that does not use a file system. The advantage of saving data on such devices is that the system performance can be improved. However, its permissions are difficult to maintain. Note that Automatic Storage Management of ASM supports bare devices, so there are no problems such as asynchronous I/O or direct I/O. For OMF, most of the operations are performed in the context of the file system. Therefore, in terms of application scope, ASM is larger than OMF. Pay special attention to the specific configuration.
Second, cross-platform issues. Oracle Database is a cross-platform management system that can run on Microsoft's operating system or be deployed on Linux and other operating systems. However, because there are large differences in the kernel among different operating systems, there are also many differences in the actual preparation process. This problem also occurs when the OMF function is used for the ASM function. It should be noted that ASM is a management tool specially designed to simplify DBA work. It provides a storage management interface that spans all servers and storage platforms. That is to say, ASM supports multiple operating system platforms. In other words, operations on different platforms are basically the same. For OMF-hosted files, it is not that simple. Because the OMF file clearance function is more like dealing with the operating system, such as specifying the file storage location, it is greatly affected by the operating system. The simplest example is the representation of file paths between Unix and Windows operating systems. Pay attention to the differences in specific configurations and select an appropriate configuration method.
Third, the division of labor is different. In actual work, I found that many administrators, especially those who first came into contact with Oracle database management personnel (such as switching from SQLServer to Oracle), had a misunderstanding in this regard. OMF is used to manage data files automatically. However, this automatic data file management does not mean managing its capacity. That is to say, OMF hosted files only involve the storage path of data files and the naming of data files. It has nothing to do with storage management. More precisely, it only involves a small part of storage management. Storage Management covers the storage path, storage name, storage capacity, I/O, and other issues in a large scope. While OMF-hosted files only involve the storage path and storage name, OMF involves the storage capacity, I/O and other content. So there is a significant difference between the two features. The two are labor division and cooperation, complementing each other. Therefore, in practice, these two functions must be implemented at the same time to achieve the best effect.