Rename none system / undo datafile
datafile文件改名
更好的rename file的方式应该是
1。把tablespace 改成read only ;
2。在操作系统改名/COPY/MOVE
3。alter database datafile .. offline ;
4. alter database rename file .. to ..
5. alter database datafile .. online ;
6. alter tablespace read write
代码:--------------------------------------------------------------------------------
sys@mescp> select file_name,file_id
2 from dba_data_files
3 where tablespace_name = 'INDX'
4 /
FILE_NAME
--------------------------------------------------------------------------------
FILE_ID
----------
/orabin/oradata/mescp/indx01.dbf
5
/orabin/oradata/mescp/indx02.dbf
12
sys@mescp> alter tablespace indx read only ;
Tablespace altered.
sys@mescp>
sys@mescp> alter database datafile 12 offline ;
Database altered.
sys@mescp> host cp /orabin/oradata/mescp/indx02.dbf /orabin/oradata/mescp/indx03.dbf
sys@mescp> alter database rename file '/orabin/oradata/mescp/indx02.dbf' to '/or
abin/oradata/mescp/indx03.dbf'
2 ;
Database altered.
sys@mescp> alter database datafile 12 online ;
Database altered.
sys@mescp> alter tablespace indx read write ;
Tablespace altered.
sys@mescp> select file_name,file_id
2 from dba_data_files
3 where tablespace_name = 'INDX'
4 /
FILE_NAME
--------------------------------------------------------------------------------
FILE_ID
----------
/orabin/oradata/mescp/indx01.dbf
5
/orabin/oradata/mescp/indx03.dbf
12
2 rows selected.
sys@mescp> archive log list
Database log mode No Archive Mode
Automatic archival &nb
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/784441/viewspace-681329/,如需转载,请注明出处,否则将追究法律责任。