Neste post veremos como aplicar Release Update no Oracle Grid Infrastructure usando a automação do Fleet Patching and Provisioning. O processo consiste em provisionar uma nova Working Copy do Grid com os Release Updates já aplicados no Grid Home e realizar o switch do Grid Home atual para o novo. Dessa forma, faremos a atualização usando a estratégia Out-Of-Place Patching com downtime mínimo de poucos segundos.

Neste exemplo estou usando o servidor lab01 que tem o Grid Infrastructure 19c com Release Update 11 e farei a atualização para o Release Update 12. Neste ambiente há uma instância orcl rodando na versão 19c Release Update 3.

FPP Target (lab01): Versão do Grid Home:

[grid@lab01 ~]$ $ORACLE_HOME/OPatch/opatch lspatches
32585572;DBWLM RELEASE UPDATE 19.0.0.0.0 (32585572)
32584670;TOMCAT RELEASE UPDATE 19.0.0.0.0 (32584670)
32579761;OCW RELEASE UPDATE 19.11.0.0.0 (32579761)
32576499;ACFS RELEASE UPDATE 19.11.0.0.0 (32576499)
32545013;Database Release Update : 19.11.0.0.210420 (32545013)

OPatch succeeded.

FPP Server: Consultando Gold Images disponíveis

[grid@fppserver01 ~]$ rhpctl query image
fppserver01.dibiei.com: Audit ID: 144
Image name: gi19cR11
Image name: db19cR11
Image name: db12cR1
Image name: gi19cR12
Image name: db19cR3

Vamos usar a Gold Image gi19cR12:

[grid@fppserver01 ~]$ rhpctl query image -image gi19cR12
fppserver01.dibiei.com: Audit ID: 145
Image name: gi19cR12
Owner: grid@fppserver
Site: fppserver
Access control: USER:grid@fppserver
Access control: ROLE:OTHER
Access control: ROLE:GH_IMG_PUBLISH
Access control: ROLE:GH_IMG_ADMIN
Access control: ROLE:GH_IMG_VISIBILITY
Parent Image:
Software home path: /fpp_images/images/igi19cR1294719/.ACFS/snaps/igi19cR12/swhome
Image state: PUBLISHED
Image size: 15189 Megabytes
Image Type: ORACLEGISOFTWARE
Image Version: 19.0.0.0.0:19.12.0.0.0
Groups configured in the image: OSDBA=asmdba,OSASM=asmadmin,OSBACKUP=asmadmin,OSDG=asmadmin,OSKM=asmadmin,OSRAC=asmadmin
Image platform: Linux_AMD64
Interim patches installed: 32918050,32916816,32915586,32904851,32585572
Contains a non-rolling patch: FALSE
Complete: TRUE

Para atualizar o Grid Infrastructure, precisamos fazer o deploy de uma Working Copy usando a opção softwareonly, no qual um novo Grid Home será instalado no servidor, mas o Oracle Restart e ASM não serão configurados.

O comando utilizado neste exemplo:

rhpctl add workingcopy -image gi19cR12 -workingcopy wc_lab01_gi19cR12 -path /u01/app/product/19.12.0.0/grid/ -oraclebase /u01/app/grid -targetnode lab01 -softwareonly -root

Provisionando a Working Copy no lab01:

