Provisionando um novo ORACLE_HOME com Oracle AutoUpgrade (Gold Image + create_home)


O Oracle AutoUpgrade é uma ferramenta oficial da Oracle que automatiza e padroniza atividades de upgrade de banco de dados Oracle. 

Através do autoupgrade também é possível criar o ORACLE_HOME de forma automatizada via -mode create_home. A peça-chave aqui é o parâmetro gold_image, que permite solicitar ao Oracle Updater service um ZIP já “integrado” com o nível de patch (reduz tempo e risco de sequenciar vários OPatch).

Neste post estarei reproduzindo a instalação do Oracle 19.30 no ambiente montado anteriormente para o artigo de instalação do oracle database 26ai, demonstrando a criação do keystore, carga de credenciais MOS/CSI, download do Gold Image 19.30 e criação do novo ORACLE_HOME em /u01/app/oracle/product/19.30/dbhome_1, finalizando com a execução do root.sh.

Pré-requisito

  • Java - O AutoUpgrade é um JAR e precisa de Java. A Oracle indica compatibilidade com JDK 8 a JDK 11.
  • Download - A Oracle disponibiliza o AutoUpgrade para download.
Com o usuário oracle, vou criar o diretório que será usado como base para o autoupgrade armazenar os downloads e logs. Na sequencia, será feito o download do mesmo.]
mkdir -p /u01/autoupgrade
cd /u01/autoupgrade

curl -L -o autoupgrade.jar https://download.oracle.com/otn-pub/otn_software/autoupgrade.jar
# ou:
# wget -O autoupgrade.jar https://download.oracle.com/otn-pub/otn_software/autoupgrade.jar

Para validar a versão do autoupgrade, base executar com a opção -version
[oracle@oracle26ai autoupgrade]$ java -jar /u01/autoupgrade/autoupgrade.jar -version
build.version 26.2.260205
build.date 2026/02/05 04:36:27 +0000
build.hash 226a8557b
build.hash_date 2026/02/04 13:52:42 +0000
build.supported_target_versions 12.2,18,19,21,23
build.type production
build.label (HEAD, tag: v26.2, origin/rdbms_19.31)
build.MOS_NOTE 2485457.1
build.MOS_LINK https://support.oracle.com/epmos/faces/DocumentDisplay?id=2485457.1

Para utilização do autoupgrade é necessário criar um arquivo de configuração contendo os parâmetros necessários. Abaixo vai um exemplo "mínimo viável" para este cenário (criação de home 19.30).
[oracle@oracle26ai autoupgrade]$ cat install.cfg
global.global_log_dir=/u01/autoupgrade/logs
global.keystore=/u01/autoupgrade/keystore
install1.sid=lamim19c
install1.target_home=/u01/app/oracle/product/19.30/dbhome_1
install1.restoration=YES
install1.target_version=19
install1.folder=/u01/autoupgrade/patches
install1.patch=RU:19.30,OJVM,OPATCH
install1.download=YES
install1.gold_image=YES
install1.home_settings.edition=SE2
install1.home_settings.oracle_base=/u01/app/oracle
[oracle@oracle26ai autoupgrade]$

O AutoUpgrade exige global.keystore para armazenar as credenciais e recomenda proteger este diretório como você protege wallets (ideia semelhante à do TDE).
 
Com o arquivo de configuração install.cfg criado, vamos tentar executar o modo download para validar.
[oracle@oracle26ai autoupgrade]$ java -jar autoupgrade.jar -config install.cfg -patch -mode download
Previous execution found loading latest data
Total jobs recovered: 1
AutoUpgrade Patching 26.2.260205 launched with default internal options
Processing config file ...
For prefix install1, if gold_image is set to YES or ALL, both CSI and MOS credentials need to be loaded into the keystore. Use -load_password option
[oracle@oracle26ai autoupgrade]$

Esse comportamento é esperado, uma vez que para o download são exigidas as credenciais do MOS e CSI na keystore, através do parametro -load_password.

Primeiramente será fornecida uma senha para a keystore, posteriormente será adicionado o CSI através do comando add -csi, será adicionado o usuário e senha da conta no my oracle support, através do comando add -user usuario@email.
[oracle@oracle26ai autoupgrade]$ java -jar autoupgrade.jar -config install.cfg -patch -load_password
Processing config file ...

Starting AutoUpgrade Patching Password Loader - Type help for available options
Creating new AutoUpgrade Patching keystore - Password required
Enter password:
Enter password again:
AutoUpgrade Patching keystore was successfully created

MOS> help
The following options are available
-----------------------------------
1 add
2 delete
3 list
4 group
5 save
6 help
7 exit

MOS> add
The specified command is in an invalid format.
  To add MOS credentials: add -user user@company.com
  To add CSI #: add -csi <csi #>
MOS> add -csi NUMERO_DO_CSI
MOS> add -user email
Enter your secret/Password:
Re-enter your secret/Password:
MOS> exit
Save the AutoUpgrade Patching keystore before exiting [YES|NO] ? yes
Convert the AutoUpgrade Patching keystore to auto-login [YES|NO] ? yes

