ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Moving ASM Database Files from one Diskgroup to Another

Moving ASM Database Files from one Diskgroup to Another

原创 Linux操作系统 作者:hjianping 时间:2011-05-05 22:54:51 0 删除 编辑

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/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-04-24

  • 博文量
    80
  • 访问量
    72822