[grid@fppserver01 ~]$ rhpctl add workingcopy -image gi19cR12 -workingcopy wc_lab01_gi19cR12 -path /u01/app/product/19.12.0.0/grid/ -oraclebase /u01/app/grid -targetnode lab01 -softwareonly -root
Enter user "root" password:
fppserver01.dibiei.com: Audit ID: 139
fppserver01.dibiei.com: Storing metadata in repository for working copy "wc_lab01_gi19cR12" ...
fppserver01.dibiei.com: Creating snapshot "tmpgi19cR12wc_lab01_gi19cR12" ...
fppserver01.dibiei.com: Changing the home ownership to user grid...
fppserver01.dibiei.com: Copying software contents to Local File System ...
fppserver01.dibiei.com: Starting clone operation...
fppserver01.dibiei.com: Using inventory file /etc/oraInst.loc to clone ...
lab01:
lab01:
lab01: [INFO] [INS-32183] Use of clone.pl is deprecated in this release. Clone operation is equivalent to performing a Software Only installation from the image.
lab01: You must use /u01/app/product/19.12.0.0/grid/gridSetup.sh script available to perform the Software Only install. For more details on image based installation, refer to help documentation.
lab01:
lab01: Starting Oracle Universal Installer...
lab01:
lab01: [WARNING] [INS-32029] The Installer has detected that the Oracle Base location is not empty.
lab01:    ACTION: Oracle recommends that the Oracle Base location is empty.
lab01: You can find the log of this install session at:
lab01:  /u01/app/oraInventory/logs/cloneActions2021-08-04_11-26-58PM.log
lab01: ..................................................   5% Done.
lab01: ..................................................   10% Done.
lab01: ..................................................   15% Done.
lab01: ..................................................   20% Done.
lab01: ..................................................   25% Done.
lab01: ..................................................   30% Done.
lab01: ..................................................   35% Done.
lab01: ..................................................   40% Done.
lab01: ..................................................   45% Done.
lab01: ..................................................   50% Done.
lab01: ..................................................   55% Done.
lab01: ..................................................   60% Done.
lab01: ..................................................   65% Done.
lab01: ..................................................   70% Done.
lab01: ..................................................   75% Done.
lab01: ..................................................   80% Done.
lab01: ..................................................   85% Done.
lab01: ..........
lab01: Copy files in progress.
lab01:
lab01: Copy files successful.
lab01:
lab01: Link binaries in progress.
lab01: ..........
lab01: Link binaries successful.
lab01:
lab01: Setup files in progress.
lab01: ..........
lab01: Setup files successful.
lab01:
lab01: Setup Inventory in progress.
lab01:
lab01: Setup Inventory successful.
lab01: ..........
lab01: Finish Setup successful.
lab01: The cloning of wc_lab01_gi19cR12 was successful.
lab01: Please check '/u01/app/oraInventory/logs/cloneActions2021-08-04_11-26-58PM.log' for more details.
lab01:
lab01: Setup Oracle Base in progress.
lab01:
lab01: Setup Oracle Base successful.
lab01: ..................................................   95% Done.
lab01:
lab01: As a root user, execute the following script(s):
lab01:  1. /u01/app/product/19.12.0.0/grid/root.sh
lab01:
lab01:
lab01:
lab01: ..................................................   100% Done.
fppserver01.dibiei.com: Successfully executed clone operation.
fppserver01.dibiei.com: Executing root script on nodes [lab01].
lab01: Check /u01/app/product/19.12.0.0/grid/install/root_lab01_2021-08-04_23-27-59-970690222.log for the output of root script
fppserver01.dibiei.com: Successfully executed root script on nodes [lab01].
fppserver01.dibiei.com: Oracle home provisioned.
fppserver01.dibiei.com: Working copy creation completed.

Agora faremos o move do Oracle Grid Infrastructure (Oracle Restart e ASM) para o novo Grid Home.

Usamos o comando rhpctl move gihome, abaixo todas as opções possíveis:

[grid@fppserver01 ~]$ rhpctl move gihome -h

Moves the Oracle Grid Infrastructure from the source working copy or source home path to the destination working copy.

