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
阅读(748) | 评论(0) | 转发(0) |