Oracle OMF管理数据文件

1、什么是OMF?

Oracle managed file的缩写,简单的理解,就是oracle自己管理自己的文件,可以是dbf,redolog 等等,具体可以参考官方文档Adiministrator中的17.Using Oracle Managed Files

2、如何查看当前系统是否使用了OMF?

show parameter db_create;

参数的值是空的,说明我们没有使用OMF。

3、开启OMF

alter system set db_create_file_dest='/oracle/db_file';

 4、使用OMF创建表空间和添加数据文件测试测试。

create tablespace test datafile size 1M autoextend off;
select tablespace_name,file_name,bytes/1024/1024 M from dba_data_files where tablespace_name='TEST';

alter tablespace TEST add datafile size 1M autoextend off;
select tablespace_name,file_name,bytes/1024/1024 M from dba_data_files where tablespace_name='TEST';

可见OMF会在db_create_file_dest参数指定的路径下,在<db_name>/datafile/中创建对应的数据文件,文件名是oracle自己定义的。

如果db_create_file的参数为“+DGDATA” 这样的,将数据文件指定到磁盘组的话,那么相应的子目录和文件名由ASM创建,案例和截图日后更新。

5、使用OMF的数据库也可以按照正常的方式添加数据文件。

alter tablespace TEST add datafile '/oracle/db_file/NATHONDB/datafile/test03.dbf' size 1M;
select tablespace_name,file_name,bytes/1024/1024 M from dba_data_files where tablespace_name='TEST';

猜你喜欢

转载自www.cnblogs.com/nathon-wang/p/10298200.html