OMF 即Oracle Managed Files 下管理的数据文件,如果 原数据文件存在 则会restore 到原数据文件的位置,如果不存在 则会restore到db_create_file_dest 指向的位置,详见如下测试:
restore的优先级如下:
If “SET NEWNAME” is specified, RMAN will use that name for restore.
If the original file exists, RMAN will use the original filename for restore.
If the DB_CREATE_FILE_DEST is set, RMAN will use the diskgroup name specified.
If no DB_CREATE_FILE_DEST is set and the original file does not exist, then RMAN will create another name
for that file in the original disk group. askmaclean.com
注意 只要 一旦使用“DB_CREATE_FILE_DEST有值” restore过数据文件,则 控制文件内容将被”污染” 变成指向新的DB_CREATE_FILE_DEST的文件位置。
SQL> show parameter db_create_file_dest
NAME TYPE
------------------------------------ ----------------------
VALUE
------------------------------
db_create_file_dest string
C:\APP\XIANGBLI\ORADATA
SQL> create tablespace test_omf datafile size 5M;
表空间已创建。
SQL> select name from v$datafile;
NAME
-----------------------------------------------------------------------------
C:\APP\XIANGBLI\ORADATA\MACLEAN\SYSTEM01.DBF
C:\APP\XIANGBLI\ORADATA\MACLEAN\EXAMPLE01.DBF
C:\APP\XIANGBLI\ORADATA\MACLEAN\SYSAUX01.DBF
C:\APP\XIANGBLI\ORADATA\MACLEAN\MACLEAN1.DBF
C:\APP\XIANGBLI\ORADATA\MACLEAN\UNDOTBS01.DBF
C:\APP\XIANGBLI\ORADATA\MACLEAN\USERS01.DBF
C:\APP\XIANGBLI\ORADATA\MACLEAN\IL