Moving ASM Database Files from one Diskgroup to Another

This article assumes the database is open and in ARCHIVELOG mode:
SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            +DATA1/orasun/
Oldest online log sequence     5
Next log sequence to archive   7
Current log sequence           7


1、Identify the ASM data files to move
SQL> select file_name from dba_data_files;


2、Identify the ASM diskgroup to which the database file will be moved to
SQL> select name from v$asm_diskgroup;


3、Take the ASM data file to be moved OFFLINE
SQL> alter database datafile '+DATA1/orasun/datafile/users.259.729795273' offline;


4、Copy the ASM database file from the source diskgroup to target diskgroup
$ rman target /
RMAN> copy datafile '+DATA1/orasun/datafile/users.259.729795273' to '+FILE_DATA';


5、Rename the ASM database file to point to the new location
SQL> alter database rename file'+DATA1/orasun/datafile/users.259.729795273' to '+FILE_DATA/ORASUN/DATAFILE/USERS.256.729898219';


6、Use RMAN to rename the ASM database file copy
RMAN> switch datafile '+FILE_DATA/ORASUN/DATAFILE/USERS.256.729898219' to copy;


7、Recovery the new ASM database file
SQL> recover datafile '+FILE_DATA/ORASUN/DATAFILE/USERS.256.729898219';


8、Bring the new ASM database file ONLINE
SQL> alter database datafile '+FILE_DATA/ORASUN/DATAFILE/USERS.256.729898219' online;


9、Verify the new ASM data file location
SQL> select file_name from dba_data_files;


10、Delete the old ASM database file from its original location
SQL> alter diskgroup data1 drop file '+DATA1/orasun/datafile/users.259.729795273';

 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/17012874/viewspace-694563/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/17012874/viewspace-694563/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值