본문 바로가기
DBMS/ORACLE

RAC relink 작업

by 드바 2022. 5. 17.

버전 : ORACLE 19.3.0.0

 

- OS 패치 등으로 인한 RAC 환경 relink 작업 진행 절차

- relink 작업은 롤링으로 할 수 없으므로 모든 서비스 내리고 진행(SR가이드는 이렇게 받았지만 테스트 시 롤링으로 relink 작업진행에 문제는 없었다)

 

  • DBMS STOP
## 리스너 STOP
[root@svr1 ~]# srvctl stop LISTENER

## DBMS STOP
[root@svr1 ~]# srvctl stop database -d racdb
[root@svr1 ~]# crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
               OFFLINE OFFLINE      svr1                     STABLE
               OFFLINE OFFLINE      svr2                     STABLE
ora.chad
               ONLINE  ONLINE       svr1                     STABLE
               ONLINE  ONLINE       svr2                     STABLE
ora.net1.network
               ONLINE  ONLINE       svr1                     STABLE
               ONLINE  ONLINE       svr2                     STABLE
ora.ons
               ONLINE  ONLINE       svr1                     STABLE
               ONLINE  ONLINE       svr2                     STABLE
ora.proxy_advm
               OFFLINE OFFLINE      svr1                     STABLE
               OFFLINE OFFLINE      svr2                     STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
      1        ONLINE  ONLINE       svr1                     STABLE
      2        ONLINE  ONLINE       svr2                     STABLE
      3        ONLINE  OFFLINE                               STABLE
ora.DATA.dg(ora.asmgroup)
      1        ONLINE  ONLINE       svr1                     STABLE
      2        ONLINE  ONLINE       svr2                     STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       svr2                     STABLE
ora.OCR.dg(ora.asmgroup)
      1        ONLINE  ONLINE       svr1                     STABLE
      2        ONLINE  ONLINE       svr2                     STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.asm(ora.asmgroup)
      1        ONLINE  ONLINE       svr1                     Started,STABLE
      2        ONLINE  ONLINE       svr2                     Started,STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
      1        ONLINE  OFFLINE                               STABLE
      2        ONLINE  OFFLINE                               STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.cvu
      1        ONLINE  ONLINE       svr2                     STABLE
ora.qosmserver
      1        ONLINE  OFFLINE                               STABLE
ora.racdb.db
      1        OFFLINE OFFLINE                               Instance Shutdown,ST
                                                             ABLE
      2        OFFLINE OFFLINE                               Instance Shutdown,ST
                                                             ABLE
ora.scan1.vip
      1        ONLINE  ONLINE       svr2                     STABLE
ora.svr1.vip
      1        ONLINE  ONLINE       svr1                     STABLE
ora.svr2.vip
      1        ONLINE  ONLINE       svr2                     STABLE
--------------------------------------------------------------------------------
  • CRS STOP(모든 노드에서 각각 수행)
[root@svr1 ~]# crsctl stop crs
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'svr1'
CRS-2673: Attempting to stop 'ora.crsd' on 'svr1'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on server 'svr1'
CRS-2673: Attempting to stop 'ora.svr1.vip' on 'svr1'
CRS-2673: Attempting to stop 'ora.chad' on 'svr1'
CRS-33673: Attempting to stop resource group 'ora.asmgroup' on server 'svr1'
CRS-2673: Attempting to stop 'ora.OCR.dg' on 'svr1'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'svr1'
CRS-2677: Stop of 'ora.OCR.dg' on 'svr1' succeeded
CRS-2677: Stop of 'ora.DATA.dg' on 'svr1' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'svr1'
CRS-2677: Stop of 'ora.svr1.vip' on 'svr1' succeeded
CRS-2677: Stop of 'ora.asm' on 'svr1' succeeded
CRS-2673: Attempting to stop 'ora.ASMNET1LSNR_ASM.lsnr' on 'svr1'
CRS-2677: Stop of 'ora.chad' on 'svr1' succeeded
CRS-2677: Stop of 'ora.ASMNET1LSNR_ASM.lsnr' on 'svr1' succeeded
CRS-33677: Stop of resource group 'ora.asmgroup' on server 'svr1' succeeded.
CRS-2672: Attempting to start 'ora.svr1.vip' on 'svr2'
CRS-2676: Start of 'ora.svr1.vip' on 'svr2' succeeded
CRS-2673: Attempting to stop 'ora.ons' on 'svr1'
CRS-2677: Stop of 'ora.ons' on 'svr1' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'svr1'
CRS-2677: Stop of 'ora.net1.network' on 'svr1' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'svr1' has completed
CRS-2677: Stop of 'ora.crsd' on 'svr1' succeeded
CRS-2673: Attempting to stop 'ora.storage' on 'svr1'
CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'svr1'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'svr1'
CRS-2677: Stop of 'ora.drivers.acfs' on 'svr1' succeeded
CRS-2677: Stop of 'ora.storage' on 'svr1' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'svr1'
CRS-2677: Stop of 'ora.mdnsd' on 'svr1' succeeded
CRS-2677: Stop of 'ora.asm' on 'svr1' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'svr1'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'svr1' succeeded
CRS-2673: Attempting to stop 'ora.ctssd' on 'svr1'
CRS-2673: Attempting to stop 'ora.evmd' on 'svr1'
CRS-2677: Stop of 'ora.ctssd' on 'svr1' succeeded
CRS-2677: Stop of 'ora.evmd' on 'svr1' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'svr1'
CRS-2677: Stop of 'ora.cssd' on 'svr1' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'svr1'
CRS-2673: Attempting to stop 'ora.gpnpd' on 'svr1'
CRS-2677: Stop of 'ora.gpnpd' on 'svr1' succeeded
CRS-2677: Stop of 'ora.gipcd' on 'svr1' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'svr1' has completed
CRS-4133: Oracle High Availability Services has been stopped.
  • crs unlock(모든 노드에서 각각 수행)
[root@svr1 ~]# cd $GRID_HOME/crs/install
[root@svr1 install]# ls
CLSR.pm                   crscpcfg.pm          crstfa.pm      install.excl        orachm.pm              oraohasd.pm             post_gimr_ugdg.pl         s_crsutils.pm
cmdllroot.sh              crsdeconfig.pm       crsupgrade.pm  install_gi.excl     oracle-ohasd.conf      oraolr.pm               rhpdata                   s_orachm.pm
crsconfig_addparams.sbs   crsdowngrade.pm      crsutils.pm    install.incl        oracle-ohasd.service   oraons.pm               rootcrs.pl                s_oraocr.pm
crsconfig_fileperms.excl  crsgenconfig_params  crsxag.pm      installRemove.excl  oraClusterwareComp.pm  oraqosmserver.pm        rootcrs.sh                s_oraolr.pm
crsconfig_params          crsgpnp.pm           dropdb         oraacfs.pm          oracss.pm              orasrvm.pm              roothas.pl                tfa_setup
crsconfig_params.sbs      crsinstall.pm        dropdb.pl      oraafd.pm           oragpnp.pm             paramfile.crs           roothas.sh
crsconvert.pm             crska.pm             HASLoad.pm     oraasm.pm           oraios.pm              ParentDirPerm_svr1.txt  s_crsconfig_defs
crsconvtoext.pm           crspatch.pm          inittab        oracdp.pm           oraocr.pm              perlhasgen.pm           s_crsconfig_svr1_env.txt
[root@svr1 install]# sh rootcrs.sh -unlock
Using configuration parameter file: /ora19/app/grid/19.3.0/crs/install/crsconfig_params
The log of current session can be found at:
  /ora19/app/grid/base/crsdata/svr1/crsconfig/crsunlock_svr1_2022-05-17_10-12-42AM.log
2022/05/17 10:12:43 CLSRSC-4012: Shutting down Oracle Trace File Analyzer (TFA) Collector.
2022/05/17 10:12:54 CLSRSC-4013: Successfully shut down Oracle Trace File Analyzer (TFA) Collector.
2022/05/17 10:12:54 CLSRSC-347: Successfully unlock /ora19/app/grid/19.3.0
  • relink 진행(모든 노드에서 각각 수행)
## grid relink
[root@svr1 install]# su - grid
Last login: Tue May 17 10:12:46 KST 2022 on pts/4
[grid@svr1 ~]$ cd $GRID_HOME
[grid@svr1 19.3.0]$ cd bin
[grid@svr1 bin]$ pwd
/ora19/app/grid/19.3.0/bin
[grid@svr1 bin]$ ./relink all
writing relink log to: /ora19/app/grid/19.3.0/install/relinkActions2022-05-17_10-15-12AM.log
[grid@svr1 bin]$ exit
logout
[root@svr1 install]# 
[root@svr1 install]#

