[[["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."],[[["\u003cp\u003eAlloyDB Omni does not inherently include the Orafce extension, but it can be manually added to enhance functionality with Oracle database features.\u003c/p\u003e\n"],["\u003cp\u003eTo add Orafce, users must first identify their installed AlloyDB Omni version using a Docker command to ensure compatibility.\u003c/p\u003e\n"],["\u003cp\u003eA new Docker container needs to be built with a specified \u003ccode\u003eDockerfile\u003c/code\u003e that includes the Orafce extension and the user's specified Omni version.\u003c/p\u003e\n"],["\u003cp\u003eAfter building the Orafce-enabled container, users can connect to the database and enable the extension using \u003ccode\u003eCREATE EXTENSION IF NOT EXISTS ORAFCE;\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eWhile the Orafce extension adds Oracle functions, the \u003ccode\u003edbms_utility.format_call_stack\u003c/code\u003e and \u003ccode\u003edbms_output.get_line\u003c/code\u003e functions are not recommended due to known issues.\u003c/p\u003e\n"]]],[],null,["# Install Orafce for AlloyDB Omni\n\nSelect a documentation version: 15.5.4keyboard_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, 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.4/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 ```text\n docker 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.3\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.3`.\n3. Create a new AlloyDB Omni container that includes Orafce:\n\n ### Linux\n\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 \u003cbr /\u003e\n\n ### macOS\n\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 \u003cbr /\u003e\n\n4. Create a new container with AlloyDB Omni named `my-omni-orafce`: \n\n ```\n docker 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 ```\n docker 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."]]