19c

Windows 10 WSL 2, Docker and Oracle – a perfect Partnership

I admit it, I was not a friend of Oracle databases running in Docker containers for a long time. My database systems for testing and demo purposes were all running in VMware, Virtual Box or in the Oracle Cloud. But I have used the Windows Subsystem for Linux since beginning, to work with the Oracle Oracle Cloud Infrastructure CLI, Git Integration etc.. And what I really like is the WSL extension for Visual Studio Code which gives me to chance, to edit Ansible Vault files in Windows without any additional Linux based VM running.

With the update of the existing Windows Subsystem for Linux (WSL) architecture to version 2, the Docker Desktop for Windows is now fully integrated and able to run Docker container in WSL as a lightweight VM. Now it’s time to change my mind, why not use Docker to try out new Oracle features, do some development stuff and more?

What to we need to run Oracle databases in WSL 2 Docker Containers?

  1. WSL 2
  2. Docker Desktop for Windows
  3. Docker images with an Oracle Database – I may use the images (oehrlis/docker) from my workmate Stefan Oehrli (oradba.ch)- merci vöumou

This blog post shows you how to setup WSL 2 to run Docker images. Sure, you can use the Oracle provided Docker images or self created images too. But I have verified the Oracle repository today, the Dockerfile version is 19.3.0. And I don’t have the passion, to create new Dockerfiles for example to run 19.8 and download additional RU software.

Installing Windows Subsystem 2 for Linux

Enable Windows Subsystem for Linux basic Functionality

Start Windows PowerShell as Administrator and enable WSL.

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

Do not restart Windows 10 at the moment.

Activate Windows Subsystem for Linux 2

Check your version before enabling WSL 2, the criteria from the install document must be meet – for example for my x64 platform:

  • Running Windows 10, updated to version 1903 or higher, Build 18362 or higher for x64 systems.

Let’s check it with Windows logo key + R and winver – my version us 1904:

Enable the ‘Virtual Machine Platform’ – this component is required for WSL 2.

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Restart the Windows machine. Now wsl.exe is available as command in Power Shell.

Set WSL 2 as default when installing Linux distributions from Microsoft Store like Ubuntu and SLES.

 

 

Getting Windows 10 ready for Docker

Install Docker Desktop for Windows

Run the Docker Desktop Installer executable. Let the checkboxes activated.

Two minutes later.

Start Docker and verify the Availability

After starting the Docker Desktop, you get a notification that Docker is starting. Docker is recognising that WSL is installed.

Docker is now ready to use.

Open a new PowerShell as Administrator and verify if docker and docker-compose are available.

docker version --format '{{.Server.Version}}

docker-compose --version

Install Git

Link: https://git-scm.com/download/win

We use Git to checkout the Oracle docker containers later. There are several Git clients for Windows available. I use the one from git-scm.com. Just run the executable. After the successful installation, verify Git availability in PowerShell.

git --version

Go for the Oracle Database

Startup the Oracle Docker Image

Before cloning of the Git repository, I created a new directory in my Workplace folder.

Clone Docker Image Repository

The content of my cloned directory Oracle Database 19.0.0.0.

We use Docker Compose here, this makes it very easy to handle networking stuff like port forwarding. Example content of the docker-compose.yml file. In this case, I have not configured the Docker Volume Base, the files for the container are created in a subfolder of the clone directory.

# multitenant tenant database
tdb190c:
image: ${DOCKER_USER}/${DOCKER_REPO}:19.8.0.0
container_name: tdb190c
hostname: tdb190c
restart: unless-stopped
network_mode: bridge
volumes:
- ${DOCKER_VOLUME_BASE}/tdb190c:/u01
- ./config:/u01/config
ports:
- "1521:1521"
environment:
CONTAINER: 'TRUE'
INSTANCE_INIT: /u01/config
ORACLE_SID: TDB190C

After pulling, let’s start the container with docker-compose.

docker-compose up -d tdb190c

In the background, the database will be created and configured – example output in Docker Desktop.

SQL Developer Connect

Verify in the Shell if the Oracle database and the listener are running – example output from the Trivadis Toolbox component TVD-Basenv.

Summary

The integration of Docker in Windows Subsystem for Linux is fast and easy to configure. I like the idea to run a lightweight VM inside my existing WSL. In future, before I think about to start a VMware or Virtual Box VM to do some Oracle testing stuff, I will verify if there is Docker image available. And I will definitely spend more time to discover the possibilities of Docker 🙂

