rman copy asm datafile(rename asm datafile)

maojinyu發表於2011-06-14
1. Using RMAN to copy this datafile to another folder or copy to a new name

RMAN> copy datafile FILE_NUMBER TO '/db/data/abc_new.dbf';
--copy datafile 4 to '/home/oracle/u01/app/oradata/test/USERS01.dbf';

2. Offline the datafile

SQL> ALTER DATABASE datafile FILE_NUMBER offline;
--ALTER DATABASE datafile 4 offline;

3. Using RMAN to rename the datafile

run{
allocate channel ch1 device TYPE disk;
SET NEWNAME FOR datafile 4 TO '/home/oracle/u01/app/oradata/test/USERS01.dbf';
switch datafile ALL;
}

4. Recovering

SQL> recover datafile FILE_NUMBER;
--recover datafile 4;

5. Online datafile

SQL> ALTER DATABASE datafile FILE_NUMBER online;
--ALTER DATABASE datafile 4 online;[@more@]

SQL> alter tablespace users offline;

SQL> host copy D:ORACLEPRODUCT10.2.0ORADATATESTusers02.dbf c:
已複製 1 個檔案。


SQL> alter tablespace users rename datafile 'D:ORACLEPRODUCT10.2.0ORADATATE
STusers02.dbf' to 'c:users02.dbf';

表空間已更改。

SQL> alter tablespace users online;

表空間已更改。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9907339/viewspace-1051156/,如需轉載,請註明出處,否則將追究法律責任。

相關文章