## dbms relink
[root@svr1 install]# su - oracle
Last login: Tue May 17 09:45:11 KST 2022 on pts/1
[oracle@svr1 ~]$ cd $ORACLE_HOME
[oracle@svr1 db_1]$ cd bin
[oracle@svr1 bin]$ pwd
/ora19/app/oracle/product/19.3.0/db_1/bin
[oracle@svr1 bin]$ ./relink all
writing relink log to: /ora19/app/oracle/product/19.3.0/db_1/install/relinkActions2022-05-17_10-16-19AM.log
[oracle@svr1 bin]$ exit
logout
[root@svr1 install]#
  • root 로 파일권한 변경 스크립트 수행(모든 노드에서 각각 수행)
## relink all 후 일부 파일(resets permission of extjob, jssu, oradism, externaljob.ora) 권한이 변경되므로 해당 스크립트 실행 해 줌
-- $ORACLE_HOME
[root@svr1 install]# cd $ORACLE_HOME
[root@svr1 db_1]# ls
addnode     cfgtoollogs  ctx     deinstall    dv       instantclient  jlib  mgw      OPatch         oraInst.loc  owm      R         root.sh.old    schagent.conf  sqlpatch  usm
admin       client       cv      demo         env.ora  inventory      ldap  network  opatchautocfg  ord          perl     racg      root.sh.old.1  sdk            sqlplus   utl
apex        clone        data    diagnostics  has      javavm         lib   nls      OPatch_OLD     ords         plsql    rdbms     root.sh.old.2  slax           srvm      wwg
assistants  crs          dbjava  dmu          hs       jdbc           log   odbc     opmn           oss          precomp  relnotes  root.sh.old.3  sqldeveloper   suptools  xdk
bin         css          dbs     drdaas       install  jdk            md    olap     oracore        oui          QOpatch  root.sh   runInstaller   sqlj           ucp
[root@svr1 db_1]# sh root.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /ora19/app/oracle/product/19.3.0/db_1
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.

-- $GRID_HOME
[root@svr1 db_1]# cd $GRID_HOME/rdbms/install
[root@svr1 install]# ls
clonedb.pl  config_filemap.sbs  filemap.ora  install.excl  rdbms  rootadd_filemap.sh  rootadd_rdbms.sh  s7x_workflow.akwf  sbs  setup_processor_group.sh
[root@svr1 install]# sh rootadd_rdbms.sh 
[root@svr1 install]# cd $GRID_HOME/crs/install
[root@svr1 install]# ls
CLSR.pm                   crscpcfg.pm          crstfa.pm      install.excl        orachm.pm              oraohasd.pm             post_gimr_ugdg.pl         s_crsutils.pm
cmdllroot.sh              crsdeconfig.pm       crsupgrade.pm  install_gi.excl     oracle-ohasd.conf      oraolr.pm               rhpdata                   s_orachm.pm
crsconfig_addparams.sbs   crsdowngrade.pm      crsutils.pm    install.incl        oracle-ohasd.service   oraons.pm               rootcrs.pl                s_oraocr.pm
crsconfig_fileperms.excl  crsgenconfig_params  crsxag.pm      installRemove.excl  oraClusterwareComp.pm  oraqosmserver.pm        rootcrs.sh                s_oraolr.pm
crsconfig_params          crsgpnp.pm           dropdb         oraacfs.pm          oracss.pm              orasrvm.pm              roothas.pl                tfa_setup
crsconfig_params.sbs      crsinstall.pm        dropdb.pl      oraafd.pm           oragpnp.pm             paramfile.crs           roothas.sh
crsconvert.pm             crska.pm             HASLoad.pm     oraasm.pm           oraios.pm              ParentDirPerm_svr1.txt  s_crsconfig_defs
crsconvtoext.pm           crspatch.pm          inittab        oracdp.pm           oraocr.pm              perlhasgen.pm           s_crsconfig_svr1_env.txt

## crs lock
[root@svr1 install]# sh rootcrs.sh -lock
Using configuration parameter file: /ora19/app/grid/19.3.0/crs/install/crsconfig_params
The log of current session can be found at:
  /ora19/app/grid/base/crsdata/svr1/crsconfig/crslock_svr1_2022-05-17_10-26-47AM.log
2022/05/17 10:26:48 CLSRSC-329: Replacing Clusterware entries in file 'oracle-ohasd.service'
[root@svr1 install]#
  • CRS START(모든 노드에서 각각 수행)
