게시글 보기
작성자 유건데이타 등록일 2017-02-25
제목 [10g] rac asm diskgroup rename
아래의 내용은 바꾸는 건 맞는데.....copy의 개념으로 바꾸는 것임을 참고

아래의 내용은 바꾸는 건 맞는데.....copy의 개념으로 바꾸는 것임을 참고

Rename or move ASM datafile to different Diskgroup

Aim: To move datafile 4 to +USER_DATA asm diskgroup:

SQL> select file_id,file_name from dba_data_files;

---------- -------------------------------------------
4 +DATA/testdb/datafile/users.259.123123122
3 +DATA/testdb/datafile/undotbs1.258.123123122
2 +DATA/testdb/datafile/sysaux.257.123123122
1 +DATA/testdb/datafile/system.256.866896397
5 +DATA/testdb/datafile/undotbs2.264.866897005

SQL> select name,free_mb,group_number from v$asm_diskgroup ;

------------------------------ ---------- ------------
DATA 225 1
USER_DATA 4101 2
FRA 3999 3

SQL> ALTER DATABASE DATAFILE '+DATA/testdb/datafile/users.259.123123122' OFFLINE ;

Database altered.

RMAN> COPY DATAFILE '+DATA/testdb/datafile/users.259.123123122' TO '+USER_DATA' ;

Starting backup at 23-DEC-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=57 instance=testdb1 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=+DATA/testdb/datafile/users.259.123123122
output file name=+USER_DATA/testdb/datafile/users.256.654334563 tag=TAG20141223T112114 RECID=1 STAMP=867064896
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:26
Finished backup at 23-DEC-14

SQL> ALTER DATABASE RENAME FILE '+DATA/testdb/datafile/users.259.123123122' TO '+USER_DATA/testdb/datafile/users.256.654334563' ;

Database altered.

SQL> RECOVER DATAFILE '+USER_DATA/testdb/datafile/users.256.654334563' ;

Media recovery complete.

SQL> ALTER DATABASE DATAFILE '+USER_DATA/testdb/datafile/users.256.654334563' online ;

Database altered.

---------- ---------------------------------------------------------------------------------------------------------------
4 +USER_DATA/testdb/datafile/users.256.654334563 AVAILABLE
3 +DATA/testdb/datafile/undotbs1.258.123123122 AVAILABLE
2 +DATA/testdb/datafile/sysaux.257.123123122 AVAILABLE
1 +DATA/testdb/datafile/system.256.866896397 AVAILABLE
5 +DATA/testdb/datafile/undotbs2.264.866897005 AVAILABLE


The steps provided above assume that the database is open and in Archivelog mode.
Besides these steps are not appropriated for system or sysaux datafiles. For System and Sysaux an approach similar to the one given below can be used
as per oracle support metalink :

1. Create a Copy of datafile in target Diskgroup:
RMAN> backup as copy tablespace system format '
RMAN> backup as copy tablespace sysaux format '
2. Then shutdown the database and restart to a mounted state
RMAN> shutdown immediate;
RMAN> startup mount;
3. switch the datafiles to the copy
RMAN> switch tablespace system to copy;
RMAN> switch tablespace sysaux to copy;
4. Recover the changes made to these tablespaces;
RMAN> recover database;

make sure you run RMAN crosscheck copy and delete expired copy to update the controlfile and catalog for
your backups to run without issues
등록된 코멘트가 없습니다.