Usage: rhpctl move gihome -destwc <destination_workingcopy_name>
        {{-sourcewc <source_workingcopy_name> |
                 -sourcehome <oracle_home_path>}
         [-targetnode <node_name>]
         [-ignorewcpatches]
         [-nonrolling]
         [-keepplacement]
         [-auto -dbhomes <mapping_of_Oracle_homes>
                 [-dblist <db_name_list> |
                         -excludedblist <db_name_list>]
                 [-nodatapatch]
                 [-disconnect]
                 [-stopoption <stop_option>]
                 [-drain_timeout <session_drain_time>]
                 [-dbsinparallel <number_of_instances>]
                 [-raconetimeout <timeout>]]
         [-batches <list_of_batches> |
                 -smartmove
                 [-saf <availability>]
                 [-separate]]
         [-eval]
         [-schedule
                 { <timer_value> |
                         NOW }]
         [[-aupath <gold_image_path>
                         [-agpath <read_write_path>]] |
                                 [-tgip
                         [-nodriverupdate]]]
         [-ignoremissingpatches <patch_name1>
                 [,<patch_name2>...]] |
         -continue |
         -revert |
         -abort |
         -forcecomplete}
        [-root |
         -cred <cred_name> |
         -sudouser <sudo_username> -sudopath <path_to_sudo_binary> |
         -auth <plugin_name>
                [-arg1 <name1>:<value1>
                        [-arg2 <name2>:<value2>...]]]
        [-cleanpids]
        [-useractiondata <user_action_data>]
        [ -image <image_name>]
        [-smtpfrom "<address>"]
        [-smtpto "<addresses>"]
        [-iso_repo <iso_repository>]
        [-patchmgrloc <patch_mgr_loc>]

    -destwc <destination_workingcopy_name>    Name of the destination working copy to which the Oracle Grid Infrastructure needs to be moved
    -sourcewc <source_workingcopy_name>       Name of the source working copy from which the Oracle Grid Infrastructure needs to be moved
    -sourcehome <oracle_home_path>            Source Oracle home path
    -targetnode <node_name>                   Name of a node in a remote cluster with no Rapid Home Provisioning Client
    -ignorewcpatches                          Ignores if the patched working copy is missing some patches which are present in the source path or working copy
    -nonrolling                               Move the Oracle home in non-rolling mode
    -keepplacement                            Ensure that services of administrator-managed Oracle RAC or Oracle RAC One databases are running on the same instances before and after the move operation
    -auto                                     Automatically patch databases along with patching Grid Infrastructure
    -dbhomes <mapping_of_Oracle_homes>        Mapping of source and destination working copies in the format: "<source_wc1>=<dest_wc1>,...,<source_oracle_home_path>=<dest_wcN>"
    -dblist <db_name_list>                    Patch only the specified databases
    -excludedblist <db_name_list>             Patch all databases except the specified databases
    -nodatapatch                              Indicates that 'datapatch' should not be executed for databases being moved
    -disconnect                               Disconnect all sessions before stopping or relocating services
    -stopoption <stop_option>                 Stop option for database: ABORT, IMMEDIATE, NORMAL, TRANSACTIONAL, TRANSACTIONAL_LOCAL
    -drain_timeout <session drain time>       Service drain timeout specified in seconds
    -dbsinparallel <number_of_instances>      Number of database instances that can be started in parallel on a given node.
    -raconetimeout <timeout>                  RAC One Node database relocation timeout in minutes.
    -batches <list_of_batches>                List of batches of nodes in the format: "(Ba),...,(Bz)"
    -smartmove                                Auto-generate the list of batches of nodes and move databases by restarting instances batch after batch
    -saf <availability>                       Service availability factor, the minimum percentage of instances on which a service must remain running during the move
    -separate                                 Process batches separately. Move operation pauses for user intervention before continuing with the next batch
    -eval                                     Evaluate without executing the command. For Smart Move, print the auto-generated batches of nodes and sequence of moves
    -aupath <gold_image_path>                 Read-only gold image path for the persistent Oracle home path
    -agpath <read_write_path>                 Read/write path for the persistent Oracle home path
    -tgip                                     Perform transparent move of Oracle Grid Infrastructure home
    -nodriverupdate                           skip patching the drivers if the patch contains a driver patch
    -continue                                 Continue restarting CRS stack on the next batch of nodes
    -revert                                   Revert to source Oracle home or working copy in case of batch-move or smartmove
    -abort                                    Abort the ongoing 'move' operation
    -forcecomplete                            Mark move as completed after it has been manually completed
    -root                                     Use root credentials to access the remote node
    -sudouser <username>                      perform super user operations as sudo user name
    -sudopath <sudo_binary_path>              location of sudo binary
    -cred <cred_name>                         Credential name to associate the user/password credentials to access a remote node
    -auth <plugin_name> [<plugin_args>]       Use an authentication plugin to access the remote node
    -cleanpids                                cleans up processes during Oracle Grid Infrastructure move operation
    -useractiondata <user_action_data>        Value to be passed to useractiondata parameter of useraction script
    -schedule { <timer_value> | NOW }         Preferred time to execute the operation. If an absolute timer_value is specified, it should be in ISO-8601 format. For example: 2016-12-21T19:13:17+05. If offset is specified as the timer value, it should be in the format +dd:mm:yy:hh:mm:ss. For example: +02:22:22. If NOW is specified, job will be scheduled immediately.
    -ignoremissingpatches                     Proceed with the move/upgrade even though the specified patches, which are present in the source path or working copy, might be missing from the destination path or working copy
    -ignoredbstarterror                       Ignore any database startup errors during Oracle Grid Infrastructure patching.

Iremos usar as seguintes opções:

  • -destwc: O nome da Working Copy para qual estamos fazendo o move (a que ficará ativa no final do processo).
  • -sourcehome: Indica o caminho do Grid Home atual. Essa opção é usada quando o Grid Home atual foi instalado manualmente (não foi provisionado como uma Working Copy pelo Fleet Patching and Provisioning).

Comando:

rhpctl move gihome -path /u01/app/product/19.11.0.0/grid -destwc wc_lab01_gi19cR12 -root

Executando o move do Grid Home 19.11 para 19.12:

[grid@fppserver01 ~]$ rhpctl move gihome -sourcehome /u01/app/product/19.11.0.0/grid -destwc wc_lab01_gi19cR12 -root
Enter user "root" password:
fppserver01.dibiei.com: Audit ID: 140
PRCG-1242 : failed to execute a remote operation on the Rapid Home Provisioning Client
PRGO-1284 : Rapid Home Provisioning Client "ORACLERESTART_lab01" was never started.
[grid@fppserver01 ~]$ rhpctl move gihome -sourcehome /u01/app/product/19.11.0.0/grid -destwc wc_lab01_gi19cR12 -targetnode lab01 -root
Enter user "root" password:
fppserver01.dibiei.com: Audit ID: 141
fppserver01.dibiei.com: verifying versions of Oracle homes ...
fppserver01.dibiei.com: verifying owners of Oracle homes ...
fppserver01.dibiei.com: verifying groups of Oracle homes ...
fppserver01.dibiei.com: starting to move the Oracle Grid Infrastructure home from home location "/u01/app/product/19.11.0.0/grid" to "/u01/app/product/19.12.0.0/grid" on client cluster "ORACLERESTART_lab01"
fppserver01.dibiei.com: Executing user action dummy on nodes "lab01"...
lab01: Wed Aug  4 23:33:03 -03 2021
fppserver01.dibiei.com: Done executing user action dummy...
fppserver01.dibiei.com: retrieving status of databases ...
fppserver01.dibiei.com: retrieving status of services of databases ...
fppserver01.dibiei.com: relocating services of databases ...
fppserver01.dibiei.com: stopping services of databases ...
fppserver01.dibiei.com: stopping instances of databases ...
fppserver01.dibiei.com: Executing prepatch and postpatch on nodes: "lab01".
fppserver01.dibiei.com: Executing root script on nodes [lab01].
lab01: Using configuration parameter file: /u01/app/product/19.12.0.0/grid/crs/install/crsconfig_params
lab01: The log of current session can be found at:
lab01:   /u01/app/grid/crsdata/lab01/crsconfig/haunlock__2021-08-04_11-33-39PM.log
lab01: 2021/08/04 23:33:40 CLSRSC-347: Successfully unlock /u01/app/product/19.12.0.0/grid
fppserver01.dibiei.com: Successfully executed root script on nodes [lab01].
fppserver01.dibiei.com: Executing root script on nodes [lab01].
lab01: Using configuration parameter file: /u01/app/product/19.12.0.0/grid/crs/install/crsconfig_params
lab01: The log of current session can be found at:
lab01:   /u01/app/grid/crsdata/lab01/crsconfig/roothas_2021-08-04_11-33-41PM.log
lab01: 2021/08/04 23:33:54 CLSRSC-329: Replacing Clusterware entries in file 'oracle-ohasd.service'
fppserver01.dibiei.com: Successfully executed root script on nodes [lab01].
fppserver01.dibiei.com: starting instances of databases "orcl" ...
fppserver01.dibiei.com: Updating inventory on nodes: lab01.
lab01: Starting Oracle Universal Installer...
lab01:
lab01: Checking swap space: must be greater than 500 MB.   Actual 2040 MB    Passed
lab01: The inventory pointer is located at /etc/oraInst.loc
lab01: You can find the log of this install session at:
lab01:  /u01/app/oraInventory/logs/UpdateNodeList2021-08-04_11-35-09PM.log
lab01: 'UpdateNodeList' was successful.
fppserver01.dibiei.com: Updated inventory on nodes: lab01.
fppserver01.dibiei.com: Updating inventory on nodes: lab01.
lab01: Starting Oracle Universal Installer...
lab01:
lab01: Checking swap space: must be greater than 500 MB.   Actual 2040 MB    Passed
lab01: The inventory pointer is located at /etc/oraInst.loc
lab01: You can find the log of this install session at:
lab01:  /u01/app/oraInventory/logs/UpdateNodeList2021-08-04_11-35-12PM.log
lab01: 'UpdateNodeList' was successful.
fppserver01.dibiei.com: Updated inventory on nodes: lab01.
fppserver01.dibiei.com: Completed the 'move gihome' operation on cluster ORACLERESTART_lab01.

