Wer sich mit Oracle-Datenbanken beschäftigt, kennt das AutoUpgrade-Tool in erster Linie als Werkzeug für Patches, Release Updates oder Migrationen. Doch was viele nicht wissen: Man kann es auch nutzen, um eine komplette Oracle-Installation von Scratch aufzubauen – automatisiert und reproduzierbar.
Das folgende Beispiel bezieht sich auf eine Oracle Linux 9 Installation.
Was braucht man dafür?
Der Ausgangspunkt ist ein Account bei Oracle Support. Dieser sollte in einer professionellen Umgebung ohnehin vorhanden sein. Außerdem eine jdk Version (derzeit 11) und natürlich die neueste Version der autoupgrade.jar Datei.
dnf install java-11-openjdk -y
su - oracle
mkdir -p autoupgrade
mkdir -p /u01/app/oracle/product
cd autoupgrade
mkdir -p log globallog keystore software
wget https://download.oracle.com/otn-pub/otn_software/autoupgrade.jar
Schritt 1: Erstellen eines Wallets für Oracle Support
Im ersten Schritt wird ein Wallet angelegt, mit dem man sich gegenüber Oracle Support authentifiziert. Über dieses Wallet lassen sich dann automatisch alle notwendigen Installationsdateien herunterladen.
cat > keystore.cfg <<EOCAT
global.global_log_dir=/home/oracle/autoupgrade/globallog
global.keystore=/home/oracle/autoupgrade/keystore
EOCAT
java -jar autoupgrade.jar -config keystore.cfg -load_password -patch
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> add -user
Enter your secret/Password:
Re-enter your secret/Password:
MOS> EXIT
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
Schritt 2: Download der Software
Für Oracle 19 bedeutet das konkret: das Base Release 19.3, das jeweils aktuelle Release Update, den OJVM-Patch, opatch sowie den Data Pump Bundle Patch. AutoUpgrade sucht diese Komponenten selbstständig zusammen und legt sie in einem vorher definierten Verzeichnis ab. Auch MPR’s lassen sich damit einbinden.
cat > download.cfg <<EOCAT
global.global_log_dir=/home/oracle/autoupgrade/globallog
global.keystore=/home/oracle/autoupgrade/keystore
patch1.patch=RECOMMENDED
patch1.patch=OPATCH
patch1.patch=19.30
patch1.folder=/home/oracle/autoupgrade/software
patch1.target_version=19
patch1.platform=LINUX.X64
EOCAT
Danach kann der Download gestartet werden. In der Konfig-Datei sind noch weitere Beispiele für die Auswahl von Patches etc.
java -jar autoupgrade.jar -patch -config download.cfg -mode download
Schritt 3: Oracle Home erstellen
Auf Basis der heruntergeladenen Dateien wird im zweiten Schritt direkt ein Oracle Home aufgebaut – also die eigentliche Softwareinstallation. Auch dieser Prozess läuft vollständig über AutoUpgrade und erfordert keinen manuellen Eingriff.
cat > config.cfg <<EOCAT
global.global_log_dir=/home/oracle/autoupgrade/globallog
global.keystore=/home/oracle/autoupgrade/keystore
install.home_settings.binopt.part=YES
install.home_settings.binopt.rac=NO
install.home_settings.binopt.rat=NO
install.home_settings.binopt.uniaud=NO
install.patch=RU,OPATCH,OJVM
install.home_settings.edition=EE
install.home_settings.inventory_location=/u01/app/oraInventory
install.home_settings.oracle_base=/u01/app/oracle
install.home_settings.dba_group=dba
install.home_settings.oper_group=dba
install.home_settings.osdgdba_group=dba
install.home_settings.oskmdba_group=dba
install.home_settings.osracdba_group=dba
install.home_settings.read_only=YES
install.platform=LINUX.X64
install.target_home=/u01/app/oracle/product/19.30/dbhome_1
install.folder=/home/oracle/autoupgrade/software
install.download=NO
java -jar autoupgrade.jar -patch -config config.cfg -mode create_home
Schritt 4: Gold Image erzeugen
Im letzten Schritt kann aus der fertigen Installation ein sogenanntes Gold Image erstellt werden. Dabei wird die gesamte installierte Basis in eine ZIP-Datei gepackt, die sich anschließend auf beliebig viele Zielserver verteilen lässt. Das ist besonders praktisch in größeren Umgebungen, wo eine einheitliche Softwarebasis auf vielen Systemen sichergestellt werden muss.
Fazit
AutoUpgrade hat sich von einem reinen Upgrade-Werkzeug zu einem vollständigen Deployment-Tool entwickelt. Wer das nutzt, spart sich manuelle Installationsschritte, reduziert Fehlerquellen und gewinnt eine reproduzierbare, standardisierte Basis für alle Oracle-Umgebungen. Und natürlich kann man Autoupgrade auch bei Oracle 26ai einsetzen.
Bild: pixabay
