OMF (Oracle Managed Files) Usage for Datafiles [ID 137482.1]
PURPOSE
This document explains the usage of Oracle Managed Files (OMF files) under
different configurations.
SCOPE & APPLICATION
Users of Oracle Managed Files.
OMF (Oracle Managed Files) Usage for Datafiles:
===============================================
You decide to manage your datafiles with OMF.
*** *************************************************
*** Homogeneous Test : tablespace with OMF files only
*** *************************************************
1. In init.ora:
DB_CREATE_FILE_DEST=/oradata/V900SUP
2. Create a tablespace using the OMF syntax:
SQL> create tablespace omf_domi datafile size 100k;
Tablespace created.
SQL> select name from v$datafile;
NAME
------------------------------------------
...
/oradata/V900SUP/ora_omf_domi_xcpsj3tv.dbf
3. Add a datafile to the tablespace using the OMF syntax:
SQL> select name from v$datafile;
NAME
------------------------------------------
...
/oradata/V900SUP/ora_omf_domi_xcpsj3tv.dbf
/oradata/V900SUP/ora_omf_domi_xcpspo63.dbf
SQL> alter tablespace omf_domi add datafile '/oradata/V900SUP/ora_do03.dbf'
2 size 100k;
alter tablespace omf_domi add datafile '/oradata/V900SUP/ora_do03.dbf'
*
ERROR at line 1:
ORA-01276: Cannot add a file with an Oracle Managed Files file name.
4. Add another datafile naming it explicitly:
SQL> alter tablespace omf_domi add datafile '/oradata/V900SUP/do03.dbf';
Tablespace altered.
!!! Be cautious: it is strongly recommended NOT to explicitly name the OMF
!!! files. It is likely not to work in the future.
5. Drop the tablespace and check that all datafiles are removed on the
operating system:
SQL> drop tablespace omf_domi;
Tablespace dropped.
SQL> select name from v$datafile where name like 'ora_omf%';
no rows selected.
In alert.log file:
Deleted Oracle managed file /oradata/V900SUP/ora_omf_domi_xcpsj3tv.dbf
Deleted Oracle managed file /oradata/V900SUP/ora_omf_domi_xcpspo63.dbf
Fri Mar 23 16:09:36 2001
Completed: drop tablespace omf_domi
$ ls -l /oradata/V900SUP/ora_omf*
/oradata/V900SUP/ora_omf*: No such file or directory
$ ls -l /oradata/V900SUP
-rw-r----- 1 ora901 dba 114688 juin 15 11:30 do03.dbf
*** ***********************************************************************
*** Homogeneous test : tablespace with OMF located in different directories
*** ***********************************************************************
SQL> create tablespace omf_domi;
Tablespace created.
SQL> alter system set db_create_file_dest='/oradata/V900SUP/TEST';
System altered.
SQL> alter tablespace omf_domi add datafile;
Tablespace altered.
SQL> select name from v$datafile;
NAME
-----------------------------------------------
...
/oradata/V900SUP/ora_omf_domi_xcpvst5q.dbf
/oradata/V900SUP/TEST/ora_omf_domi_xcpvxk0l.dbf
SQL> drop tablespace omf_domi;
Tablespace dropped.
In alert log file:
Fri Mar 23 16:46:29 2001
Deleted Oracle managed file /oradata/V900SUP/ora_omf_domi_xcpvst5q.dbf
Deleted Oracle managed file /oradata/V900SUP/TEST/ora_omf_domi_xcpvxk0l.dbf
$ ls -l /oradata/V900SUP/ora_omf*
/oradata/V900SUP/ora_omf*: No such file or directory
$ ls -l /oradata/V900SUP/TEST/ora_omf*
/oradata/V900SUP/TEST/ora_omf*: No such file or directory
All OMF have been correctly removed on the OS.
*** **********************************************************************
*** Heterogeneous test: OMF and non-OMF datafiles within the same database
*** **********************************************************************
1. You leave in the init.ora the DB_CREATE_FILE_DEST parameter.
You create a new tablespace with datafiles located in another directory than
the OMF directory:
SQL> create tablespace omf_domi datafile
2 '/ora/ora9i/admin/V900SUP/bdump/omf_domi01.dbf' size 100k;
Tablespace created.
2. Drop the tablespace and check that the datafile is still remaining on the
operating system.
SQL> drop tablespace omf_domi;
Tablespace dropped.
$ ls /ora/ora9i/admin/V900SUP/bdump
omf_domi01.dbf
*** *************************************************************
*** Heterogeneous test: tablespace with OMF and non-OMF datafiles
*** *************************************************************
SQL> create tablespace omf_domi datafile size 100k;
Tablespace created.
SQL> alter tablespace omf_domi
2 add datafile '/ora/ora9i/admin/V900SUP/bdump/omf_domi02.dbf'
3 size 100k;
Tablespace altered.
SQL> drop tablespace omf_domi;
Tablespace dropped.
$ ls /oradata/V900SUP
=> no more files
$ ls /ora/ora9i/admin/V900SUP/bdump/omf*
/ora/ora9i/admin/V900SUP/bdump/omf_domi02.dbf
It is preferrable in this case to use the following command that drops the
tablespace and related datafiles (OMF and non-OMF):
SQL> drop tablespace omf_domi including contents and datafiles;
Tablespace dropped.
In the alert.log you will see:
drop tablespace omf_domi including contents and datafiles
Thu Mar 29 17:09:22 2001
Deleted Oracle managed file /ora/ora9i/admin/V900SUP/bdump/omf_domi01.dbf
Deleted file /ora/ora9i/admin/V900SUP/bdump/omf_domi02.dbf
Completed: drop tablespace omf_domi including contents and datafiles
Explanation:
============
In RDBMS version 9.0.1, we identify OMF files when they are located in the
DB_CREATE_FILE_DEST directory and if the name respects the 'ora_' prefix
and the '.dbf' extension.
Only datafiles created in the DB_CREATE_FILE_DEST directory are automatically
removed from the operating system when dropping a tablespace without the
INCLUDING CONTENTS AND DATAFILES clause. Even if the value of
DB_CREATE_FILE_DEST has changed, the different locations of OMF files are taken
into account.
!!! Please Note:
!!! Be cautious: it is strongly recommended not to explicitly name the OMF
!!! files. It will probably not work successfully in the future.
IMPORTANT NOTE:
===============
Beginning in 9.0.1.2, the naming conventions for OMF files have changed. Please
reference Note: 159888.1 for details of the changes.
Search Words:
=============
ORA-1276
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/94384/viewspace-1029698/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 4.3.2.2.2 Oracle Managed FilesOracle
- 【OMF】使用Oracle的OMF 特性Oracle
- 非OMF管理 自動新增資料檔案add_datafiles.sh
- oracle OMF的使用Oracle
- Oracle 12C Database File Mapping for Oracle ASM FilesOracleDatabaseAPPASM
- ORACLE 控制檔案(Control Files)概述Oracle
- Oracle 21C管理Voting FilesOracle
- 4.3.4.1 在不使用Oracle OMF的情況下建立CDBOracle
- oracle 19c建立非OMF檔案命名格式的PDBOracle
- 更改oracle 預設db_files 200(ORA-00059: maximum number of DB_FILESOracle
- dnsjava usageDNSJava
- Oracle 最新PSU (Doc ID 2118136.2)Oracle
- crontab usage guideGUIIDE
- Oracle OCP(13):GROUPING & GROUPING_ID & GROUP_ID & GROUPING SETSOracle
- Oracle叢集軟體管理-OCR和Voting Files管理Oracle
- Migration Of An Oracle Database Across OS Platforms [ID 733205.1]OracleDatabaseROSPlatform
- Oracle 下載最新psu (Doc ID 2118136.2)Oracle
- error: externally-managed-environmentError
- MySQL, Incorrect usage of UNION and ORDER BYMySql
- SAP QM Auto Usage Decision
- Inspection Points: Key settings and Usage
- 4.3.4.2 使用OMF 件建立CDB:示例
- ORACLE RAC ASM資料檔案遷移OMF檔案報錯ORA-01276解決OracleASM
- Upload Files
- 2.5.8 指定OMF方式建立資料庫資料庫
- managed-schema 檔案詳解
- Error: Connection activation failed: Device not managed by NetworkManagerErrorAIdev
- 從Oracle的SQL_ID到PG14引入核心的QUERY_IDOracleSQL
- Paths和Files
- ffmpeg Preset files
- Java NIO filesJava
- [20191204]oracle能建立最大object_id是多少.txtOracleObject
- Oracle SQL_ID轉換成SQL_HASH_VALUEOracleSQL
- oracle11g: Scheduler Maintenance Tasks or Autotasks (Doc ID 756734.1)OracleAINaN
- 【DBA】Relinking Oracle Home 常見問題 (Doc ID 2048232.1)Oracle
- How To Replicate Data from Oracle to Postgres Using GoldenGate (Doc ID 1544137.1OracleGo
- IDEA中Usage提示功能設定Idea
- Oracle11g新增檢視查詢表空間使用率DBA_TABLESPACE_USAGE_METRICSOracle
- C# split big file into small files as, and merge the small files into big oneC#