pg>安装oracle兼容模块orafce
2021-10-27 15:17:52    103    0    0
ivan

书接上文:pg>编译安装-自定义安装目录 (ivan.gold)

1、下载

    https://pgxn.org/dist/orafce/

    这里使用最新版orafce-3.16.2.zip

2、安装

    root:

        1)解压

        unzip orafce-3.16.2.zip

        2)移动到pg安装目录的extension目录下

        mv -f orafce-3.16.2 /home/pg12/pgsql/share/extension

        3)这里使用postgres12用户编译,因此将pg安装目录属组给postgres12用户

        chown -R postgres12:postgres12 /home/pg12/pgsql

    su - postgres12

        cd /home/pg12/pgsql/share/extension/orafce-3.16.2

        make

        make install

        psql postgres postgres12

            postgres-# \dn

                   List of schemas

                  Name  |   Owner   

                --------+------------

                 public | postgres12

           

            postgres=# create extension orafce;

           

            postgres=# \dn

                      List of schemas

                     Name     |   Owner   

                --------------+------------

                 dbms_alert   | postgres12

                 dbms_assert  | postgres12

                 dbms_output  | postgres12

                 dbms_pipe    | postgres12

                 dbms_random  | postgres12

                 dbms_utility | postgres12

                 oracle       | postgres12

                 plunit       | postgres12

                 plvchr       | postgres12

                 plvdate      | postgres12

                 plvlex       | postgres12

                 plvstr       | postgres12

                 plvsubst     | postgres12

                 public       | postgres12

                 utl_file     | postgres12

               

            #创建完orafce拓展就能看到orafce所建立的schema。

            #测试:

                postgres=# select 1 from dual;

                 ?column?

                ----------

                        1

        postgres=# \dx
               List of installed extensions
            Name | Version | Schema | Description
            ---------+---------+------------+-----------------------------------------------------------------------------------------------
            orafce | 3.16 | public | Functions and operators that emulate a subset of functions and packages from the Oracle RDBMS
            plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language

           

Pre: pg>java>jdbc调用cursor

Next: linux>自定义命令

103
Sign in to leave a comment.
No Leanote account? Sign up now.
0 comments
Table of content