Friday, March 29, 2024

Install Oracle Database 19c Client on Oracle Linux 9 Subsystem on Windows 11

Beginning with 19.22 Jan2024 RU, the 19c database is certified on Oracle Linux 9.x and Red Hat Enterprise Linux (RHEL) 9.x. The minimum kernel version has to be 5.15.0 with Oracle Linux 9 and 5.14.0 with RHEL.

Therefore, I want to try 19c client on my favorite  Windows Subsystem for Linux which is running Oracle Linux 9. The installation includes following steps,

 1) Update WSL kernel version
 
    It is strongly recommended to update the kernel version to 5.15 or higher which is minimum version for Oracle Database 19c on Oracle Linux 9.

 2) Install Oracle Linux 9.1 Subsystem

    You also have other choices (e.g. Oracle Linux 9.2, Oracle Linux 9.3) if you are installing from Microsoft Store instead of command line.

 3) Configure Oracle Linux 9 for Oracle Database installation

 4) Install Oracle Database 19c (19.22) Client

The detailed steps as following,

1. Update WSL kernel version

* Check current WSL kernel version

Depends on the kernel version, try one of following commands to find out WSL kernel version

   wsl --status
   wsl --version
PS C:\> wsl --status
Default Version: 2

Windows Subsystem for Linux was last updated on 2024-03-24
The Windows Subsystem for Linux kernel can be manually updated with 'wsl --update', but automatic updates cannot occur due to your system settings.
To receive automatic kernel updates, please enable the Windows Update setting: 'Receive updates for other Microsoft products when you update Windows'.
For more information please visit https://aka.ms/wsl2kernel.

Kernel version: 5.10.16
It is first time to configure WSL on this computer, the kernel version is 5.10.16, it needs to update to newer version.

* Update WSL kernel version

If your WSL kernel version is 5.15.x or higher, this step can be skipped. This step needs administrator privilege. The WSL kernel is updated with command,

  wsl --update
PS C:\> wsl --update
Installing: Windows Subsystem for Linux
Windows Subsystem for Linux has been installed.
PS C:\>
PS C:\> wsl --status
Default Version: 2
PS C:\>
PS C:\> wsl --version
WSL version: 2.1.5.0
Kernel version: 5.15.146.1-2
WSLg version: 1.0.60
MSRDC version: 1.2.5105
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22631.3296
PS C:\>
2. Install Oracle Linux 9 Subsystem on Windows 11

* List available distributions

   wsl --list --online

The command list all distributions which can be installed with wsl command line. If you like other distributions which are not listed here, you can try to install from Microsoft Store. 
PS C:\> wsl --list --online
The following is a list of valid distributions that can be installed.
Install using 'wsl.exe --install <Distro>'.

NAME                                   FRIENDLY NAME
Ubuntu                                 Ubuntu
Debian                                 Debian GNU/Linux
kali-linux                             Kali Linux Rolling
Ubuntu-18.04                           Ubuntu 18.04 LTS
Ubuntu-20.04                           Ubuntu 20.04 LTS
Ubuntu-22.04                           Ubuntu 22.04 LTS
OracleLinux_7_9                        Oracle Linux 7.9
OracleLinux_8_7                        Oracle Linux 8.7
OracleLinux_9_1                        Oracle Linux 9.1
openSUSE-Leap-15.5                     openSUSE Leap 15.5
SUSE-Linux-Enterprise-Server-15-SP4    SUSE Linux Enterprise Server 15 SP4
SUSE-Linux-Enterprise-15-SP5           SUSE Linux Enterprise 15 SP5
openSUSE-Tumbleweed                    openSUSE Tumbleweed
PS C:\>
From the list, Oracle Linux 9.1 is available. If you prefer other release, such as 9.2, 9.3, please use Microsoft Store instead of wsl command line.

* Install Oracle Linux 9.1 with following commands

   wsl --install --distribution OracleLinux_9_1    -- On WSL kernel version: 5.10.16
   wsl --install OracleLinux_9_1                          -- On WSL kernel version: 5.15.146.1-2

The system will be installed under following directory

   %USERPROFILE%\AppData\Local\Packages\*Oracle*

