背景
PolarDB 的云原生存算分离架构, 具备低廉的数据存储、高效扩展弹性、高速多机并行计算能力、高速数据搜索和处理; PolarDB与计算算法结合, 将实现双剑合璧, 推动业务数据的价值产出, 将数据变成生产力.
本文将介绍PolarDB开源版通过orafce支持Oracle兼容性 .
测试环境为macos+docker, polardb部署请参考如何用 PolarDB 证明巴菲特的投资理念 - 包括PolarDB简单部署。
安装orafce for PolarDB
安装软件
git clone --depth=1 https://github.com/orafce/orafce
cd orafce
USE_PGXS=1 make
USE_PGXS=1 make install
安装插件
postgres=# create extension orafce ;
CREATE EXTENSION
postgres=#
postgres=# \dn
List of schemas
Name | Owner
--------------+----------
ag_catalog | postgres
dbms_alert | postgres
dbms_assert | postgres
dbms_output | postgres
dbms_pipe | postgres
dbms_random | postgres
dbms_sql | postgres
dbms_utility | postgres
graph_name | postgres
madlib | postgres
oracle | postgres
plunit | postgres
plvchr | postgres
plvdate | postgres
plvlex | postgres
plvstr | postgres
plvsubst | postgres
public | postgres
utl_file | postgres
(19 rows)
测试
配置环境变量, 可psql直接进入polardb
export PGHOST=localhost
psql
psql (11.9)
Type "help" for help.
postgres=# \q
测试:
USE_PGXS=1 make installcheck
[postgres@67e1eed1b4b6 orafce]$ USE_PGXS=1 make installcheck
/home/postgres/tmp_basedir_polardb_pg_1100_bld/lib/pgxs/src/makefiles/../../src/test/regress/pg_regress --inputdir=./ --bindir='/home/postgres/tmp_basedir_polardb_pg_1100_bld/bin' --schedule=parallel_schedule --encoding=utf8 --dbname=contrib_regression orafce orafce2 dbms_output dbms_utility files varchar2 nvarchar2 aggregates nlssort dbms_random regexp_func dbms_sql
(using postmaster on localhost, default port)
============== dropping database "contrib_regression" ==============
NOTICE: database "contrib_regression" does not exist, skipping
DROP DATABASE
============== creating database "contrib_regression" ==============
CREATE DATABASE
ALTER DATABASE
============== running regression test queries ==============
test init ... ok (4.85 s)
parallel group (2 tests): dbms_pipe_session_A dbms_pipe_session_B
dbms_pipe_session_A ... ok (0.10 s)
dbms_pipe_session_B ... ok (10.16 s)
parallel group (3 tests): dbms_alert_session_C dbms_alert_session_A dbms_alert_session_B
dbms_alert_session_A ... ok (12.12 s)
dbms_alert_session_B ... ok (14.12 s)
dbms_alert_session_C ... ok (4.05 s)
test orafce ... ok
test orafce2 ... ok
test dbms_output ... ok
test dbms_utility ... ok
test files ... ok
test varchar2 ... ok
test nvarchar2 ... ok
test aggregates ... ok
test nlssort ... ok
test dbms_random ... FAILED
test regexp_func ... ok
test dbms_sql ... ok
===========================================================
1 of 18 tests failed.
POLARDB:
All 17 tests, 0 tests in ignore, 0 tests in polar ignore.
===========================================================
The differences that caused some tests to fail can be viewed in the
file "/home/postgres/orafce/regression.diffs". A copy of the test summary that you see
above is saved in the file "/home/postgres/orafce/regression.out".
make: *** [/home/postgres/tmp_basedir_polardb_pg_1100_bld/lib/pgxs/src/makefiles/pgxs.mk:403: installcheck] Error 1