OMF管理的文件会自动删除

有一点经验的DBA都会记得,drop tablespace的时候,如果没有带including contents and datafiles的字句,数据文件是不会被删除的,上周周日演示,drop tablespace时,数据文件被自动删除了,当时我给的解释是,文件是空的,没有使用过,才会出现这种情况,翻回文档才发现,其实是因为,该文件是OMF的。

[oracle@nobody admin]$ rlwrap sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Mon Jun 24 05:44:20 2013

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

nobody@TESTDB>show parameter create;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
create_bitmap_area_size              integer     8388608
create_stored_outlines               string
db_create_file_dest                  string      +DATA
db_create_online_log_dest_1          string
db_create_online_log_dest_2          string
db_create_online_log_dest_3          string
db_create_online_log_dest_4          string
db_create_online_log_dest_5          string
nobody@TESTDB>alter system set db_create_file_dest='/u01/app/oracle/oradata/testdb';

System altered.

nobody@TESTDB>create tablespace omf_tbs datafile size 10m;

Tablespace created.

nobody@TESTDB>create tablespace no_omf_tbs datafile '/u01/app/oracle/oradata/testdb/no_omf_tbs01.dbf' size 10m;

Tablespace created.

nobody@TESTDB>select d.name from v$datafile d, v$tablespace t where d.ts# = t.ts# and t.name in ('OMF_TBS','NO_OMF_TBS');

NAME
--------------------------------------------------------------------------------------------------------------------------------------------
/u01/app/oracle/oradata/testdb/HUA01/datafile/o1_mf_omf_tbs_8wgv3shj_.dbf
/u01/app/oracle/oradata/testdb/no_omf_tbs01.dbf

nobody@TESTDB>host ls -l /u01/app/oracle/oradata/testdb/HUA01/datafile/o1_mf_omf_tbs_8wgv3shj_.dbf
-rw-r----- 1 oracle asmadmin 10493952 Jun 24 05:45 /u01/app/oracle/oradata/testdb/HUA01/datafile/o1_mf_omf_tbs_8wgv3shj_.dbf

nobody@TESTDB>host ls -l /u01/app/oracle/oradata/testdb/no_omf_tbs01.dbf
-rw-r----- 1 oracle asmadmin 10493952 Jun 24 05:45 /u01/app/oracle/oradata/testdb/no_omf_tbs01.dbf

nobody@TESTDB>drop tablespace omf_tbs;

Tablespace dropped.

nobody@TESTDB>host ls -l /u01/app/oracle/oradata/testdb/HUA01/datafile/o1_mf_omf_tbs_8wgv3shj_.dbf
ls: /u01/app/oracle/oradata/testdb/HUA01/datafile/o1_mf_omf_tbs_8wgv3shj_.dbf: No such file or directory

nobody@TESTDB>drop tablespace no_omf_tbs;

Tablespace dropped.

nobody@TESTDB>host ls -l /u01/app/oracle/oradata/testdb/no_omf_tbs01.dbf
-rw-r----- 1 oracle asmadmin 10493952 Jun 24 06:14 /u01/app/oracle/oradata/testdb/no_omf_tbs01.dbf
Performance Tuning Guide 中对于 OMF 的描述中对此有解析。

When file systems can contain all Oracle Database data, database administration is simplified by using Oracle Managed Files. Oracle Database internally uses standard file system interfaces to create and delete files as needed for tablespaces, temp files, online logs, and control files. Administrators only specify the file system directory to be used for a particular type of file. You can specify one default location for data files and up to five multiplexed locations for the control and online redo log files. Oracle Database ensures that a unique file is created and then deleted when it is no longer needed. This reduces corruption caused by administrators specifying the wrong file, reduces wasted disk space consumed by obsolete files, and simplifies creation of test and development databases.


转载于:https://my.oschina.net/huayd/blog/140091

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值