Install Oracle 19c RDBMS on Oracle Linux 8 – avoid [WARNING] [INS-08101] Unexpected error while executing the action at state: ‘supportedOSCheck’

Oracle RDBMS 19c is now certified on Oracle Linux 8. Unfortunately the Oracle Universal Installer in Silent Mode fails when checking the OS version. My OS release:

[oracle@olten dbhome_1]$ cat /etc/oracle-release
Oracle Linux Server release 8.2

Oracle Universal Installer in Silent Mode

The OUI installer in silent mode stops and shows this error message: [WARNING] [INS-08101] Unexpected error while executing the action at state: ‘supportedOSCheck’. There is no parameter available like -ignoreOS or whatever, but two workarounds.

[oracle@olten dbhome_1]$ ./runInstaller -ignorePrereq -waitforcompletion -silent \
-responseFile /u01/app/oracle/product/19.0.0/dbhome_1/install/response/db_install.rsp \
oracle.install.option=INSTALL_DB_SWONLY \
> -responseFile /u01/app/oracle/product/19.0.0/dbhome_1/install/response/db_install.rsp \
> oracle.install.option=INSTALL_DB_SWONLY \
> ORACLE_HOSTNAME=mohnweg.kestenholz.net \
> UNIX_GROUP_NAME=oinstall \
> INVENTORY_LOCATION=/u01/app/oraInventory \
> SELECTED_LANGUAGES=en,en_GB \
> ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1 \
> ORACLE_BASE=/u01/app/oracle \
> oracle.install.db.InstallEdition=EE \
> oracle.install.db.OSDBA_GROUP=dba \
> oracle.install.db.OSBACKUPDBA_GROUP=dba \
> oracle.install.db.OSDGDBA_GROUP=dba \
> oracle.install.db.OSKMDBA_GROUP=dba \
> oracle.install.db.OSRACDBA_GROUP=dba \
> SECURITY_UPDATES_VIA_MYORACLESUPPORT=false \
> DECLINE_SECURITY_UPDATES=true
Launching Oracle Database Setup Wizard...

[WARNING] [INS-08101] Unexpected error while executing the action at state: 'supportedOSCheck'
CAUSE: No additional information available.
ACTION: Contact Oracle Support Services or refer to the software manual.
SUMMARY:
- java.lang.NullPointerException
Moved the install session logs to:
/u01/app/oraInventory/logs/InstallActions2020-05-18_09-48-44AM

Workaround 1

Set the OS parameter in your terminal to a previous version and re-start the Oracle Universal Installer.

export CV_ASSUME_DISTID=OEL7.8

Workaround 2

Edit the file cvu_config which is located in $ORACLE_HOME/cv/admin, change the line from

# Fallback to this distribution id
#CV_ASSUME_DISTID=OEL5

to

# Fallback to this distribution id
CV_ASSUME_DISTID=OEL7.8

Save the file and re-start the Oracle Universal Installer.

Et voilà

Some moments later… the WARNING message about the inventory can be ignored. OUI has created there some files from the previous attempt.

Launching Oracle Database Setup Wizard...

[WARNING] [INS-32047] The location (/u01/app/oraInventory) specified for the central inventory is not empty.
   ACTION: It is recommended to provide an empty location for the inventory.
The response file for this session can be found at:
 /u01/app/oracle/product/19.0.0/dbhome_1/install/response/db_2020-05-18_10-04-19AM.rsp

You can find the log of this install session at:
 /tmp/InstallActions2020-05-18_10-04-19AM/installActions2020-05-18_10-04-19AM.log

As a root user, execute the following script(s):
        1. /u01/app/oraInventory/orainstRoot.sh
        2. /u01/app/oracle/product/19.0.0/dbhome_1/root.sh

Execute /u01/app/oraInventory/orainstRoot.sh on the following nodes:
[olten]
Execute /u01/app/oracle/product/19.0.0/dbhome_1/root.sh on the following nodes:
[olten]


Successfully Setup Software.
Moved the install session logs to:
 /u01/app/oraInventory/logs/InstallActions2020-05-18_10-04-19AM

Oracle Universal Installer in GUI Mode

In the OUI Graphical User Interface you can ignore the message which occurs when the installer starts:

Summary

The installation of the RDBMS software by GUI is not my favourite. I try to use the silent method whenever it’s possible. And with a small workaround, this can be successfully done with 19c on OL8.

Oracle Enterprise Manager 13c Release 4 – Time to Upgrade – First Experiences