[root@svr1 install]# crsctl start crs
CRS-4123: Oracle High Availability Services has been started.
[root@svr1 install]#
  • DBMS START
[root@svr1 install]# srvctl start database -d racdb
[root@svr1 install]# crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
               ONLINE  ONLINE       svr1                     STABLE
               ONLINE  ONLINE       svr2                     STABLE
ora.chad
               ONLINE  ONLINE       svr1                     STABLE
               ONLINE  ONLINE       svr2                     STABLE
ora.net1.network
               ONLINE  ONLINE       svr1                     STABLE
               ONLINE  ONLINE       svr2                     STABLE
ora.ons
               ONLINE  ONLINE       svr1                     STABLE
               ONLINE  ONLINE       svr2                     STABLE
ora.proxy_advm
               OFFLINE OFFLINE      svr1                     STABLE
               OFFLINE OFFLINE      svr2                     STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
      1        ONLINE  ONLINE       svr1                     STABLE
      2        ONLINE  ONLINE       svr2                     STABLE
      3        ONLINE  OFFLINE                               STABLE
ora.DATA.dg(ora.asmgroup)
      1        ONLINE  ONLINE       svr1                     STABLE
      2        ONLINE  ONLINE       svr2                     STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       svr2                     STABLE
ora.OCR.dg(ora.asmgroup)
      1        ONLINE  ONLINE       svr1                     STABLE
      2        ONLINE  ONLINE       svr2                     STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.asm(ora.asmgroup)
      1        ONLINE  ONLINE       svr1                     Started,STABLE
      2        ONLINE  ONLINE       svr2                     Started,STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
      1        ONLINE  OFFLINE                               STABLE
      2        ONLINE  OFFLINE                               STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.cvu
      1        ONLINE  ONLINE       svr2                     STABLE
ora.qosmserver
      1        ONLINE  OFFLINE                               STABLE
ora.racdb.db
      1        ONLINE  ONLINE       svr1                     Open,HOME=/ora19/app
                                                             /oracle/product/19.3
                                                             .0/db_1,STABLE
      2        ONLINE  ONLINE       svr2                     Open,HOME=/ora19/app
                                                             /oracle/product/19.3
                                                             .0/db_1,STABLE
ora.scan1.vip
      1        ONLINE  ONLINE       svr2                     STABLE
ora.svr1.vip
      1        ONLINE  ONLINE       svr1                     STABLE
ora.svr2.vip
      1        ONLINE  ONLINE       svr2                     STABLE
--------------------------------------------------------------------------------

## 접속 테스트
[root@svr1 install]# su - oracle
Last login: Tue May 17 10:20:24 KST 2022 on pts/6
[oracle@svr1 ~]$ 
[oracle@svr1 ~]$ ss

SQL*Plus: Release 19.0.0.0.0 - Production on Tue May 17 10:49:30 2022
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> select instance_name from v$instance ;

INSTANCE_NAME
----------------
racdb1

SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@svr1 ~]$

 

  • 참고

이전 버전에서 사용하던

rootcrs.sh -postpatch

perl rootcrs.pl -patch

등의 명령어는 19c 버전에서 에러 발생한다.

[root@svr2 install]# sh rootcrs.sh -postpatch
Using configuration parameter file: /ora19/app/grid/19.3.0/crs/install/crsconfig_params
The log of current session can be found at:
  /ora19/app/grid/base/crsdata/svr2/crsconfig/crs_postpatch_svr2_2022-05-17_10-37-21AM.log
2022/05/17 10:37:22 CLSRSC-739: cannot run the postpatch operation because the prepatch operation did not complete successfully
Died at /ora19/app/grid/19.3.0/crs/install/crspatch.pm line 3050.
The command '/ora19/app/grid/19.3.0/perl/bin/perl -I/ora19/app/grid/19.3.0/perl/lib -I/ora19/app/grid/19.3.0/crs/install -I/ora19/app/grid/19.3.0/xag /ora19/app/grid/19.3.0/crs/install/rootcrs.pl -postpatch' execution failed
[root@svr2 install]# perl rootcrs.pl -patch
Can't locate Env.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . . ./../../perl/lib) at crsutils.pm line 759.
BEGIN failed--compilation aborted at crsutils.pm line 759.
Compilation failed in require at crsconvert.pm line 67.
BEGIN failed--compilation aborted at crsconvert.pm line 67.
Compilation failed in require at rootcrs.pl line 195.
BEGIN failed--compilation aborted at rootcrs.pl line 195.

댓글