1. RAC One Node에서 RAC로 변환
A) RAC로 변환
srvctl convert database -d racdb -c RAC crsctl stat res -t
[oracle@racdb1 ~]$ srvctl convert database -d racdb -c RAC [oracle@racdb1 ~]$ crsctl stat res -t -------------------------------------------------------------------------------- NAME TARGET STATE SERVER STATE_DETAILS -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.CRS.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.DATA.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.LISTENER.lsnr ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.RECO.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.asm ONLINE ONLINE rac1 Started ONLINE ONLINE rac2 Started ora.gsd OFFLINE OFFLINE rac1 OFFLINE OFFLINE rac2 ora.net1.network ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.ons ONLINE ONLINE rac1 ONLINE ONLINE rac2 -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE rac1 ora.cvu 1 ONLINE ONLINE rac1 ora.oc4j 1 ONLINE ONLINE rac1 ora.rac1.vip 1 ONLINE ONLINE rac1 ora.rac2.vip 1 ONLINE ONLINE rac2 ora.racdb.db 1 ONLINE ONLINE rac1 Open ora.racdb.rac.svc 1 ONLINE ONLINE rac1 ora.scan1.vip 1 ONLINE ONLINE rac1
클러스터 상에서 단 하나의 인스턴스만 기동되고 있는 One Node RAC는 복수의 인스턴스를 기동할 수 있는 RAC로 간단하게 변환할 수 있습니다.
srvctl 명령어의 convert 옵션을 사용하여 RAC로 변환합니다.
B) 2번 노드 인스턴스 추가 및 기동
srvctl add instance -d racdb -i racdb_2 -n rac2 srvctl start instance -d racdb -i racdb_2 crsctl stat res -t
[oracle@racdb1 ~]$ srvctl add instance -d racdb -i racdb_2 -n rac2 [oracle@racdb1 ~]$ srvctl start instance -d racdb -i racdb_2 [oracle@racdb1 ~]$ crsctl stat res -t -------------------------------------------------------------------------------- NAME TARGET STATE SERVER STATE_DETAILS -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.CRS.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.DATA.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.LISTENER.lsnr ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.RECO.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.asm ONLINE ONLINE rac1 Started ONLINE ONLINE rac2 Started ora.gsd OFFLINE OFFLINE rac1 OFFLINE OFFLINE rac2 ora.net1.network ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.ons ONLINE ONLINE rac1 ONLINE ONLINE rac2 -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE rac1 ora.cvu 1 ONLINE ONLINE rac1 ora.oc4j 1 ONLINE ONLINE rac1 ora.rac1.vip 1 ONLINE ONLINE rac1 ora.rac2.vip 1 ONLINE ONLINE rac2 ora.racdb.db 1 ONLINE ONLINE rac1 Open 2 ONLINE ONLINE rac2 Open ora.racdb.rac.svc 1 ONLINE ONLINE rac1 ora.scan1.vip 1 ONLINE ONLINE rac1
RAC로 변환이 된 후에는 다중 인스턴스 환경을 구성할 수 있습니다.
srvctl 명령어의 add instance 옵션으로 인스턴스를 추가하고, start instance 옵션으로 생성된 인스턴스를 기동합니다.
C) 서비스 중지 및 삭제 (선택)
srvctl stop service -d racdb -s rac srvctl remove service -d racdb -s rac crsctl stat res -t
[oracle@racdb1 ~]$ srvctl stop service -d racdb -s rac [oracle@racdb1 ~]$ srvctl remove service -d racdb -s rac [oracle@racdb1 ~]$ crsctl stat res -t -------------------------------------------------------------------------------- NAME TARGET STATE SERVER STATE_DETAILS -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.CRS.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.DATA.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.LISTENER.lsnr ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.RECO.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.asm ONLINE ONLINE rac1 Started ONLINE ONLINE rac2 Started ora.gsd OFFLINE OFFLINE rac1 OFFLINE OFFLINE rac2 ora.net1.network ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.ons ONLINE ONLINE rac1 ONLINE ONLINE rac2 -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE rac1 ora.cvu 1 ONLINE ONLINE rac1 ora.oc4j 1 ONLINE ONLINE rac1 ora.rac1.vip 1 ONLINE ONLINE rac1 ora.rac2.vip 1 ONLINE ONLINE rac2 ora.racdb.db 1 ONLINE ONLINE rac1 Open 2 ONLINE ONLINE rac2 Open ora.scan1.vip 1 ONLINE ONLINE rac1
One Node RAC를 구성하기 위해 필수적으로 존재했던 service는 RAC 환경에서는 삭제해도 무방합니다.
다만, 기존에 tns 접속 설정이 서비스로 접속하는 형태였다면 영향도를 고려하여 RAC 구성에 맞게 service를 재생성하거나 tns 접속 설정을 변경하는 과정이 필요합니다.
2. RAC에서 RAC One Node로 변환
A) 2번 노드 인스턴스 정지 및 제거
srvctl stop instance -d racdb -i racdb_2 srvctl remove instance -d racdb -i racdb_2 crsctl stat res -t
[oracle@racdb1 ~]$ srvctl stop instance -d racdb -i racdb_2 [oracle@racdb1 ~]$ srvctl remove instance -d racdb -i racdb_2 racdb 데이터베이스에서 인스턴스를 제거하겠습니까? (y/[n]) y [oracle@racdb1 ~]$ crsctl stat res -t -------------------------------------------------------------------------------- NAME TARGET STATE SERVER STATE_DETAILS -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.CRS.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.DATA.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.LISTENER.lsnr ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.RECO.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.asm ONLINE ONLINE rac1 Started ONLINE ONLINE rac2 Started ora.gsd OFFLINE OFFLINE rac1 OFFLINE OFFLINE rac2 ora.net1.network ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.ons ONLINE ONLINE rac1 ONLINE ONLINE rac2 -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE rac1 ora.cvu 1 ONLINE ONLINE rac1 ora.oc4j 1 ONLINE ONLINE rac1 ora.rac1.vip 1 ONLINE ONLINE rac1 ora.rac2.vip 1 ONLINE ONLINE rac2 ora.racdb.db 1 ONLINE ONLINE rac1 Open ora.scan1.vip 1 ONLINE ONLINE rac1
기존에 운영되던 RAC 또한 One Node RAC로 간단하게 전환할 수 있습니다.
단 하나의 인스턴스만 남기고, 나머지 인스턴스는 모두 삭제해야 합니다.
srvctl 명령어의 stop instance 옵션으로 인스턴스를 중지하고, remove instance 옵션으로 중지된 인스턴스를 제거합니다.
B) 서비스 생성 및 기동
srvctl add service -d racdb -s rac -r racdb_1 srvctl start service -d racdb -s rac
[oracle@racdb1 ~]$ srvctl add service -d racdb -s rac -r racdb_1 [oracle@racdb1 ~]$ srvctl start service -d racdb -s rac
One Node RAC 구성에 필수 요건인 service를 추가합니다.
service는 반드시 단 하나의 인스턴스에만 등록되어야 합니다.
srvctl 명령어의 add service 옵션으로 service를 추가하고, start service 옵션으로 service를 기동합니다.
C) RAC One Node로 변환
srvctl convert database -d racdb -c RACONENODE -i racdb_1 crsctl stat res -t
[oracle@racdb1 ~]$ srvctl convert database -d racdb -c RACONENODE -i racdb_1 [oracle@racdb1 ~]$ crsctl stat res -t -------------------------------------------------------------------------------- NAME TARGET STATE SERVER STATE_DETAILS -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.CRS.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.DATA.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.LISTENER.lsnr ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.RECO.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.asm ONLINE ONLINE rac1 Started ONLINE ONLINE rac2 Started ora.gsd OFFLINE OFFLINE rac1 OFFLINE OFFLINE rac2 ora.net1.network ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.ons ONLINE ONLINE rac1 ONLINE ONLINE rac2 -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE rac1 ora.cvu 1 ONLINE ONLINE rac1 ora.oc4j 1 ONLINE ONLINE rac1 ora.rac1.vip 1 ONLINE ONLINE rac1 ora.rac2.vip 1 ONLINE ONLINE rac2 ora.racdb.db 1 ONLINE ONLINE rac1 Open ora.racdb.rac.svc 1 ONLINE ONLINE rac1 ora.scan1.vip 1 ONLINE ONLINE rac1
마지막으로 RAC를 One Node RAC로 변환합니다.
srvctl 명령어의 convert database 옵션으로 작업을 수행합니다.