Oracle

[Oracle] Diskgroup rename

bbugge 2024. 6. 11. 19:05

 

$ srvctl stop database -d ORADB

 

# +OLD_DG diskgroup이 offline 상태 확인

$ crsctl stat res -t

$ renamedg dgname=OLD_DG newdgname=NEW_DG verbose=true asm_diskstring=/dev/oracleasm/disks/ASMDISK*

// asm_diskstring=' /dev/oracleasm/disks/ASMDISK01, /dev/oracleasm/disks/ASMDISK02...'

 

# +NEW_DG diskgroup mount

$ asmcmd mount NEW_DG

$ asmcmd lsdg

 

# modify database parameter file OLD_DG -> NEW_DG

$ vi pfileORADB.ora

 

# alter database modify

$ srvctl modify database -d ORADB -a NEW_DG

# change spfile location

$ srvctl modify database -d ORADB -spfile <spfile_loc>

$ srvctl config database -d ORADB

 

# ORADB startup mount

SQL> startup mount;

 

# Datafile,Tempfile rename

SQL> alter database rename file '+OLD_DG/...' to '+NEW_DG';

 

# logfile rename

SQL> alter database rename file '+OLD_DG/...' to '+NEW_DG';

 

SQL> alter database open;