AutoUpgrade Patching Password Loader finished - Exiting AutoUpgrade Patching
[oracle@oracle26ai autoupgrade]$

Após configurar o CSI e as credenciais do my oracle support, será executado novamente o autoupgrade na função download.
[oracle@oracle26ai autoupgrade]$ java -jar autoupgrade.jar -config install.cfg -patch -mode download
AutoUpgrade Patching 26.2.260205 launched with default internal options
Processing config file ...
Loading AutoUpgrade Patching keystore
AutoUpgrade Patching keystore is loaded

Connected to Oracle Updater service |- Requesting gold images
AutoUpgrade Patching has finished processing the gold image requests

---------------------------------------------
Downloading files to /u01/autoupgrade/patches
---------------------------------------------
Gold Image - 19.30
    File: autoupgrade_linux-x86-64_19.30_db_home.zip \ 19%
 
Veja que agora a conexão foi estabelecida e o download da imagem está sendo realizado.
[oracle@oracle26ai autoupgrade]$ java -jar autoupgrade.jar -config install.cfg -patch -mode download
AutoUpgrade Patching 26.2.260205 launched with default internal options
Processing config file ...
Loading AutoUpgrade Patching keystore
AutoUpgrade Patching keystore is loaded

Connected to Oracle Updater service |- Requesting gold images
AutoUpgrade Patching has finished processing the gold image requests

---------------------------------------------
Downloading files to /u01/autoupgrade/patches
---------------------------------------------
Gold Image - 19.30
    File: autoupgrade_linux-x86-64_19.30_db_home.zip - 19%
There were conditions found preventing AutoUpgrade Patching from successfully running

*Downloading files
Download failed
*The downloaded file Gold Image - 19.30 did not have the expected checksum*

[oracle@oracle26ai autoupgrade]$ java -jar autoupgrade.jar -config install.cfg -patch -mode download
AutoUpgrade Patching 26.2.260205 launched with default internal options
Processing config file ...
Loading AutoUpgrade Patching keystore
AutoUpgrade Patching keystore is loaded

Connected to Oracle Updater service - Connection resumed. Requesting gold images
AutoUpgrade Patching has finished processing the gold image requests

---------------------------------------------
Downloading files to /u01/autoupgrade/patches
---------------------------------------------
Gold Image - 19.30
    File: autoupgrade_linux-x86-64_19.30_db_home.zip - VALIDATED
---------------------------------------------

[oracle@oracle26ai autoupgrade]$

Com nossa gold image gerada e baixada, podemos seguir para o processo de criação do novo home, com o comando -mode create_home.

Para acompanhar o processo, podemos usar o comando lsj que vai listar o job em execução. No exemplo usei com a opção -a 60, que faz um refresh automatico a cada 60 segundos.