The roll-out of the newest Oracle Enterprise Manager 13 Release 4 is a few days old, about time to try out the upgrade process in my ESXi lab environment.

First: This blog post about the OEM upgrade process is based on my own experience.

Software

https://www.oracle.com/enterprise-manager/downloads/cloud-control-downloads.html

Documents

https://docs.oracle.com/en/enterprise-manager/cloud-control/enterprise-manager-cloud-control/13.4/emupg/index.html

The Environment

  • Oracle Enterprise Manager 13.3 running on Oracle Linux 7.6 – OEM Patchlevel January 2020 – Non-HA
  • Oracle Enterprise Edition Repository 19.6.0 Single Tenant Database 
  • Oracle Restart / ASM 19.6.0
  • Additional Oracle Linux Server with 19.3.0 Container Databases
  • All targets up and running
  • My Oracle Support connected
  • Software staged directory in /u01/app/oracle/stage/em13cr4 and permission changed to execute bin file (chmod u+x em13400_linux64.bin).
oracle@kestenholz:/u01/app/oracle/stage/em13cr4/ [oms1303] ll
total 12429656
drwxr-xr-x 2 oracle oinstall       4096 Feb  2 12:13 .
drwxr-xr-x 3 oracle oinstall         21 Feb  2 20:13 ..
-rw-r--r-- 1 oracle oinstall 2109004737 Feb  2 12:11 em13400_linux64-2.zip
-rw-r--r-- 1 oracle oinstall 2047749474 Feb  2 12:11 em13400_linux64-3.zip
-rw-r--r-- 1 oracle oinstall 2117312528 Feb  2 12:12 em13400_linux64-4.zip
-rw-r--r-- 1 oracle oinstall  808014516 Feb  2 12:12 em13400_linux64-5.zip
-rw-r--r-- 1 oracle oinstall 2143125187 Feb  2 12:13 em13400_linux64-6.zip
-rw-r--r-- 1 oracle oinstall 1879163226 Feb  2 12:14 em13400_linux64-7.zip
-rwxr-x--- 1 oracle oinstall 1623577684 Feb  2 12:10 em13400_linux64.bin

Prerequisites

It’s important to verify the changed prerequisites – Chapter 3 – Prerequisites for Upgrading to Enterprise Manager Cloud Control 13c Release 4 – I had do disable all adaptive features in the repository pluggable database:

alter system set "_optimizer_nlj_hj_adaptive_join"= FALSE scope=both
sid='*';
alter system set "_optimizer_strans_adaptive_pruning" = FALSE
scope=both sid='*';
alter system set "_px_adaptive_dist_method" = OFF scope=both sid='*';
alter system set "_sql_plan_directive_mgmt_control" = 0 scope=both
sid='*';
alter system set "_optimizer_dsdir_usage_control" = 0 scope=both
sid='*';
alter system set "_optimizer_use_feedback" = FALSE scope=both sid='*';
alter system set "_optimizer_gather_feedback" = FALSE scope=both
sid='*';
alter system set "_optimizer_performance_feedback" = OFF scope=both
sid='*';

Restart the database after the changed settings.From my view this sentence here is wrong is the documentation (my database has version 19.6.0):

If your Management Repository is using Oracle Database 12.2 or higher, none of these parameters need to be set. 

Why? If these parameters are not set, the installer refuses working.

EMKEY Copy Requirements

The Key was copied to the repository. It well be removed after the successful upgrade.

oracle@kestenholz: [oms1303] $ORACLE_HOME/bin/emctl config emkey -copy_to_repos
Oracle Enterprise Manager Cloud Control 13c Release 3
Copyright (c) 1996, 2018 Oracle Corporation.  All rights reserved.
Enter Enterprise Manager Root (SYSMAN) Password :
The EMKey has been copied to the Management Repository. This operation will cause the EMKey to become unsecure.
After the required operation has been completed, secure the EMKey by running "emctl config emkey -remove_from_repos".

Run Installer

Start the Oracle Universal Installer

The OMS is down now (emctl stop oms -all). Start the installer.

oracle@kestenholz:/u01/app/oracle/stage/em13cr4/ [oms1303] ./em13400_linux64.bin

My Oracle Support Details

I am a registered user in My Oracle Support, I get enough information every week… I don’t enable this checkbox.

Software Updates

At the moment, there are no updates available. Maybe in future there will be any patches available for auto apply during the installation/upgrade process.

Installation Type

Upgrade an existing Enterprise Manager system, this one is my existing installation.

 

Installation Details

Enter a new Middleware Home Location.

Database Connection Details

