[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[],[],null,["# Install Orafce for AlloyDB Omni\n\nSelect a documentation version: 15.5.5keyboard_arrow_down\n\n- [Current (16.8.0)](/alloydb/omni/current/docs/install-orafce)\n- [16.8.0](/alloydb/omni/16.8.0/docs/install-orafce)\n- [16.3.0](/alloydb/omni/16.3.0/docs/install-orafce)\n- [15.12.0](/alloydb/omni/15.12.0/docs/install-orafce)\n- [15.7.1](/alloydb/omni/15.7.1/docs/install-orafce)\n- [15.7.0](/alloydb/omni/15.7.0/docs/install-orafce)\n- [15.5.5](/alloydb/omni/15.5.5/docs/install-orafce)\n- [15.5.4](/alloydb/omni/15.5.4/docs/install-orafce)\n- [15.5.2](/alloydb/omni/15.5.2/docs/install-orafce)\n\n\u003cbr /\u003e\n\nAlloyDB Omni does not include [the Orafce extension](https://github.com/orafce/orafce), but you can manually add it to an existing AlloyDB Omni installation by following the instructions on this page to provide additional functions and operators from the Oracle database.\n\n\u003cbr /\u003e\n\nBefore you begin\n----------------\n\nEnsure that you've [installed AlloyDB Omni](/alloydb/omni/15.5.5/docs/install) on your system. \n\n### Single-server\n\nAdd Orafce to your AlloyDB Omni installation\n--------------------------------------------\n\nTo add the Orafce extension to your AlloyDB Omni installation,\nfollow these steps:\n\n1. Find your installed AlloyDB Omni version labels:\n\n ### Docker\n\n ```docker\n docker run --rm -it google/alloydbomni cat VERSION.txt\n ```\n\n ### Podman\n\n ```text\n podman run --rm -it google/alloydbomni cat VERSION.txt\n ```\n\n The output is similar to the following: \n\n ```\n AlloyDB Omni version: 15.5.5\n ```\n\n Take note of the AlloyDB Omni version number; you need it in the next step.\n2. Set the `OMNI_VERSION` environment variable: \n\n ```bash\n OMNI_VERSION=VERSION\n ```\n\n Replace \u003cvar translate=\"no\"\u003eVERSION\u003c/var\u003e with the complete database server version from the previous step---for example, `15.5.5`.\n3. Create a new AlloyDB Omni container that includes Orafce:\n\n ### Docker\n\n mkdir ~/alloydb-omni-orafce\n tee -a ~/alloydb-omni-orafce/Dockerfile \u003c\u003c EOF\n ARG OMNI_VERSION\n\n FROM postgres:15-bookworm AS postgres\n\n RUN apt-get update && \\\n apt-get install -y --no-install-recommends \\\n postgresql-15-orafce && \\\n apt-get purge -y --auto-remove && \\\n rm -rf /var/lib/apt/lists/*\n\n FROM google/alloydbomni:${OMNI_VERSION}\n\n COPY --from=postgres /usr/lib/postgresql/15/lib/orafce.so /usr/lib/postgresql/15/lib/orafce.so\n COPY --from=postgres /usr/share/postgresql/15/extension/orafce* /usr/lib/postgresql/15/share/extension/\n\n COPY --from=postgres /usr/lib/x86_64-linux-gnu/ /usr/lib/x86_64-linux-gnu/\n COPY --from=postgres /lib/x86_64-linux-gnu/ /lib/x86_64-linux-gnu/\n EOF\n cd ~/alloydb-omni-orafce\n sudo docker build --build-arg OMNI_VERSION=$OMNI_VERSION --tag google/alloydbomni-with-orafce:$OMNI_VERSION .\n \n ### Podman\n\n mkdir ~/alloydb-omni-orafce\n tee -a ~/alloydb-omni-orafce/Dockerfile \u003c\u003c EOF\n ARG OMNI_VERSION\n\n FROM postgres:15-bookworm AS postgres\n\n RUN apt-get update && \\\n apt-get install -y --no-install-recommends \\\n postgresql-15-orafce && \\\n apt-get purge -y --auto-remove && \\\n rm -rf /var/lib/apt/lists/*\n\n FROM google/alloydbomni:${OMNI_VERSION}\n\n COPY --from=postgres /usr/lib/postgresql/15/lib/orafce.so /usr/lib/postgresql/15/lib/orafce.so\n COPY --from=postgres /usr/share/postgresql/15/extension/orafce* /usr/lib/postgresql/15/share/extension/\n\n COPY --from=postgres /usr/lib/x86_64-linux-gnu/ /usr/lib/x86_64-linux-gnu/\n COPY --from=postgres /lib/x86_64-linux-gnu/ /lib/x86_64-linux-gnu/\n EOF\n cd ~/alloydb-omni-orafce\n sudo podman build --build-arg OMNI_VERSION=$OMNI_VERSION --tag google/alloydbomni-with-orafce:$OMNI_VERSION .\n \n ### Docker\n\n mkdir ~/alloydb-omni-orafce\n tee -a ~/alloydb-omni-orafce/Dockerfile \u003c\u003c EOF\n ARG OMNI_VERSION\n\n FROM postgres:15-bookworm AS postgres\n\n RUN apt-get update && \\\n apt-get install -y --no-install-recommends \\\n postgresql-15-orafce && \\\n apt-get purge -y --auto-remove && \\\n rm -rf /var/lib/apt/lists/*\n\n FROM google/alloydbomni:${OMNI_VERSION}\n\n COPY --from=postgres /usr/lib/postgresql/15/lib/orafce.so /usr/lib/postgresql/15/lib/orafce.so\n COPY --from=postgres /usr/share/postgresql/15/extension/orafce* /usr/lib/postgresql/15/share/extension/\n\n COPY --from=postgres /usr/lib/aarch64-linux-gnu/ /usr/lib/aarch64-linux-gnu/\n COPY --from=postgres /lib/aarch64-linux-gnu/ /lib/aarch64-linux-gnu/\n EOF\n cd ~/alloydb-omni-orafce\n sudo docker build --build-arg OMNI_VERSION=$OMNI_VERSION --tag google/alloydbomni-with-orafce:$OMNI_VERSION .\n \n ### Podman\n\n mkdir ~/alloydb-omni-orafce\n tee -a ~/alloydb-omni-orafce/Dockerfile \u003c\u003c EOF\n ARG OMNI_VERSION\n\n FROM postgres:15-bookworm AS postgres\n\n RUN apt-get update && \\\n apt-get install -y --no-install-recommends \\\n postgresql-15-orafce && \\\n apt-get purge -y --auto-remove && \\\n rm -rf /var/lib/apt/lists/*\n\n FROM google/alloydbomni:${OMNI_VERSION}\n\n COPY --from=postgres /usr/lib/postgresql/15/lib/orafce.so /usr/lib/postgresql/15/lib/orafce.so\n COPY --from=postgres /usr/share/postgresql/15/extension/orafce* /usr/lib/postgresql/15/share/extension/\n\n COPY --from=postgres /usr/lib/aarch64-linux-gnu/ /usr/lib/aarch64-linux-gnu/\n COPY --from=postgres /lib/aarch64-linux-gnu/ /lib/aarch64-linux-gnu/\n EOF\n cd ~/alloydb-omni-orafce\n sudo podman build --build-arg OMNI_VERSION=$OMNI_VERSION --tag google/alloydbomni-with-orafce:$OMNI_VERSION .\n\n4. Create a new container with AlloyDB Omni named `my-omni-orafce`:\n\n ### Docker\n\n ```\n docker run --name my-omni-orafce -e POSTGRES_PASSWORD=NEW_PASSWORD -d google/alloydbomni-with-orafce:OMNI_VERSION\n ```\n\n ### Podman\n\n ```\n podman run --name my-omni-orafce -e POSTGRES_PASSWORD=NEW_PASSWORD -d google/alloydbomni-with-orafce:OMNI_VERSION\n ```\n5. Connect to your database with the Orafce extension:\n\n ### Docker\n\n ```\n docker exec -it my-omni-orafce psql -h localhost -U postgres\n ```\n\n ### Podman\n\n ```\n podman exec -it my-omni-orafce psql -h localhost -U postgres\n ```\n6. Enable Orafce: \n\n ```sql\n CREATE EXTENSION IF NOT EXISTS ORAFCE;\n ```\n7. Confirm that Orafce is installed and enabled: \n\n ```sql\n SELECT oracle.sysdate();\n ```\n The output looks similar to the following: \n\n ```sql\n postgres=# SELECT oracle.sysdate();\n sysdate\n ---------------------\n 2024-06-10 16:36:30\n (1 row)\n ```\n\n| **Note:** Due to some known issues with the Orafce extension on AlloyDB Omni, we don't recommend using the `dbms_utility.format_call_stack` and `dbms_output.get_line` functions."]]