×
Community Blog Open Source PolarDB Uses Orafce to Support Oracle Compatibility

Open Source PolarDB Uses Orafce to Support Oracle Compatibility

This article describes how open source PolarDB uses orafce to support Oracle compatibility.

By digoal

Background

PolarDB's is a cloud-native database that features a computing-storage separation architecture. It offers affordable data storage, efficient scalability, high-speed parallel computing capabilities, and fast data search and processing. By combining PolarDB with computing algorithms, it enables the conversion of data into productivity and drives business data output.

This article describes how open source PolarDB uses orafce to support Oracle compatibility.

The test environment is macos + docker. For more information about deploying PolarDB, see:

Install orafce for PolarDB

Install orafce

git clone --depth=1 https://github.com/orafce/orafce  
  
cd orafce  
  
USE_PGXS=1 make  
  
USE_PGXS=1 make install    

Creat extension orafce

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)  

Test

Configure environment variables. You can use PostgreSQL to directly access PolarDB.
  
export PGHOST=localhost  
psql  
psql (11.9)  
Type "help" for help.  
  
postgres=# \q  
  
Test:  
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  

References

https://github.com/orafce/orafce

0 1 0
Share on

digoal

276 posts | 24 followers

You may also like

Comments