Enter the SYS and SYSMAN password of the running repository. DDMP (Deferred Data Migration) Jobs are enabled. According the documentation, these jobs are running in the background when the OEM is starting up during the upgrade process to convert old data to the new format. If you have a huge amount of data in your earlier release, then the upgrade can take longer. You can run this job – if disabled – later as Post Upgrade Tasks.

Warnings

I will change to SHA communication later.

The repository has 19.6.0, all required patches are included.

I confirm that the JVMD engine is stopped, this has happened by stopping the OMS.

I had to stop the agent which was running on the management server.

Fix Parameter Settings by the Installer

For my environment, I let the installer fix this settings.

Plug-in Upgrade

Here we see the already installed plugins, they will be upgraded too.

Select Plug-ins

I don’t ant to install additional plug-ins.

Extend WebLogic Server Domain

Enter the password for the weblogic user and define the OMS Instance Base Location.

Enterprise Manager Shared Location Details

My Oracle Enterprise Manager doesn’t run in a high availability setup, I don’t need any shared location.

Port Configuration Details

I use the settings from the existing installation.

Review

Let’s start the upgrade!

Repository Upgrade failed

The upgrade process fails at the step where the repository has to be upgraded.

View Log – ORA-01950

When I scroll up the provided log from the installer, I see this error message here:

The schema manager logfile located in the 13.4 subdirectory $ORACLE_HOME/sysman/log/schemamanager confirms this error.

oracle@kestenholz:/u01/app/oracle/product/em13cr4/sysman/log/schemamanager/m_020220_0947_PM/m_020220_0947_PM.PREUPGRADE/ [oms1303] grep 1950 *
emschema.log.PREUPGRADE:SEVERE: ERROR:ORA-01950: no privileges on tablespace 'USERS'
grep: RCU2020-02-02_21-47_829509113: Is a directory
rcu.log:Sun Feb 2 21:47:41.519 CET 2020 ERROR assistants.rcu.Rcu: oracle.sysman.assistants.rcu.backend.action.AbstractAction::handleNonIgnorableError: Received Non-Ignorable Error: ORA-01950: no privileges on tablespace 'USERS'
rcu.log:Sun Feb 2 21:47:41.520 CET 2020 ERROR assistants.rcu.Rcu: oracle.sysman.assistants.common.dbutil.jdbc.JDBCEngine::onException: SQLException: ORA-01950: no privileges on tablespace 'USERS'
rcu.log:java.sql.SQLSyntaxErrorException: ORA-01950: no privileges on tablespace 'USERS'
rcu.log:oracle.sysman.assistants.common.dbutil.SQLFatalErrorException: java.sql.SQLSyntaxErrorException: ORA-01950: no privileges on tablespace 'USERS'
rcu.log:Caused by: java.sql.SQLSyntaxErrorException: ORA-01950: no privileges on tablespace 'USERS'
rcu.log:Caused by: oracle.sysman.assistants.common.dbutil.SQLFatalErrorException: java.sql.SQLSyntaxErrorException: ORA-01950: no privileges on tablespace 'USERS'
rcu.log:Caused by: java.sql.SQLSyntaxErrorException: ORA-01950: no privileges on tablespace 'USERS'

At this point, this is curious, because in 13.3, there were no objects of the SYSMAN in the USERS tablespace. All objects are located in OEM tablespaces with the MGMT prefix. Here is a list of objects in a repository where an Oracle Enterprise Manager 13c Release 3 is up and running.

SQL> select owner,segment_type,tablespace_name,count(*) from dba_segments where owner='SYSMAN' group by owner,segment_type,tablespace_name order by 1,2,3;

