2,将asm上的datafile移动到普通的filesystem上[oracle@asm ~]$ rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Sat Feb 2 08:00:19 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database (not started)
RMAN> startup
Oracle instance started
database mounted
database opened
Total System Global Area 839282688 bytes
Fixed Size 2217992 bytes
Variable Size 549455864 bytes
Database Buffers 285212672 bytes
Redo Buffers 2396160 bytes
RMAN> report schema;
using target database control file instead of recovery catalog
Report of database schema for database with db_unique_name ASM
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 670 SYSTEM *** +DATA/asm/system01.dbf
2 510 SYSAUX *** +DATA/asm/sysaux01.dbf
3 75 UNDOTBS1 *** +DATA/asm/undotbs01.dbf
4 5 USERS *** +DATA/asm/users01.dbf
5 1 USERS *** +DATA/asm/users02.dbf
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 29 TEMP 32767 +DATA/asm/temp01.dbfbackup该文件到其他的diskgroup上:RMAN> backup as copy datafile '+DATA/asm/users02.dbf' format '+flash'; (可以使用file_id代替文件路径)
Starting backup at 02-FEB-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=50 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=+DATA/asm/users02.dbf
output file name=+FLASH/asm/datafile/users.260.806314045 tag=TAG20130202T080724 RECID=1 STAMP=806314045
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 02-FEB-13offline需要移动的datafileRMAN> sql "alter database datafile ''+DATA/asm/users02.dbf'' offline";
sql statement: alter database datafile ''+DATA/asm/users02.dbf'' offlineswitch该datafile的name到新的diskgroup上RMAN> switch datafile "+DATA/asm/users02.dbf" to copy;
datafile 5 switched to datafile copy "+FLASH/asm/datafile/users.260.806314045"recover已经移动到新diskgroup的文件RMAN> recover datafile "+FLASH/asm/datafile/users.260.806314045";
Starting recover at 02-FEB-13
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:01
Finished recover at 02-FEB-13online移动的datafileRMAN> sql "alter database datafile ''+FLASH/asm/datafile/users.260.806314045'' online";
sql statement: alter database datafile ''+FLASH/asm/datafile/users.260.806314045'' online再次查看文件的路径RMAN> report schema;
Report of database schema for database with db_unique_name ASM
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 680 SYSTEM *** +DATA/asm/system01.dbf
2 510 SYSAUX *** +DATA/asm/sysaux01.dbf
3 75 UNDOTBS1 *** +DATA/asm/undotbs01.dbf
4 5 USERS *** +DATA/asm/users01.dbf
5 1 USERS *** +FLASH/asm/datafile/users.260.806314045
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 29 TEMP 32767 +DATA/asm/temp01.dbf删除以前的文件RMAN> delete datafilecopy '+data/asm/users02.dbf';
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=50 device type=DISK
List of Datafile Copies
=======================
Key File S Completion Time Ckp SCN Ckp Time
------- ---- - --------------- ---------- ---------------
2 5 A 02-FEB-13 1027887 02-FEB-13
Name: +DATA/asm/users02.dbf
Do you really want to delete the above objects (enter YES or NO)? yes
deleted datafile copy
datafile copy file name=+DATA/asm/users02.dbf RECID=2 STAMP=806314150
Deleted 1 objects
做的方法和上面的步骤一样(在做之前确保database为archivelog模式)
RMAN> backup as copy datafile '+DATA/asm/users01.dbf' format '/oradata/user01.dbf';
Starting backup at 02-FEB-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=+DATA/asm/users01.dbf
output file name=/oradata/user01.dbf tag=TAG20130202T082602 RECID=3 STAMP=806315163
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 02-FEB-13
RMAN> sql "alter database datafile 4 offline";
sql statement: alter database datafile 4 offline
RMAN> switch datafile 4 to copy;
datafile 4 switched to datafile copy "/oradata/user01.dbf"
RMAN> recover datafile 4;
Starting recover at 02-FEB-13
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:00
Finished recover at 02-FEB-13
RMAN> sql "alter database datafile 4 online";
sql statement: alter database datafile 4 online
RMAN> report schema;
Report of database schema for database with db_unique_name ASM
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 680 SYSTEM *** +DATA/asm/system01.dbf
2 510 SYSAUX *** +DATA/asm/sysaux01.dbf
3 75 UNDOTBS1 *** +DATA/asm/undotbs01.dbf
4 5 USERS *** /oradata/user01.dbf
5 1 USERS *** +FLASH/asm/datafile/users.260.806314045
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 29 TEMP 32767 +DATA/asm/temp01.dbf
RMAN> delete datafilecopy 4;
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=50 device type=DISK
List of Datafile Copies
=======================
Key File S Completion Time Ckp SCN Ckp Time
------- ---- - --------------- ---------- ---------------
4 4 A 02-FEB-13 1031361 02-FEB-13
Name: +DATA/asm/users01.dbf
Do you really want to delete the above objects (enter YES or NO)? yes
deleted datafile copy
datafile copy file name=+DATA/asm/users01.dbf RECID=4 STAMP=806315204
Deleted 1 objects
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/24237320/viewspace-1060190/ ,如需转载,请注明出处,否则将追究法律责任。