oracle 10g R2 drop empty datafile
在oracle 10g以前要是對某個表空間誤加了個資料檔案,想刪除掉這個時候是不行的,通常的做法是offline或者resize 到
一個很小的值,這對我們管理帶來很多不方便, 10g 就可以了,以下是測試驗證過程:
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
SQL> create tablespace test;
Tablespace created.
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\DATAFILE\O1_MF_SYSTEM_422B1M98_.DBF
D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\DATAFILE\O1_MF_UNDOTBS1_422B1MC7_.DBF
D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\DATAFILE\O1_MF_SYSAUX_422B1MFO_.DBF
D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\DATAFILE\O1_MF_USERS_422B1MNZ_.DBF
D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\DATAFILE\O1_MF_TEST_422Q3D0H_.DBF
SQL> alter tablespace test add datafile;
Tablespace altered.
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\DATAFILE\O1_MF_SYSTEM_422B1M98_.DBF
D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\DATAFILE\O1_MF_UNDOTBS1_422B1MC7_.DBF
D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\DATAFILE\O1_MF_SYSAUX_422B1MFO_.DBF
D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\DATAFILE\O1_MF_USERS_422B1MNZ_.DBF
D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\DATAFILE\O1_MF_TEST_422Q3D0H_.DBF
D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\DATAFILE\O1_MF_TEST_422Q4RY8_.DBF
6 rows selected.
SQL> select file_name from dba_data_files;
FILE_NAME
--------------------------------------------------------------------------------
D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\DATAFILE\O1_MF_SYSTEM_422B1M98_.DBF
D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\DATAFILE\O1_MF_UNDOTBS1_422B1MC7_.DBF
D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\DATAFILE\O1_MF_SYSAUX_422B1MFO_.DBF
D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\DATAFILE\O1_MF_USERS_422B1MNZ_.DBF
D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\DATAFILE\O1_MF_TEST_422Q3D0H_.DBF
D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\DATAFILE\O1_MF_TEST_422Q4RY8_.DBF
6 rows selected.
SQL> alter tablespace test drop datafile 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\
DATAFILE\O1_MF_TEST_422Q4RY8_.DBF';
Tablespace altered.
SQL> select file_name from dba_data_files;
FILE_NAME
--------------------------------------------------------------------------------
D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\DATAFILE\O1_MF_SYSTEM_422B1M98_.DBF
D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\DATAFILE\O1_MF_UNDOTBS1_422B1MC7_.DBF
D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\DATAFILE\O1_MF_SYSAUX_422B1MFO_.DBF
D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\DATAFILE\O1_MF_USERS_422B1MNZ_.DBF
D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\DATAFILE\O1_MF_TEST_422Q3D0H_.DBF
SQL>
2.oracle9i 測試
C:\Documents and Settings\Paul Yi>sqlplus "/as sysdba"
SQL*Plus: Release 9.2.0.4.0 - Production on Wed May 7 15:56:30 2008
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
SQL> create tablespace test datafile 'd:\test01.dbf' size 5M;
Tablespace created.
SQL> alter tablespace test add datafile 'd:\test02.dbf' size 5M;
Tablespace altered.
SQL> alter tablespace test drop datafile 'd:\test02.dbf';
alter tablespace test drop datafile 'd:\test02.dbf'
*
ERROR at line 1:
ORA-02142: missing or invalid ALTER TABLESPACE option
SQL>
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7199859/viewspace-262961/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 體驗Oracle 10gR2的drop empty datafileOracle 10g
- 由drop datafile導致的oracle bugOracle
- alter database datafile offline drop 與 alter tablespace drop datafile 區別Database
- Oracle 10g新增DROP DATABASE命令Oracle 10gDatabase
- oracle 10g R2 dataguardOracle 10g
- alter database drop datafile 與 drop tablespace file 的區別Database
- alter database datafile 4 offline drop;Database
- Oracle 10G R2 RAC 日常管理Oracle 10g
- Oracle 10G R2 RAC日常管理Oracle 10g
- oracle 10g R2 autotrace 增強Oracle 10g
- oracle 10g r2 ASM RAC on aixOracle 10gASMAI
- alter database datafile .... offline drop的問題Database
- Oracle datafileOracle
- 【oracle 10g R2 新特性】Asynchronous CommitOracle 10gMIT
- alter database datafile offline drop相關問題Database
- Oracle Data Guard 10g R2概念和理論Oracle
- oracle 10g R2 Block change tracking 新特性Oracle 10gBloC
- ORACLE 10g R2及PATH官方下載地址Oracle 10g
- 【Datafile】Oracle單個datafile大小的限制Oracle
- Oracle 10g R2建立ASM例項Step By Step(一)Oracle 10gASM
- Oracle 10g R2建立ASM例項Step By Step(四)Oracle 10gASM
- Linux (RHEL 5.4)下安裝 Oracle 10g R2LinuxOracle 10g
- Oracle 10g 中誤刪除(drop)表的恢復處理Oracle 10g
- oracle 10g r2新功能可以跨越resetlogs 恢復Oracle 10g
- oracle drop columnsOracle
- 收縮datafile for oracle -- 轉Oracle
- Oracle 10g R2 for RHEL AS4 安裝重點小記Oracle 10g
- Oracle 10g R2新特性之備份和可用性特性Oracle 10g
- oracle 10G R2 RAC 資料庫的關閉與啟動(ZT)Oracle 10g資料庫
- Oracle 10G R2在Linux X86_64下的安裝Oracle 10gLinux
- oracle datafile 與 object的關係OracleObject
- 資料檔案實驗操作datafile的create/offline/drop/rename等操作
- oracle 10g R2 安裝過程遇到的問題及解決方法Oracle 10g
- oracle 10g R2 建立使用者時預設表空間改變Oracle 10g
- 【Oracle】oracle tablespace&datafile -- oracle表空間 分享[轉]Oracle
- Oracle中drop user和drop user cascade的區別Oracle
- How To Drop, Create And Recreate DB Control In A 10g DatabaseDatabase
- 10g R2 RAC 歸檔模式開啟模式