Giter Club home page Giter Club logo

oracle_fdw_read_committed's Introduction

PostgreSQL Foreign Data Wrapper for Oracle with READ COMMITTED isolation level.

See Plagued by ORA-08177: can't serialize access for this transaction for more information about switch to READ COMMITTED.

Be aware that one PostgreSQL query might cause several Oracle queries (inner side of a nested loop join, several foreign tables involved in one query, etc.), and these queries need to use SERIALIZED isolation level see a consistent state of the database. You might have to simplify your queries by using staging tables.

Installation

  • General installation and usage instructions are available in the original repo

CentOS 7

On a brand new CentOS 7 you can follow this sequence of steps with Postgres 9.6:

  1. Install Postgres 9.6
sudo yum install -y https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm
sudo yum install -y postgresql96
sudo yum install -y postgresql96-server
sudo yum install -y postgresql96-contrib

# Database cluster = /var/lib/pgsql/9.6/data
sudo /usr/pgsql-9.6/bin/postgresql96-setup initdb
sudo systemctl enable postgresql-9.6
sudo systemctl start postgresql-9.6  
  1. Configure Postgres 9.6 (see Postgres 9.6 docs)
  2. Install Oracle Instant Client
  • Download recommended RPM packages
    • Basic
      • Basic rather than Basic Lite is a dependency of SDK
    • SQL*Plus
      • Install SQL*Plus to test that Instant Client is functioning correctly.
    • SDK
      • SDK is required to build some packages from sources
  • Install:
sudo yum install -y *.rpm
{ cat <<'HEREDOC'
#!/usr/bin/env bash
export ORACLE_HOME=/usr/lib/oracle/12.2/client64
[[ "$PATH" != *"${ORACLE_HOME}/bin"* ]] && export PATH=$PATH:${ORACLE_HOME}/bin
HEREDOC
} | sudo tee /etc/profile.d/oracle_instant_client.sh
echo "/usr/lib/oracle/12.2/client64/lib" | sudo tee /etc/ld.so.conf.d/oracle-instantclient.conf
sudo ldconfig
  • Log out and log in again
  1. Install Postgres Development Package: sudo yum install -y postgresql96-devel
  2. Install GNU Compiler Collection: sudo yum install -y gcc
  3. Download source archive
  4. Upload to a server and unarchive
  5. sudo make
  6. sudo make install
  7. sudo -u postgres psql -c "CREATE EXTENSION oracle_fdw;"
  8. Verify that the extension is installed
-- This should return extension and Oracle client versions
SELECT oracle_diag();

A result example: oracle_fdw_read_committed 2.0.1, PostgreSQL 9.6.9, Oracle client 12.2.0.1.0, ORACLE_HOME=/usr/lib/oracle/12.2/client64

  1. Create a foreign server
CREATE SERVER :server
  FOREIGN DATA WRAPPER oracle_fdw OPTIONS (dbserver :'EZ_Connect_identifier');

CREATE USER MAPPING FOR :user
  SERVER :server OPTIONS (USER :'user', PASSWORD :'password');
  1. Verify Oracle connection
-- Connect to Oracle and return Oracle server version
SELECT oracle_diag(:'server');

A result example: oracle_fdw_read_committed 2.0.1, PostgreSQL 9.6.9, Oracle client 12.2.0.1.0, Oracle server 12.1.0.2.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.