오라클 diskgroup 이름 을 변경하는 것에 대해 알아보자
1. dg umount
2. renamedg
3. dg mount
4. srv config
5. file rename
==================================
1. dg umount
create pfile from spfile;
@crs_user
crsctl stat res -t
srvctl stop database -d orcl
sqlplus / as sysasm
alter diskgroup OLD_DG dismount;
2. renamedg
renamedg dgname=old_dg newdgname=new_dg verbose=true check=true asm_diskstring='/dev/..'
renamedg dgname=old_dg newdgname=new_dg verbose=true asm_diskstring='/dev/..'
3. dg mount
alter diskgroup NEW_DG mount restricted;
alter diskgroup NEW_DG rename disks all;
alter diskgroup NEW_DG dismount;
alter diskgroup NEW_DG mount;
asmcmd lsdg
4. srv config
crsctl stat res -t
srvctl config database -d orcl
srvctl modify database -d orcl -a NEW_DG
srvctl modify database -d orcl -spfile +NEW_DG/spfileORCL.ora
srvctl remove diskgroup -g OLD_DG
startup nomount pfile='orahome/initORCL.ora'
alter database mount;
5. file rename
-- datafile
SELECT 'ALTER DATABASE RENAME FILE '''||NAME||''' TO '''||'+NEW_DG'||SUBSTR(NAME,9)||''';' STMT
FROM V$DATAFILE
;
-- logfile
SELECT 'ALTER DATABASE RENAME FILE '''||NAME||''' TO '''||'+NEW_DG'||SUBSTR(NAME,9)||''';' STMT
FROM V$LOGFILE
;
alter database open;
create spfile from pfile;
shutdown immediate;
startup
'생계 > Oracle' 카테고리의 다른 글
[OEL] 오라클 19c single ASM 설치 (0) | 2022.12.28 |
---|---|
[ASM] 스크립트 로 database 수동 생성 (0) | 2022.12.22 |
ASM 사용중 datafile 을 다른 diskgroup 으로 이동 (0) | 2022.12.21 |
계층형 쿼리 start with connect 실행 순서 (0) | 2022.09.10 |
트리거 안쓰는 이유 (0) | 2022.08.30 |