Here, *Oracle* is a directory name which varies with each Oracle Linux version. For example, Oracle Linux 9.1 will be installed under directory

   %USERPROFILE%\AppData\Local\Packages\3810OracleAmericaInc.62074632F71C9_dm28ctvqnhe9g  
PS C:\> wsl --install OracleLinux_9_1
Installing: Oracle Linux 9.1
Oracle Linux 9.1 has been installed.
Launching Oracle Linux 9.1...
Installing, this may take a few minutes...
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username: oracle
Changing password for user oracle.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
Installation successful!
[oracle@wkstn01]$
3. configure OS as root

* Create user oracle and group oinstall

  groupadd oinstall
  usermod oracle -g oinstall

* Create directory for Oracle Home

  mkdir /u01
  chown oracle:oinstall /u01
  chmod 775 /u01
[oracle@wkstn01]$ sudo su -
[sudo] password for oracle:
Last login: Thu Mar 28 20:08:20 EDT 2024 on pts/0
[root@wkstn01]# groupadd oinstall
[root@wkstn01]# usermod oracle -g oinstall 
[root@wkstn01]# mkdir /u01
[root@wkstn01]# chown oracle:oinstall /u01
[root@wkstn01]# chmod 755 /u01
[root@wkstn01]# ls -ld /u01
drwxrwxr-x 2 oracle oinstall 4096 Mar 25 20:43 /u01
[root@wkstn01]#
* Install essential packages

By default, some Oracle database requried packeges are not installed. To install them by running following commands,

dnf install unzip
dnf install libnsl
dnf install libxcrypt-compat
dnf install make
dnf install binutils
dnf install libXext
dnf install libXrender
dnf install libXtst
dnf install glibc-devel
dnf install libaio
dnf install libstdc++-devel

4. Install Oracle Database Client 19.22

* Download Oracle Database 19.3 Client Home image (installation media)

  LINUX.X64_193000_client_home.zip

* Download latest OPatch (Patch 6880880)

  p6880880_190000_Linux-x86-64.zip

* Download Patch 35943157 or Patch 35940989 

  Patch 35940989 is GI Release Update (RU) 19.22.0.0.240116, it includes Patch 35943157 and Patch 35967489. 
  
  Patch 35943157 is Database Release Update 19.22.0.0.240116, it is not needed if Patch 35940989 is downloaded.

* Patch 35967489 - OCW Release Update 19.22.0.0.240116

The patch contains update to Oracle Installer (runInstaller & deinstall) prerequisite check untility, which makes Oracle Installer become compatible with Oracle Linux 9. Otherwise, installer (runInstaller) will complain that Oracle Linux 9 is not supported and deinstaller (deinstall) will fail with "ERROR: null".

This patch is included in Patch 35940989, does not need to be downloaded seperatly.

* Create Oracle Home and unzip downloaded Client Home image to new created Oracle Home
[oracle@wkstn01]$ mkdir -p /u01/app/oracle/product/19.0.0/client_1
[oracle@wkstn01]$ unzip -q /u01/stage/LINUX.X64_193000_client_home.zip -d /u01/app/oracle/product/19.0.0/client_1
* Update OPatch to latest version

[oracle@wkstn01]$ cd /u01/app/oracle/product/19.0.0/client_1
[oracle@wkstn01]$ OPatch/opatch version
OPatch Version: 12.2.0.1.15

OPatch succeeded.
[oracle@wkstn01]$ mv OPatch OPatch.12.2.0.1.15
[oracle@wkstn01]$
[oracle@wkstn01]$ unzip -q /u01/stage/p6880880_190000_Linux-x86-64.zip
[oracle@wkstn01]$
[oracle@wkstn01]$ OPatch/opatch version
OPatch Version: 12.2.0.1.41

