1. Database Relocate 작업
A) 작업 전 확인
root 나 oracle 유저로 수행합니다.
crsctl stat res -t srvctl status database -d racdb
[racdb_1:/home/oracle]> crsctl stat res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.LISTENER.lsnr ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.chad ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.net1.network ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.ons ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup) 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 ONLINE OFFLINE STABLE ora.CRS.dg(ora.asmgroup) 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 OFFLINE OFFLINE STABLE ora.DATA.dg(ora.asmgroup) 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 OFFLINE OFFLINE STABLE ora.FRA.dg(ora.asmgroup) 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 OFFLINE OFFLINE STABLE ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE rac2 STABLE ora.LISTENER_SCAN2.lsnr 1 ONLINE ONLINE rac1 STABLE ora.LISTENER_SCAN3.lsnr 1 ONLINE ONLINE rac1 STABLE ora.MGMT.dg(ora.asmgroup) 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 OFFLINE OFFLINE STABLE ora.MGMTLSNR 1 ONLINE ONLINE rac1 169.254.25.67 10.0.5 .101,STABLE ora.asm(ora.asmgroup) 1 ONLINE ONLINE rac1 Started,STABLE 2 ONLINE ONLINE rac2 Started,STABLE 3 OFFLINE OFFLINE STABLE ora.asmnet1.asmnetwork(ora.asmgroup) 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 OFFLINE OFFLINE STABLE ora.cvu 1 ONLINE ONLINE rac1 STABLE ora.mgmtdb 1 ONLINE ONLINE rac1 Open,STABLE ora.qosmserver 1 ONLINE ONLINE rac1 STABLE ora.rac1.vip 1 ONLINE ONLINE rac1 STABLE ora.rac2.vip 1 ONLINE ONLINE rac2 STABLE ora.racdb.db 1 ONLINE ONLINE rac1 Open,HOME=/u01/app/o racle/product/19.3.0 /db_1,STABLE ora.racdb.rac.svc 1 ONLINE ONLINE rac1 STABLE ora.scan1.vip 1 ONLINE ONLINE rac2 STABLE ora.scan2.vip 1 ONLINE ONLINE rac1 STABLE ora.scan3.vip 1 ONLINE ONLINE rac1 STABLE -------------------------------------------------------------------------------- [racdb_1:/home/oracle]> srvctl status database -d racdb racdb_1 인스턴스가 rac1 노드에서 실행 중임 온라인 재배치: INACTIVE
One Node RAC는 클러스터 내에서 단 하나의 인스턴스만 가동되는 형태로 운영됩니다.
여러가지 이유로 가동 중인 데이터베이스를 다른 서버로 재배치할 수 있습니다.
1번 노드에서 Open된 데이터베이스를 2번 노드로 재배치하는 작업을 진행합니다.
B) 2번 노드로 Relocate
root 나 oracle 유저로 수행합니다.
srvctl relocate database -d racdb -n rac2 -w 5 -v
[racdb_1:/home/oracle]> srvctl relocate database -d racdb -n rac2 -w 5 -v 두 개의 인스턴스에 대한 구성이 업데이트되었습니다. racdb_2 인스턴스가 시작되었습니다. 서비스가 재배치되었습니다. 최대 5분 동안 racdb_1 인스턴스가 정지되기를 기다리는 중... racdb_1 인스턴스가 정지되었습니다. 하나의 인스턴스에 대한 구성이 업데이트되었습니다.
srvctl 명령어의 relocate 옵션을 사용해서 racdb를 2번 노드로 재배치합니다.
재배치하는 과정을 상세히 보기 위해 v 옵션(verbose)을 사용하였습니다.
C) 2번 노드 Relocate 결과 확인
root 나 oracle 유저로 수행합니다.
srvctl status database -d racdb crsctl stat res -t
Relocate 작업 중이면 다음과 같이 출력됩니다.
[racdb_2:/home/oracle]> srvctl status database -d racdb racdb_1 인스턴스가 rac1 노드에서 실행 중임 온라인 재배치: ACTIVE 소스 인스턴스: rac1의 racdb_1 대상 인스턴스: rac2의 racdb_2 [racdb_2:/home/oracle]> crsctl stat res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.LISTENER.lsnr ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.chad ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.net1.network ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.ons ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup) 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 ONLINE OFFLINE STABLE ora.CRS.dg(ora.asmgroup) 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 OFFLINE OFFLINE STABLE ora.DATA.dg(ora.asmgroup) 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 OFFLINE OFFLINE STABLE ora.FRA.dg(ora.asmgroup) 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 OFFLINE OFFLINE STABLE ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE rac2 STABLE ora.LISTENER_SCAN2.lsnr 1 ONLINE ONLINE rac1 STABLE ora.LISTENER_SCAN3.lsnr 1 ONLINE ONLINE rac1 STABLE ora.MGMT.dg(ora.asmgroup) 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 OFFLINE OFFLINE STABLE ora.MGMTLSNR 1 ONLINE ONLINE rac1 169.254.25.67 10.0.5 .101,STABLE ora.asm(ora.asmgroup) 1 ONLINE ONLINE rac1 Started,STABLE 2 ONLINE ONLINE rac2 Started,STABLE 3 OFFLINE OFFLINE STABLE ora.asmnet1.asmnetwork(ora.asmgroup) 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 OFFLINE OFFLINE STABLE ora.cvu 1 ONLINE ONLINE rac1 STABLE ora.mgmtdb 1 ONLINE ONLINE rac1 Open,STABLE ora.qosmserver 1 ONLINE ONLINE rac1 STABLE ora.rac1.vip 1 ONLINE ONLINE rac1 STABLE ora.rac2.vip 1 ONLINE ONLINE rac2 STABLE ora.racdb.db 1 OFFLINE ONLINE rac1 Open,HOME=/u01/app/o racle/product/19.3.0 /db_1,STOPPING 2 ONLINE ONLINE rac2 Open,HOME=/u01/app/o racle/product/19.3.0 /db_1,STABLE ora.racdb.rac.svc 2 ONLINE ONLINE rac2 STABLE ora.scan1.vip 1 ONLINE ONLINE rac2 STABLE ora.scan2.vip 1 ONLINE ONLINE rac1 STABLE ora.scan3.vip 1 ONLINE ONLINE rac1 STABLE --------------------------------------------------------------------------------
Relocate 작업이 완료되면 아래와 같이 출력됩니다.
[racdb_2:/home/oracle]> srvctl status database -d racdb racdb_2 인스턴스가 rac2 노드에서 실행 중임 온라인 재배치: INACTIVE [racdb_2:/home/oracle]> crsctl stat res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.LISTENER.lsnr ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.chad ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.net1.network ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.ons ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup) 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 ONLINE OFFLINE STABLE ora.CRS.dg(ora.asmgroup) 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 OFFLINE OFFLINE STABLE ora.DATA.dg(ora.asmgroup) 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 OFFLINE OFFLINE STABLE ora.FRA.dg(ora.asmgroup) 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 OFFLINE OFFLINE STABLE ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE rac2 STABLE ora.LISTENER_SCAN2.lsnr 1 ONLINE ONLINE rac1 STABLE ora.LISTENER_SCAN3.lsnr 1 ONLINE ONLINE rac1 STABLE ora.MGMT.dg(ora.asmgroup) 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 OFFLINE OFFLINE STABLE ora.MGMTLSNR 1 ONLINE ONLINE rac1 169.254.25.67 10.0.5 .101,STABLE ora.asm(ora.asmgroup) 1 ONLINE ONLINE rac1 Started,STABLE 2 ONLINE ONLINE rac2 Started,STABLE 3 OFFLINE OFFLINE STABLE ora.asmnet1.asmnetwork(ora.asmgroup) 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 OFFLINE OFFLINE STABLE ora.cvu 1 ONLINE ONLINE rac1 STABLE ora.mgmtdb 1 ONLINE ONLINE rac1 Open,STABLE ora.qosmserver 1 ONLINE ONLINE rac1 STABLE ora.rac1.vip 1 ONLINE ONLINE rac1 STABLE ora.rac2.vip 1 ONLINE ONLINE rac2 STABLE ora.racdb.db 2 ONLINE ONLINE rac2 Open,HOME=/u01/app/o racle/product/19.3.0 /db_1,STABLE ora.racdb.rac.svc 2 ONLINE ONLINE rac2 STABLE ora.scan1.vip 1 ONLINE ONLINE rac2 STABLE ora.scan2.vip 1 ONLINE ONLINE rac1 STABLE ora.scan3.vip 1 ONLINE ONLINE rac1 STABLE --------------------------------------------------------------------------------
1번 노드에 있던 racdb가 중지되고 2번 노드로 재배치된 것을 확인할 수 있습니다.
D) 1번 노드로 Relocate
root 나 oracle 유저로 수행합니다.
srvctl relocate database -d racdb -n rac1 -w 5 -v
[racdb_2:/home/oracle]> srvctl relocate database -d racdb -n rac1 -w 5 -v 두 개의 인스턴스에 대한 구성이 업데이트되었습니다. racdb_1 인스턴스가 시작되었습니다. 서비스가 재배치되었습니다. 최대 5분 동안 racdb_2 인스턴스가 정지되기를 기다리는 중... racdb_2 인스턴스가 정지되었습니다. 하나의 인스턴스에 대한 구성이 업데이트되었습니다.
srvctl 명령어를 사용해서 2번 노드의 데이터베이스를 다시 1번 노드로 재배치합니다.
해당 명령어는 클러스터가 동작하는 One Node RAC가 구성된 노드 어디에서든 수행할 수 있습니다.
E) 1번 노드 Relocate 결과 확인
root 나 oracle 유저로 수행합니다.
srvctl status database -d racdb crsctl stat res -t
Relocate 작업 중이면 다음과 같이 출력됩니다.
[racdb_1:/home/oracle]> srvctl status database -d racdb racdb_2 인스턴스가 rac2 노드에서 실행 중임 온라인 재배치: ACTIVE 소스 인스턴스: rac2의 racdb_2 대상 인스턴스: rac1의 racdb_1 [racdb_1:/home/oracle]> crsctl stat res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.LISTENER.lsnr ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.chad ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.net1.network ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.ons ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup) 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 ONLINE OFFLINE STABLE ora.CRS.dg(ora.asmgroup) 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 OFFLINE OFFLINE STABLE ora.DATA.dg(ora.asmgroup) 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 OFFLINE OFFLINE STABLE ora.FRA.dg(ora.asmgroup) 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 OFFLINE OFFLINE STABLE ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE rac2 STABLE ora.LISTENER_SCAN2.lsnr 1 ONLINE ONLINE rac1 STABLE ora.LISTENER_SCAN3.lsnr 1 ONLINE ONLINE rac1 STABLE ora.MGMT.dg(ora.asmgroup) 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 OFFLINE OFFLINE STABLE ora.MGMTLSNR 1 ONLINE ONLINE rac1 169.254.25.67 10.0.5 .101,STABLE ora.asm(ora.asmgroup) 1 ONLINE ONLINE rac1 Started,STABLE 2 ONLINE ONLINE rac2 Started,STABLE 3 OFFLINE OFFLINE STABLE ora.asmnet1.asmnetwork(ora.asmgroup) 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 OFFLINE OFFLINE STABLE ora.cvu 1 ONLINE ONLINE rac1 STABLE ora.mgmtdb 1 ONLINE ONLINE rac1 Open,STABLE ora.qosmserver 1 ONLINE ONLINE rac1 STABLE ora.rac1.vip 1 ONLINE ONLINE rac1 STABLE ora.rac2.vip 1 ONLINE ONLINE rac2 STABLE ora.racdb.db 1 ONLINE ONLINE rac1 Open,HOME=/u01/app/o racle/product/19.3.0 /db_1,STABLE 2 OFFLINE ONLINE rac2 Open,HOME=/u01/app/o racle/product/19.3.0 /db_1,STOPPING ora.racdb.rac.svc 1 ONLINE ONLINE rac1 STABLE ora.scan1.vip 1 ONLINE ONLINE rac2 STABLE ora.scan2.vip 1 ONLINE ONLINE rac1 STABLE ora.scan3.vip 1 ONLINE ONLINE rac1 STABLE --------------------------------------------------------------------------------
Relocate 작업이 완료되면 아래와 같이 출력됩니다.
[racdb_1:/home/oracle]> srvctl status database -d racdb racdb_1 인스턴스가 rac1 노드에서 실행 중임 온라인 재배치: INACTIVE [racdb_1:/home/oracle]> crsctl stat res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.LISTENER.lsnr ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.chad ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.net1.network ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.ons ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup) 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 ONLINE OFFLINE STABLE ora.CRS.dg(ora.asmgroup) 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 OFFLINE OFFLINE STABLE ora.DATA.dg(ora.asmgroup) 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 OFFLINE OFFLINE STABLE ora.FRA.dg(ora.asmgroup) 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 OFFLINE OFFLINE STABLE ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE rac2 STABLE ora.LISTENER_SCAN2.lsnr 1 ONLINE ONLINE rac1 STABLE ora.LISTENER_SCAN3.lsnr 1 ONLINE ONLINE rac1 STABLE ora.MGMT.dg(ora.asmgroup) 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 OFFLINE OFFLINE STABLE ora.MGMTLSNR 1 ONLINE ONLINE rac1 169.254.25.67 10.0.5 .101,STABLE ora.asm(ora.asmgroup) 1 ONLINE ONLINE rac1 Started,STABLE 2 ONLINE ONLINE rac2 Started,STABLE 3 OFFLINE OFFLINE STABLE ora.asmnet1.asmnetwork(ora.asmgroup) 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 OFFLINE OFFLINE STABLE ora.cvu 1 ONLINE ONLINE rac1 STABLE ora.mgmtdb 1 ONLINE ONLINE rac1 Open,STABLE ora.qosmserver 1 ONLINE ONLINE rac1 STABLE ora.rac1.vip 1 ONLINE ONLINE rac1 STABLE ora.rac2.vip 1 ONLINE ONLINE rac2 STABLE ora.racdb.db 1 ONLINE ONLINE rac1 Open,HOME=/u01/app/o racle/product/19.3.0 /db_1,STABLE ora.racdb.rac.svc 1 ONLINE ONLINE rac1 STABLE ora.scan1.vip 1 ONLINE ONLINE rac2 STABLE ora.scan2.vip 1 ONLINE ONLINE rac1 STABLE ora.scan3.vip 1 ONLINE ONLINE rac1 STABLE --------------------------------------------------------------------------------
원래 있던 1번 노드로 데이터베이스가 재배치되었습니다.