Operação concluída com sucesso.

Verificando o downtime do ASM (alert log da instância ASM) :

2021-08-04T23:33:42.011184-03:00
Shutting down ORACLE instance (immediate) (OS id: 31284)

2021-08-04T23:34:52.551878-03:00
SUCCESS: ALTER DISKGROUP ALL MOUNT /* asm agent call crs *//* {0:0:2} */

Avaliando o horário em que o shutdown da instância iniciou e o horário em que todos os diskgroups foram montados após incialização da instância ASM no novo Grid Home, o downtime foi de apenas 70 segundos (isso é realmente ótimo). Esse é o diferencial da estratégia Out-Of-Place Patching, em um cenário com aplicação de patch In-Place, esse tempo poderia levar 15~30 minutos.

Verificando que o serviços estão rodando no novo Grid Home:

[grid@lab01 ~]$ . oraenv <<< +ASM
ORACLE_SID = [+ASM] ? The Oracle base remains unchanged with value /u01/app/grid

[grid@lab01 ~]$ crsctl query has releasepatch
Oracle Clusterware release patch level is [3998055650] and the complete list of patches [32585572 32904851 32915586 32916816 32918050 ] have been applied on the local node. The release patch string is [19.12.0.0.0].

Verificando downtime da instância de banco de dados (alert log da instância):

2021-08-04T23:33:08.232314-03:00
Shutting down ORACLE instance (immediate) (OS id: 30958)

2021-08-04T23:35:09.092623-03:00
Completed: ALTER DATABASE OPEN /* db agent *//* {0:0:140} */

Como a instância RDBMS é baixada antes da instância ASM e é iniciada depois, o downtime do banco de dados foi de 2 minutos.

Conclusão

Neste post foi demonstrado um cenário de atualização do Grid Infrastructuture em uma instalação Standalone Server para um novo Release Update usando a automação do Fleet Patching and Provisioning, que eleva os benefícios da estratégia OOP (Out-Of-Place) para reduzir o downtime e simplificar o rollback em caso de falha da operação.

Leave a Reply

Discover more from Blog do Dibiei

Subscribe now to keep reading and get access to the full archive.

Continue reading