Skip to content

Automatic "opatch apply" #1070

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
xtender opened this issue Dec 5, 2018 · 5 comments
Closed

Automatic "opatch apply" #1070

xtender opened this issue Dec 5, 2018 · 5 comments

Comments

@xtender
Copy link

xtender commented Dec 5, 2018

It would be great to have an ability to upload patches into special volume for patches and container installs them automatically (unzip && cd {patch_number} && opatch apply for each of them)

@xtender
Copy link
Author

xtender commented Dec 6, 2018

I did it for own images:

  1. created patches directory and put install_patches.sh into this directory:
# cat install_patches.sh
#!/bin/bash

unzip  -u ./*.zip
CURDIR=`pwd`

for D in *; do
    if [ -d "${D}" ]; then
        echo =================================================
        echo " *** Processing patch # ${D}... "   # your processing here
        cd "${D}"
        opatch apply -silent
    fi
    cd $CURDIR
done

  1. added into dockerfile the following commands:
COPY --chown=oracle:dba patches $INSTALL_DIR/patches

# Install DB software binaries
USER oracle
RUN chmod ug+x $INSTALL_DIR/patches/*.sh && \
    sync && \
    cd $INSTALL_DIR/patches && \
    ./install_patches.sh

@xtender
Copy link
Author

xtender commented Dec 6, 2018

So I can put downloaded patches into this directory and they will be installed automatically

@gvenzl gvenzl self-assigned this Dec 10, 2018
@gvenzl
Copy link
Member

gvenzl commented Dec 10, 2018

What you really want to do is create a patched image that is tagged appropriately, rather than having an image that says oracle/database:18.3.0-ee but in fact isn't an 18.3.0-ee image anymore.
You also have to make sure that the database data dictionary has been patched as well, so you can't just startup a image which includes patches against random database files.

You will find a sample of how you can build patched images in SingleInstane/samples/applypatch

@theBNT
Copy link

theBNT commented Mar 29, 2021

Thank you @xtender for this suggestion (and your related blog post) and sorry everybody else for reviving this old issue, but i think providing a standardized update mechanism for Oracle Docker images is something of big help for many users.

Currently, im trying to patch the 19.3.0 with the RU patch 32226239 (provided via file p32226239_190000_Linux-x86-64.zip) in order to mitigate a problem which occurs during import into a dockerbased database.

It seems the linked procedure is at least off by the folder structure because opatch quits with

ZOP-51: The patch location is not valid for apply, because it doesn't have correct metadata, or it points to a patch directory.
Argument(s) Error... Patch location is not valid for apply

Although this might be then more related to #1820

Or is this what OracleDatabase/SingleInstance/extensions/patching is for?

After fixing the folder traversal, im running into "File not found or not writable" errors during opatch, so any help appreciated!

@gvenzl
Copy link
Member

gvenzl commented Mar 10, 2022

Closing the issue as these image and database versions have been superseded.
Please reopen this ER for 19c if you think this functionality is still useful.

@gvenzl gvenzl closed this as completed Mar 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants