Oracle's OMF full name "Oracle managed File", refer to the Oracle Official document "Using oracle-managed Files" (http://download.oracle.com/ docs/cd/b19306_01/server.102/b14231/omf.htm#admin003). The evaluation of this feature that embodies the evolution of Oracle Automation is mixed. Let's not discuss whether it is recommended to introduce this technology into a production system, and we'll take a look at the fun that this technology brings to us.
1. Verify that the OMF feature is enabled on the system
The ability to enable OMF for an Oracle database can be obtained by looking at the Db_create_file_dest parameter.
When the Db_create_file_dest parameter value is empty, the OMF feature is not enabled.
[Email protected]> show parameter db_create_file_destname TYPE VALUE----------------------------------- ------------------------db_create_file_dest string
2. Turn on the OMF feature
Make it effective by modifying the database parameters. Many methods, adjust according to personal preference (pfile adjustment method, alter system adjustment parameters).
[Email protected]> alter system set db_create_file_dest= '/oracle/oradata '; System altered. [Email protected]> show parameter db_create_file_destname TYPE VALUE----------------------------------- ------------------------db_create_file_dest string /oracle/oradata
3. Create a tablespace using the OMF feature
[Email protected]> create tablespace tbs_secooler; Tablespace created.
4. data File storage location
At this point, Oracle creates a directory under the/oracle/oradata directory with the uppercase name of the DB instance (this is ora10g), and the data file for the tablespace is stored in the DataFile directory.
[Email protected]>!ls-l/oracle/oradata/ora10g/datafiletotal 102512-rw-r-----1 Oracle Oinstall 104865792 Jul 15 05:5 9 o1_mf_tbs_seco_63x8xzvw_.dbf
5. Default properties for Tablespace
[Email protected]> Select DBMS_METADATA.GET_DDL (' tablespace ', ' Tbs_secooler ') from Dual;dbms_metadata. GET_DDL (' tablespace ', ' Tbs_secooler ')--------------------------------------------------------------------- CREATE tablespace "Tbs_secooler" datafile '/oracle/oradata/ora10g/datafile/o1_mf_tbs_seco_63x8xzvw_.dbf ' SIZE 104857600 autoextend on NEXT 104857600 MAXSIZE 32767M LOGGING ONLINE PERMANENT BLOCKSIZE 8192 EXTENT MANAGEMENT LOCAL autoallocate SEGMENT SPACE MANAGEMENT AUTO
As you can see, table spaces created by OMF are 100M in size by default and are automatically expanded.
6. Adding data files
You can simply add a data file to the Tablespace Tbs_secooler with the following command
[Email protected]> alter tablespace tbs_secooler add datafile; Tablespace altered. [Email protected]> Select DBMS_METADATA.GET_DDL (' tablespace ', ' Tbs_secooler ') from Dual;dbms_metadata. GET_DDL (' tablespace ', ' Tbs_secooler ')--------------------------------------------------------------------- CREATE tablespace "Tbs_secooler" datafile '/oracle/oradata/ora10g/datafile/o1_mf_tbs_seco_63x8xzvw_.dbf ' SIZE 104857600 autoextend on NEXT 104857600 MAXSIZE 32767M, '/oracle/oradata/ora10g/datafile/o1_mf_tbs_seco_63x9scb5_.dbf ' SIZE 104857600 autoextend on NEXT 104857600 MAXSIZE 32767M LOGGING ONLINE PERMANENT BLOCKSIZE 8192 EXTENT MANAGEMENT LO CAL autoallocate SEGMENT SPACE MANAGEMENT auto[email protected]>!ls-l/oracle/oradata/ora10g/datafiletotal 205024- RW-R-----1 Oracle oinstall 104865792 Jul 05:59 o1_mf_tbs_seco_63x8xzvw_.dbf-rw-r-----1 Oracle oinstall 104865792 Jul 06:14 o1_mf_tbs_seco_63x9scb5_.dbf
7. Deleting a tablespace data file will be deleted
[Email protected]> drop tablespace tbs_secooler; Tablespace dropped. [Email protected]>!ls-l/oracle/oradata/ora10g/datafiletotal 0
This feature once cheered people up.
8. Summary
The OMF features of Oracle are rarely used on a large scale. Many reasons, the individual think that OMF, although the operation of a little convenience, but it hides some necessary details, and the table space name and data file name is difficult to quickly establish a corresponding relationship, for the later management brought great inconvenience. This technology can be used as appropriate in the actual environment.
Good luck.
--The End--
Using the OMF feature