[oracle@oracle26ai autoupgrade]$ java -jar autoupgrade.jar -config install.cfg -patch -mode create_home
AutoUpgrade Patching 26.2.260205 launched with default internal options
Processing config file ...
Loading AutoUpgrade Patching keystore
AutoUpgrade Patching keystore is loaded
+-----------------------------------------+
| Starting AutoUpgrade Patching execution |
+-----------------------------------------+
Type 'help' to list console commands
patch>
patch> help
 exit                                    To close and exit
 help                                    Displays help
 lsj [<option>] [-n <number>] [-a <number>]
                                         Lists jobs by status
     -f                                  - Filter by finished jobs
     -r                                  - Filter by running jobs
     -e                                  - Filter by jobs with errors
     -p                                  - Filter by jobs being prepared
     -n <number>                         - Display up to n jobs
     -a <number>                         - Repeats the command every
                                           <number> seconds
 lsr                                     Displays the restoration queue
 lsa                                     Displays the stop queue
 tasks                                   Displays the tasks running
 clear                                   Clears the terminal
 resume -job <number>                    Resumes a job
 status [<option>] [-a <number>]         Summary of current execution
     -config                             - Show Config Information
     -job <number>                       - Summary of a given job
     -job <number> -c <dbname>           - Show details of container
     -a [<number>]                       - Repeats the command (in
                                           <number> seconds)
 restore -job <number>                   Restores the database to its state
                                         prior to patching
 restore all_failed                      Restores all failed jobs to their
                                         previous states prior to patching
 logs                                    Displays all log locations
 stop -job <number>                      Stops the specified job
 h[ist]                                  Displays the command line history
 /[<number>]                             Executes the command specified from
                                         the history. The default is the last
                                         command
 meta                                    Displays Internal latch count
 hwinfo                                  Displays additional information
                                         with tools uptime
 proceed -job <number>                   Alter predefined start time on
                                         scheduled jobs. Starts 1 minute
                                         from when the command was executed
     -newStartTime [dd/mm/yyyy hh:mm:ss, +<#>h<#>m]
                                         - Starts on an specific date or
                                           given time from command execution
patch> lsj -a 60
patch> +----+-------------+-------+---------+-------+----------+-------+---------------------+
|Job#|      DB_NAME|  STAGE|OPERATION| STATUS|START_TIME|UPDATED|              MESSAGE|
+----+-------------+-------+---------+-------+----------+-------+---------------------+
| 101|create_home_1|EXTRACT|EXECUTING|RUNNING|  18:30:50| 8s ago|Extracting gold image|
+----+-------------+-------+---------+-------+----------+-------+---------------------+
Total jobs 1

The command lsj is running every 60 seconds. PRESS ENTER TO EXIT
+----+-------------+-------+---------+-------+----------+-------+---------------------+
|Job#|      DB_NAME|  STAGE|OPERATION| STATUS|START_TIME|UPDATED|              MESSAGE|
+----+-------------+-------+---------+-------+----------+-------+---------------------+
| 101|create_home_1|EXTRACT|EXECUTING|RUNNING|  18:30:50| 9s ago|Extracting gold image|
+----+-------------+-------+---------+-------+----------+-------+---------------------+
Total jobs 1

The command lsj is running every 60 seconds. PRESS ENTER TO EXIT
+----+-------------+-------+---------+-------+----------+-------+---------------------+
|Job#|      DB_NAME|  STAGE|OPERATION| STATUS|START_TIME|UPDATED|              MESSAGE|
+----+-------------+-------+---------+-------+----------+-------+---------------------+
| 101|create_home_1|EXTRACT|EXECUTING|RUNNING|  18:30:50| 9s ago|Extracting gold image|
+----+-------------+-------+---------+-------+----------+-------+---------------------+
Total jobs 1

The command lsj is running every 60 seconds. PRESS ENTER TO EXIT

Ao final o autoupgrade pedirá para que seja executado com o usuário root o script root.sh
The command lsj is running every 60 seconds. PRESS ENTER TO EXIT
+----+-------------+-------+---------+-------+----------+----------+----------------------+
|Job#|      DB_NAME|  STAGE|OPERATION| STATUS|START_TIME|   UPDATED|               MESSAGE|
+----+-------------+-------+---------+-------+----------+----------+----------------------+
| 101|create_home_1|INSTALL|EXECUTING|RUNNING|  18:30:50|!!190s ago|Installing ORACLE_HOME|
+----+-------------+-------+---------+-------+----------+----------+----------------------+
Total jobs 1

The command lsj is running every 60 seconds. PRESS ENTER TO EXIT
+----+-------------+-------+---------+--------+----------+-------+----------------------+
|Job#|      DB_NAME|  STAGE|OPERATION|  STATUS|START_TIME|UPDATED|               MESSAGE|
+----+-------------+-------+---------+--------+----------+-------+----------------------+
| 101|create_home_1|INSTALL|EXECUTING|FINISHED|  18:30:50| 0s ago|Installing ORACLE_HOME|
+----+-------------+-------+---------+--------+----------+-------+----------------------+
Total jobs 1

The command lsj is running every 60 seconds. PRESS ENTER TO EXIT
Job 101 completed
------------------- Final Summary --------------------
Number of databases            [ 1 ]

Jobs finished                  [1]
Jobs failed                    [0]
Jobs restored                  [0]
Jobs pending                   [0]

# Run the root.sh script as root for the following jobs:
For create_home_1 -> /u01/app/oracle/product/19.30/dbhome_1/root.sh

Please check the summary report at:
/u01/autoupgrade/logs/cfgtoollogs/patch/auto/status/status.html
/u01/autoupgrade/logs/cfgtoollogs/patch/auto/status/status.log
[oracle@oracle26ai autoupgrade]$
[oracle@oracle26ai autoupgrade]$ su - root
Password:
Last login: Thu Feb 12 16:30:24 -03 2026 from 192.168.56.1 on pts/0
[root@oracle26ai ~]# /u01/app/oracle/product/19.30/dbhome_1/root.sh
Check /u01/app/oracle/product/19.30/dbhome_1/install/root_oracle26ai_2026-02-12_23-06-23-597388853.log for the output of root script
[root@oracle26ai ~]#
[root@oracle26ai ~]#
 
O caminho de “status report” e a organização de logs seguem o padrão de estrutura de logs do AutoUpgrade (baseada no diretório de log definido).

Com -mode download + -mode create_home, você transforma a criação de ORACLE_HOME em um processo repetível e “auditável” (status.html/status.log), e com gold_image você reduz significativamente o tempo de provisionamento do home, porque o ZIP já vem no nível de RU desejado (no seu caso, 19.30).
 
O AutoUpgrade é uma ferramenta bastante versátil, com um grande número de parâmetros e possibilidades de configuração. Como dica para quem pretende utilizá-lo, recomendo o AutoUpgrade Composer, do meu colega Marcus Vinicius: ele praticamente gera o arquivo de configuração que você pode usar diretamente nos processos de patching e upgrade.

Comentários