Como remover uma GRID_HOME antiga

Este post também está disponível em: English

Oracle Logo Banner
Oracle Logo Banner
$ cd /u01/app/oraInventory/ContentsXML
$ cat inventory.xml
<?xml version="1.0" standalone="yes" ?>
<!-- Copyright (c) 1999, 2023, Oracle and/or its affiliates.
All rights reserved. -->
<!-- Do not modify the contents of this file by hand. -->
<INVENTORY>
<VERSION_INFO>
   <SAVED_WITH>12.2.0.7.0</SAVED_WITH>
   <MINIMUM_VER>2.1.0.6.0</MINIMUM_VER>
</VERSION_INFO>
<HOME_LIST>
<HOME NAME="OraGI19Home1" LOC="/u01/app/19.0.0.0/grid" TYPE="O" IDX="1" CRS="true"/>
<HOME NAME="OraDB12Home1" LOC="/u01/app/oracle/product/12.2.0.1/dbhome_1" TYPE="O" IDX="2"/>
<HOME NAME="OraHome1" LOC="/u01/app/oracle/product/19.0.0.0/dbhome_1" TYPE="O" IDX="3"/>
<HOME NAME="agent13c1" LOC="/oem_agent/agent_13.4.0.0.0" TYPE="O" IDX="4"/>
<HOME NAME="OraGI19Home2" LOC="/u01/app/19.0.0.0/grid1920" TYPE="O" IDX="5"/>
<HOME NAME="Orasidb19c_home1_2023_12_03_01_34" LOC="/u01/app/oracle/product/19.0.0.0/dbhome_2" TYPE="O" IDX="6"/>
</HOME_LIST>
<COMPOSITEHOME_LIST>
</COMPOSITEHOME_LIST>
</INVENTORY>
Bash

A ORACLE_HOME que eu quero remover é a OraGI19Home2.

1. Criar uma variável com o valor da GRID_HOME, que será removida.
$ export OLD_GRID_HOME=/u01/app/19.0.0.0/grid1920
2. Verificar se a GRID_HOME está em uso.
Esse comando vai retornar a GRID_HOME que está sendo utilizado pelo Grid Infrastructure.
$ $OLD_GRID_HOME/srvm/admin/getcrshome
/u01/app/19.0.0.0/grid
3. Desinstalar a GRID_HOME
$ $OLD_GRID_HOME/deinstall/deinstall
Checking for required files and bootstrapping ...
Please wait ...
Location of logs /u01/app/oraInventory/logs/

.
.
.
####################### DEINSTALL CLEAN OPERATION SUMMARY #######################
Successfully detached Oracle home '/u01/app/19.0.0.0/grid1920' from the central inventory on the local node.
Successfully deleted directory '/u01/app/19.0.0.0/grid1920' on the local node.
Oracle Universal Installer cleanup was successful.

Review the permissions and contents of '/u01/app/oracle' on nodes(s) 'oracleserver'.
If there are no Oracle home(s) associated with '/u01/app/oracle', manually delete '/u01/app/oracle' and its contents.
Oracle deinstall tool successfully cleaned up temporary directories.
#######################################################################


############# ORACLE DEINSTALL TOOL END #############
Bash
4. Validação e remoção de arquivos remanescentes

Para validar a remoção, verificar no inventory.xml , se a entrada está como REMOVED=”T”.

$ cat inventory.xml
<?xml version="1.0" standalone="yes" ?>
<!-- Copyright (c) 1999, 2023, Oracle and/or its affiliates.
All rights reserved. -->
<!-- Do not modify the contents of this file by hand. -->
<INVENTORY>
<VERSION_INFO>
   <SAVED_WITH>12.2.0.7.0</SAVED_WITH>
   <MINIMUM_VER>2.1.0.6.0</MINIMUM_VER>
</VERSION_INFO>
<HOME_LIST>
<HOME NAME="OraGI19Home1" LOC="/u01/app/19.0.0.0/grid" TYPE="O" IDX="1" CRS="true"/>
<HOME NAME="OraDB12Home1" LOC="/u01/app/oracle/product/12.2.0.1/dbhome_1" TYPE="O" IDX="2"/>
<HOME NAME="OraHome1" LOC="/u01/app/oracle/product/19.0.0.0/dbhome_1" TYPE="O" IDX="3"/>
<HOME NAME="agent13c1" LOC="/oem_agent/agent_13.4.0.0.0" TYPE="O" IDX="4"/>
<HOME NAME="Orasidb19c_home1_2023_12_03_01_34" LOC="/u01/app/oracle/product/19.0.0.0/dbhome_2" TYPE="O" IDX="6"/>
<HOME NAME="OraGI19Home2" LOC="/u01/app/19.0.0.0/grid1920" TYPE="O" IDX="5" REMOVED="T"/>
</HOME_LIST>
<COMPOSITEHOME_LIST>
</COMPOSITEHOME_LIST>
</INVENTORY>
Bash

Caso tenha ficado algum arquivo no diretório da ORACLE_HOME antiga devido a permissões durante a execução, pode remover com segurança, pois já está removida do inventário.

Referências:

DohDatabase

Artigo anterior

LsInventorySession failed: RawInventory gets null OracleHomeInfo

Próximo Artigo

gDBClone um script que você PRECISA conhecer

Escreva um comentário

Deixe um comentário

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *