DROP TABLESPACE时数据文件是否会自动删除
来源:互联网 发布:极路由隐藏网络 编辑:程序博客网 时间:2024/06/05 01:52
http://space.itpub.net/40239/viewspace-365948
OMF和非OMF管理的数据文件在DROP TABLESPACE时是否会自动删除,做了测试:
SQL> alter system set db_create_file_dest='/oradata/data/standby' scope=both;
System altered.
SQL> show parameter db_create
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_create_file_dest string /oradata/data/standby
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
SQL> create tablespace t3 datafile size 10m;
Tablespace created.
SQL> select * from v$tablespace;
TS# NAME INC
---------- ------------------------------ ---
0 SYSTEM YES
1 UNDOTBS1 YES
2 TEMP YES
3 INDX YES
4 USR YES
5 KONG YES
6 TEST YES
9 T1 YES
8 LOGMNRTS YES
10 T2 YES
11 T3 YES
11 rows selected.
SQL> select name from v$datafile
2 where ts# = 11;
NAME
--------------------------------------------------------------------------------
/oradata/data/standby/o1_mf_t3_464smo7s_.dbf
SQL> create table t100 (id int) tablespace t3;
Table created.
SQL> drop tablespace t3;
drop tablespace t3
*
ERROR at line 1:
ORA-01549: tablespace not empty, use INCLUDING CONTENTS option
SQL> drop tablespace t3 including contents
2 ;
Tablespace dropped.
SQL> !ls -l /oradata/data/standby/o1_mf_t3_464smo7s_.dbf
ls: 0653-341 The file /oradata/data/standby/o1_mf_t3_464smo7s_.dbf does not exist.
看到在DROP TABLESPACE时,就算没有加上 and datafiles是选项,ORACLE也会自动删除数据文件;
SQL> create tablespace t3 datafile '/oradata/data/standby/data/t3.dbf' size 10m;
Tablespace created.
SQL> create table t100 (a int) tablespace t3;
Table created.
SQL> drop tablespace t3 ;
drop tablespace t3
*
ERROR at line 1:
ORA-01549: tablespace not empty, use INCLUDING CONTENTS option
SQL> drop tablespace t3 including contents;
Tablespace dropped.
SQL> !ls -l /oradata/data/standby/data/t3.dbf
-rw-r----- 1 oracle dba 10493952 Jun 25 23:42 /oradata/data/standby/data/t3.dbf
没有加上and datafiles参数时,oracle不会自动删除datafiles。
SQL> create tablespace t3 datafile '/oradata/data/standby/data/t4.dbf' size 10m;
Tablespace created.
SQL> create table t100 (a int) tablespace t3;
Table created.
SQL> drop tablespace t3 including contents and datafiles;
Tablespace dropped.
SQL> !ls -l /oradata/data/standby/data/t4.dbf
ls: 0653-341 The file /oradata/data/standby/data/t4.dbf does not exist.
加上and datafiles参数时,oracle会自动删除datafiles。
SQL> alter system set db_create_file_dest='' scope=both;
System altered.
SQL> create tablespace t3 datafile '/oradata/data/standby/data/t4.dbf' size 10m;
Tablespace created.
SQL> create table t100 (a int) tablespace t3;
Table created.
SQL> drop tablespace t3 including contents and datafiles;
Tablespace dropped.
SQL> !ls -l /oradata/data/standby/data/t4.dbf
ls: 0653-341 The file /oradata/data/standby/data/t4.dbf does not exist.
SQL>
- DROP TABLESPACE时数据文件是否会自动删除
- DROP TABLESPACE时数据文件是否会自动删除
- 非归档,os层面删除ogg数据文件后drop tablespace
- drop tablespace XXX including contents and datafiles cascade constraints数据文件无法删除
- 删除数据库关键数据文件后实例是否会崩溃
- oracle 删除表空间(tablespace)及数据文件的方法
- 查看数据文件是否自动扩展
- 设置maxsize的自动扩展数据文件在达到maxsize后是否会继续扩展
- DROP TABLESPACE相关内容
- drop tablespace ORA-02429
- 删除ORACLE的临时表空间报错:ORA-12906: cannot drop default temporary tablespace
- ORACLE删除表空间:DROP TABLESPACE TESTFAN1 [INCLUDING CONTENTS][CASCADE CONSTRAINTS]
- c++: 是否会自动delete?
- postgres drop table后会删除物理文件
- SQLServer DROP 和 TRUNCATE Table 时数据文件无变化
- 数据文件坏删除数据文件
- 数据文件坏删除数据文件
- 删除数据文件
- dos shell for的使用例子
- Socket I/O模型
- 北大青鸟oracle学习笔记12
- ASP.NET 地址栏参数加密
- Hibernate 开发指南 学习笔记
- DROP TABLESPACE时数据文件是否会自动删除
- HTTP 错误 500.19 - Internal Server Error
- 那些计算机界的伟大女性
- Kerberos 5原理解析
- HTTP 错误 500.19 - Internal Server Error
- 第二版
- 一定要争气
- RedHat5.3 升级内核到2.6.33 版本
- 2010年的一些指导思路