SQL>alter tablespace system offline;
SQL> SELECT TABLESPACE_NAME,STATUS FROM DBA_TABLESPACES WHERE TABLESPACE_NAME='DATA';
TABLESPACE_NAME STATUS
------------------------------ ---------
DATA OFFLINE
SQL> select file_name ,tablespace_name from dba_data_files
2 where tablespace_name='DATA';
FILE_NAME TABLESPACE_NAME
-------------------------------------------------------------------------------- ------------------------------
D:\ORACLE\PRODUCT\10.1.0\ORADATA\DB\DATA01.DBF DATA
SQL> SELECT FILE#,STATUS,NAME FROM V$DATAFILE WHERE NAME IN (SELECT FILE_NAME FROM DBA_DATA_FILES WHERE TABLESPACE_NAME='DATA');
FILE# STATUS NAME
---------- ------- --------------------------------------------------------------------------------
9 OFFLINE D:\ORACLE\PRODUCT\10.1.0\ORADATA\DB\DATA01.DBF
说明tablespace状态设置为offline状态其相应的datafile也变为offline.
SQL> alter tablespace DATA ONLINE;
Tablespace altered
但是反过来datafile改变为offline状态,其对应的tablespace的状态不会改变!
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/13387766/viewspace-366237/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/13387766/viewspace-366237/