文章出处:http://blog.chinaunix.net/uid-7819458-id-2043175.html
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.
在OMF出来之前,DBA必须Oracle数据文件目录与数据文件大小,SQL如下:
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 ; 创建表空间语句如下:create tablespace users_02 add 'c:\oracle\oradata\diogenes\users02.dbf' size 20m ;
必须满足三个条件,如下:
- The proper file location
- The proper filename
- The proper file size
- 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.
使用OMF时的一些数据格式如下:
u% is a unique 8 digit code, g% is the logfile group number, %t is the tablespace name: Controlfiles ora_%u.ctl Redo Log Files ora_%g_%u.log Datafiles ora_%t_%u.dbf Temporary Datafiles ora_%t_%u.tmp使用OMF,创建表空间,语句可简化如下:
SQL> create tablespace new_ts;
如想改变创建默认路径,可如下操作:
alter system set db_create_file_dest=’c:\oracle\oradata\diogenes\;
改变redo log的创建路径方法如下:
改变db_create_online_log_dest_*
db_create_online_log_dest_1 = ‘/u01/oracle/oradata/diogenes’