OPatch succeeded.
* Unzip Patch 35943157 or Patch 35940989
[oracle@wkstn01]$ mkdir -p /u01/stage/patch
[oracle@wkstn01]$ unzip -q /u01/stage/p35943157_190000_Linux-x86-64.zip -d /u01/stage/patch
[oracle@wkstn01]$ ls -l /u01/stage/patch
total 1824
drwxrwxrwx 1 oracle oinstall    4096 Mar 24 20:45 35943157
-rwxrwxrwx 1 oracle oinstall 1866175 Mar 24 20:45 PatchSearch.xml
Or
[oracle@wkstn01 /]$ mkdir -p /u01/stage/patch
[oracle@wkstn01 /]$ unzip -q /u01/stage/p35940989_190000_Linux-x86-64.zip -d /u01/stage/patch
[oracle@wkstn01 /]$ ls -l /u01/stage/patch
total 908
drwxrwxrwx 1 oracle oinstall   4096 Mar 26 20:03 35940989
-rwxrwxrwx 1 oracle oinstall 927062 Mar 26 20:03 PatchSearch.xml
[oracle@wkstn01 /]$ ls -l /u01/stage/patch/35940989
total 140
drwxrwxrwx 1 oracle oinstall   4096 Mar 26 19:55 33575402
drwxrwxrwx 1 oracle oinstall   4096 Mar 26 20:03 35943157
drwxrwxrwx 1 oracle oinstall   4096 Mar 26 19:55 35956421
drwxrwxrwx 1 oracle oinstall   4096 Mar 26 19:54 35967489
drwxrwxrwx 1 oracle oinstall   4096 Mar 26 19:55 36115038
drwxrwxrwx 1 oracle oinstall   4096 Mar 26 20:03 automation
-rwxrwxrwx 1 oracle oinstall   5824 Mar 26 19:54 bundle.xml
-rwxrwxrwx 1 oracle oinstall 132929 Mar 26 19:54 README.html
-rwxrwxrwx 1 oracle oinstall      0 Mar 26 19:54 README.txt
[oracle@wkstn01 /]$
* [Optional] Create a silent installation response file /u01/stage/client.rsp
This step is not needed if you like to run installer with GUI instead of silent mode. The file should include following lines
 UNIX_GROUP_NAME=oinstall
 INVENTORY_LOCATION=/u01/app/oraInventory
 ORACLE_BASE=/u01/app/oracle
[oracle@wkstn01]$ cp /u01/app/oracle/product/19.0.0/client_1/install/response/clientsetup.rsp /u01/stage/client.rsp
[oracle@wkstn01]$
[oracle@wkstn01]$ grep -v -E '^#|^$' /u01/stage/client.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_clientinstall_response_schema_v19.0.0
UNIX_GROUP_NAME=
INVENTORY_LOCATION=
ORACLE_BASE=
[oracle@wkstn01]$
[oracle@wkstn01]$ sed -i'.bak' 's/UNIX_GROUP_NAME=.*$/UNIX_GROUP_NAME=oinstall/' /u01/stage/client.rsp
[oracle@wkstn01]$ sed -i'.bak' 's/INVENTORY_LOCATION=.*$/INVENTORY_LOCATION=\/u01\/app\/oraInventory/' /u01/stage/client.rsp
[oracle@wkstn01]$ sed -i'.bak' 's/ORACLE_BASE=.*$/ORACLE_BASE=\/u01\/app\/oracle/' /u01/stage/client.rsp
[oracle@wkstn01]$
[oracle@wkstn01]$ grep -v -E '^#|^$' /u01/stage/client.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_clientinstall_response_schema_v19.0.0
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
ORACLE_BASE=/u01/app/oracle
* If you are not going to install OCW RU (Patch 35967489) or your WSL kernel version is lower than 5.15.0, run following command before start Oracle Installer,

  export CV_ASSUME_DISTID=OL8

It will let Oracle Installer believe he is working on Oracle Linux 8 :).

* Start Oracle Installer from Oracle Home created previously

 ./runInstaller -applyRU /u01/stage/patch/35943157 [-silent -responseFile /u01/stage/client.rsp]

This will install client with database RU only.

Or

 ./runInstaller -applyRU /u01/stage/patch/35940989 [-silent -responseFile /u01/stage/client.rsp]

This will install client with both database RU and OCW RU.

[oracle@wkstn01 client_1]$ ./runInstaller -silent -applyRU /mnt/d/tmp/ru/35943157 -responseFile /u01/stage/client.rsp
Preparing the home to patch...
Applying the patch /mnt/d/tmp/ru/35943157...
Successfully applied the patch.
The log can be found at: /u01/app/oraInventory/logs/InstallActions2024-03-28_07-29-59PM/installerPatchActions_2024-03-28_07-29-59PM.log
Launching Oracle Database Client Setup Wizard...