OWNER                SEGMENT_TYPE       TABLESPACE_NAME                  COUNT(*)
-------------------- ------------------ ------------------------------ ----------
SYSMAN               INDEX              MGMT_AD4J_TS                           18
SYSMAN               INDEX              MGMT_ECM_DEPOT_TS                      10
SYSMAN               INDEX              MGMT_TABLESPACE                      1701
SYSMAN               INDEX PARTITION    MGMT_AD4J_TS                          192
SYSMAN               INDEX PARTITION    MGMT_ECM_DEPOT_TS                      15
SYSMAN               INDEX PARTITION    MGMT_TABLESPACE                      1515
SYSMAN               LOB PARTITION      MGMT_ECM_DEPOT_TS                      15
SYSMAN               LOB PARTITION      MGMT_TABLESPACE                       203
SYSMAN               LOBINDEX           MGMT_AD4J_TS                            1
SYSMAN               LOBINDEX           MGMT_ECM_DEPOT_TS                      37
SYSMAN               LOBINDEX           MGMT_TABLESPACE                       159
SYSMAN               LOBSEGMENT         MGMT_AD4J_TS                            1
SYSMAN               LOBSEGMENT         MGMT_ECM_DEPOT_TS                      37
SYSMAN               LOBSEGMENT         MGMT_TABLESPACE                       159
SYSMAN               NESTED TABLE       MGMT_TABLESPACE                         7
SYSMAN               TABLE              MGMT_AD4J_TS                           13
SYSMAN               TABLE              MGMT_ECM_DEPOT_TS                      11
SYSMAN               TABLE              MGMT_TABLESPACE                      1053
SYSMAN               TABLE PARTITION    MGMT_AD4J_TS                          192
SYSMAN               TABLE PARTITION    MGMT_TABLESPACE                       622

20 rows selected.

The solution is simple. Just grant the permissions for the USERS tablespace to SYSMAN and retry the installation progress.But, don’t ask me why SYSMAN creates now objects in USERS…

SQL> ALTER USER sysman QUOTA UNLIMITED ON users;

User altered.

After a while, you can see new created tables and indexes in tablespace USERS for user SYSMAN.

SQL> select owner,segment_type,tablespace_name,count(*) from dba_segments where owner='SYSMAN' group by owner,segment_type,tablespace_name order by 1,2,3;

OWNER                SEGMENT_TYPE       TABLESPACE_NAME                  COUNT(*)
-------------------- ------------------ ------------------------------ ----------
SYSMAN               INDEX              MGMT_AD4J_TS                           18
SYSMAN               INDEX              MGMT_ECM_DEPOT_TS                      10
SYSMAN               INDEX              MGMT_TABLESPACE                      1753
SYSMAN               INDEX              USERS                                   7
SYSMAN               INDEX PARTITION    MGMT_AD4J_TS                          192
SYSMAN               INDEX PARTITION    MGMT_ECM_DEPOT_TS                      15
SYSMAN               INDEX PARTITION    MGMT_TABLESPACE                      1537
SYSMAN               LOB PARTITION      MGMT_ECM_DEPOT_TS                      15
SYSMAN               LOB PARTITION      MGMT_TABLESPACE                       205
SYSMAN               LOBINDEX           MGMT_AD4J_TS                            1
SYSMAN               LOBINDEX           MGMT_ECM_DEPOT_TS                      37
SYSMAN               LOBINDEX           MGMT_TABLESPACE                       181
SYSMAN               LOBSEGMENT         MGMT_AD4J_TS                            1
SYSMAN               LOBSEGMENT         MGMT_ECM_DEPOT_TS                      37
SYSMAN               LOBSEGMENT         MGMT_TABLESPACE                       181
SYSMAN               NESTED TABLE       MGMT_TABLESPACE                         7
SYSMAN               TABLE              MGMT_AD4J_TS                           13
SYSMAN               TABLE              MGMT_ECM_DEPOT_TS                      11
SYSMAN               TABLE              MGMT_TABLESPACE                      1079
SYSMAN               TABLE              USERS                                  53
SYSMAN               TABLE PARTITION    MGMT_AD4J_TS                          192
SYSMAN               TABLE PARTITION    MGMT_TABLESPACE                       625

22 rows selected.

The repository upgrade step runs fine now, the whole upgrade process continuous.

Finish

After while, yes we did it, the root script execution is the last task. 

Script execution.

# /u01/app/oracle/product/em13cr4/allroot.sh

Starting to execute allroot.sh .........

Starting to execute /u01/app/oracle/product/em13cr4/root.sh ......
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/em13cr4

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]:
The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]:

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
/etc exist
/u01/app/oracle/product/em13cr4
Finished execution of  /u01/app/oracle/product/em13cr4/root.sh ......

The Enterprise Manager is now running with Release 4.

About Enterprise Manager

Next steps are

  • upgrade the Oracle agents
  • uninstall the old OEM software –  btw, the installer already detaches the old ORACLE_HOME from Oracle’s central inventory for you and removes the emkey from the repository 🙂

Summary

This is a lab environment, not a huge setup with hundreds of targets. But we can see here two important points for the upgrade process. a) read the manual and disable all adaptive features, even when you have an 19c database and b) user SYSMAN needs permission on the USERS tablespace. This is very unusual and should be corrected from my side. But now, enjoy Oracle Enterprise Manager 13c Release 4!