在ORACLE数据库中彻底删除数据文件
2008-12-01 09:13
357 查看
归档模式下:alter database drop datafile 'xxx/xxx.dbf';
非归档模式下 :alter database drop datafile 'xxx/xxx.dbf' offline;
以上命令只是将该数据文件OFFLINE,而不是在数据库中删除数据文件。该数据文件的信息在控制文件种仍存在。
查询v$datafile,仍显示该文件。
要彻底在数据库中删除该数据文件,只有1种方法:删除该数据文件的表空间:drop tablespace tp_xx including contents and datafiles;
--------------------------------------------------------------------
数据文件信息在两个地方保存:控制文件和数据字典,可以在NOMOUNT下重建控制文件(在创建控制文件的脚本中删除该数据文件),但这样无法删除数据字典里的信息,启动数据库后,在v$datafile里仍有这个文件,但名称变成了mising####,文件位置变成了:D:/ORACLE/ORA92/DATABASE/,文件大小变成了0.
官方文档里这样说:
DATAFILE Clauses
The DATAFILE clauses affect your database files as follows:
ONLINE
Specify ONLINE to bring the datafile online.
OFFLINE
Specify OFFLINE to take the datafile offline. If the database is open, you must perform media recovery on the datafile before bringing it back online, because a checkpoint is not performed on the datafile before it is taken offline.
DROP
If the database is in NOARCHIVELOG mode, you must specify the DROP clause to take a datafile offline. However, the DROP clause does not remove the datafile from the database. To do that, you must drop the tablespace in which the datafile resides. Until you do so, the datafile remains in the data dictionary with the status RECOVER or OFFLINE.
If the database is in ARCHIVELOG mode, Oracle ignores the DROP keyword.
相关链接:http://bbs.chinaunix.net/viewthread.php?tid=72633
--------------------------------------------------------------------
备份控制文件到trace中:alter database backup controlfile to trace [ as 'c:/ctl.bak' ];
---------------
相关连接:http://www.itpub.net/showthread.php?s=&threadid=807615
非归档模式下 :alter database drop datafile 'xxx/xxx.dbf' offline;
以上命令只是将该数据文件OFFLINE,而不是在数据库中删除数据文件。该数据文件的信息在控制文件种仍存在。
查询v$datafile,仍显示该文件。
要彻底在数据库中删除该数据文件,只有1种方法:删除该数据文件的表空间:drop tablespace tp_xx including contents and datafiles;
--------------------------------------------------------------------
数据文件信息在两个地方保存:控制文件和数据字典,可以在NOMOUNT下重建控制文件(在创建控制文件的脚本中删除该数据文件),但这样无法删除数据字典里的信息,启动数据库后,在v$datafile里仍有这个文件,但名称变成了mising####,文件位置变成了:D:/ORACLE/ORA92/DATABASE/,文件大小变成了0.
官方文档里这样说:
DATAFILE Clauses
The DATAFILE clauses affect your database files as follows:
ONLINE
Specify ONLINE to bring the datafile online.
OFFLINE
Specify OFFLINE to take the datafile offline. If the database is open, you must perform media recovery on the datafile before bringing it back online, because a checkpoint is not performed on the datafile before it is taken offline.
DROP
If the database is in NOARCHIVELOG mode, you must specify the DROP clause to take a datafile offline. However, the DROP clause does not remove the datafile from the database. To do that, you must drop the tablespace in which the datafile resides. Until you do so, the datafile remains in the data dictionary with the status RECOVER or OFFLINE.
If the database is in ARCHIVELOG mode, Oracle ignores the DROP keyword.
相关链接:http://bbs.chinaunix.net/viewthread.php?tid=72633
--------------------------------------------------------------------
备份控制文件到trace中:alter database backup controlfile to trace [ as 'c:/ctl.bak' ];
---------------
相关连接:http://www.itpub.net/showthread.php?s=&threadid=807615
相关文章推荐
- 如何彻底删除已经不存在的数据文件?
- Oracle数据库数据文件rm -rf误删除后恢复
- oracle彻底删除drop过的数据表(包括物理文件)
- oracle数据库之删除数据文件[物理地删除一个数据文件但它的信息仍然记录在数据字典v$datafile中]
- C# .net 彻底删除DBF文件的物理数据
- 如何彻底删除文件,让文件没办法恢复,保证数据安全?
- bat命令备份oracle数据库,并且删除7天之前的数据文件
- 如何彻底删除已经不存在的数据文件?
- Mysql数据库删除数据后,表文件收缩
- Oracle数据库定时备份并删除旧文件
- 彻底删除MySQL及恢复MySQL数据
- 定时读取一个目录下文本文件数据存入oracle数据库(原创)
- Oracle数据库利用日志挖掘来恢复误删除的数据
- AIX下彻底删除websphere安装文件
- ORACLE数据库表空间迁移--关于数据文件
- 物理删除oracle数据文件(DBF文件)导致数据库ORA-01033的解决方法
- 删除了一个表空间的数据文件
- 本人开发的软件“彻底删除文件(File Delete Absolutely)” 1.03 获“中关村在线”磁盘工具排行榜第6名
- Oracle数据库表空间 数据文件 用户 以及表创建的SQL代码
- oracle数据库的各种数据文件操作