Before you create a link to an Oracle server, you must direct a PolarDB database compatible with Oracle to the correct Oracle home directory. Set the LD_LIBRARY_PATH environment variable on Linux or the PATH environment variable on Windows to the lib directory of the Oracle client installation directory.

For Windows only, you can set the value of the oracle_home configuration parameter in the postgresql.conf file. The value specified in the oracle_home configuration parameter overwrites the Windows PATH environment variable.

The LD_LIBRARY_PATH environment variable on Linux, or the PATH environment variable or oracle_home configuration parameter on Windows, must be set each time you start the PolarDB database compatible with Oracle.

When you use a Linux service script to start the PolarDB database compatible with Oracle, make sure that LD_LIBRARY_PATH has been set within the service script. This allows the environment variable to take effect when the script invokes the pg_ctl utility to start the database.

For Windows only, to set the oracle_home configuration parameter in the postgresql.conf file, edit the file by adding the following line:

oracle_home = 'lib_directory '       

Substitute the name of the Windows directory that contains oci.dll for lib_directory.

After you set the oracle_home configuration parameter, you must restart the server to make the changes effective. Restart the server from the Windows Services console.