[WARNING] [INS-13014] Target environment does not meet some optional requirements.
   CAUSE: Some of the optional prerequisites are not met. See logs for details. /u01/app/oraInventory/logs/InstallActions2024-03-28_07-29-59PM/installActions2024-03-28_07-29-59PM.log
   ACTION: Identify the list of failed prerequisite checks from the log: /u01/app/oraInventory/logs/InstallActions2024-03-28_07-29-59PM/installActions2024-03-28_07-29-59PM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
The response file for this session can be found at:
 /u01/app/oracle/product/19.0.0/client_1/install/response/client_2024-03-28_07-29-59PM.rsp

You can find the log of this install session at:
 /u01/app/oraInventory/logs/InstallActions2024-03-28_07-29-59PM/installActions2024-03-28_07-29-59PM.log
Successfully Setup Software with warning(s).
[oracle@wkstn01 client_1]$
If running Oracle Installer in GUI mode, the prerequisite check warnings can be safely ignored.  If running Installer in silent mode, the Installer automatically writes the prerequisite check warnings into log file  and succeeds in installation.

When the Installer prompts, run script orainstRoot.sh as root.
[root@wkstn01]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
When silent mode with both Database RU and OCW RU installed, 
[oracle@wkstn01]$ ./runInstaller -applyRU /u01/stage/patch/35940989 -silent -responseFile /u01/stage/client.rsp
Preparing the home to patch...
Applying the patch /u01/stage/patch/35940989...
Successfully applied the patch.
The log can be found at: /u01/app/oraInventory/logs/InstallActions2024-03-29_06-04-45PM/installerPatchActions_2024-03-29_06-04-45PM.log
Launching Oracle Database Client Setup Wizard...

[WARNING] [INS-13014] Target environment does not meet some optional requirements.
   CAUSE: Some of the optional prerequisites are not met. See logs for details. /u01/app/oraInventory/logs/InstallActions2024-03-29_06-04-45PM/installActions2024-03-29_06-04-45PM.log
   ACTION: Identify the list of failed prerequisite checks from the log: /u01/app/oraInventory/logs/InstallActions2024-03-29_06-04-45PM/installActions2024-03-29_06-04-45PM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
The response file for this session can be found at:
 /u01/app/oracle/product/19.0.0/client_1/install/response/client_2024-03-29_06-04-45PM.rsp

You can find the log of this install session at:
 /u01/app/oraInventory/logs/InstallActions2024-03-29_06-04-45PM/installActions2024-03-29_06-04-45PM.log
Successfully Setup Software with warning(s).
When silent mode with only Database RU installed,
[oracle@wkstn01]$ export CV_ASSUME_DISTID=OL8
[oracle@wkstn01$ ./runInstaller -applyRU /u01/stage/35943157 -silent -responseFile /u01/stage/client.rsp
Preparing the home to patch...
Applying the patch /u01/stage/35943157...
Successfully applied the patch.
The log can be found at: /u01/app/oraInventory/logs/InstallActions2024-03-29_07-03-03PM/installerPatchActions_2024-03-29_07-03-03PM.log
Launching Oracle Database Client Setup Wizard...

[WARNING] [INS-13014] Target environment does not meet some optional requirements.
   CAUSE: Some of the optional prerequisites are not met. See logs for details. /u01/app/oraInventory/logs/InstallActions2024-03-29_07-03-03PM/installActions2024-03-29_07-03-03PM.log
   ACTION: Identify the list of failed prerequisite checks from the log: /u01/app/oraInventory/logs/InstallActions2024-03-29_07-03-03PM/installActions2024-03-29_07-03-03PM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
The response file for this session can be found at:
 /u01/app/oracle/product/19.0.0/client_1/install/response/client_2024-03-29_07-03-03PM.rsp

You can find the log of this install session at:
 /u01/app/oraInventory/logs/InstallActions2024-03-29_07-03-03PM/installActions2024-03-29_07-03-03PM.log
Successfully Setup Software with warning(s).

No comments: