IvorySQL 概述
IvorySQL 是瀚高軟件以PostgreSQL為基礎進行開發的,并且兼容Oracle的開源數據庫。
IvorySQL社區始終承諾與PostgreSQL數據庫保持100%兼容,并且可以直接替換最新版本的PostgreSQL。
IvorySQL增加了一個名為 ivorysql.compatible_mode 的GUC參數用以控制IvorySQL的兼容模式,該參數有 oracle 和 pg 兩種值。在初始化數據目錄的時候,通過指定 -m 參數來指定數據目錄的兼容模式,-m pg 則數據目錄為PostgreSQL模式,該模式下 ivorysql.compatible_mode 參數將會失效,-m oracle 或者不指定 -m 參數則數據目錄為兼容Oracle模式,該模式下 ivorysql.compatible_mode 參數初始值為 oracle 并且不支持部分PostgreSQL的語法,通過 set ivorysql.compatible_mode to pg 就可以使得數據庫100%支持PostgreSQL的語法及功能。
IvorySQL的亮點之一是PL/iSQL過程語言,它支持Oracle的PL/SQL語法。同時,IvorySQL通過增加與內核綁定的插件 ivorysql_ora 來實現兼容Oracle的功能,目前實現的功能包括內置函數、數據類型、系統視圖、merge以及GUC參數的增加,未來將會繼續以綁定內核的插件的形式來實現新的兼容功能。
IvorySQL 4.6 于 2025年9月10日發布,基于PostgreSQL 17.6版本,包括各種錯誤修復。有關更新的完整列表,請訪問文檔網站。
IvorySQL 核心應用場景
IvorySQL數據庫的主要應用場景:
1、企業數據庫
如 ERP、交易系統、財務系統涉及資金、客戶等信息,數據不能丟失且業務邏輯復雜,選擇 IvorySQL 作為數據底層存儲,一是可以幫助您在數據一致性前提下提供高可用性,二是可以用簡單的編程實現復雜的業務邏輯。
2、含 LBS 的應用
大型游戲、O2O 等應用需要支持世界地圖、附近的商家,兩個點的距離等能力,PostGIS 增加了對地理對象的支持,允許您以 SQL 運行位置查詢,而不需要復雜的編碼,幫助您更輕松理順邏輯,更便捷的實現 LBS,提高用戶粘性。
3、數據倉庫和大數據
IvorySQL 更多數據類型和強大的計算能力,能夠幫助您更簡單搭建數據庫倉庫或大數據分析平臺,為企業運營加分。
4、建站或 App
IvorySQL 良好的性能和強大的功能,可以有效的提高網站性能,降低開發難度。
5、數據庫遷移
如果需要將Oracle數據庫遷移到PostgreSQL數據庫,可以直接使用IvorySQL數據庫進行遷移。
IvorySQL 安裝部署
環境說明
| 主機名 | ip地址 | OS版本 | 內存、CPU | 安裝軟件 | 用途 |
|---|---|---|---|---|---|
| node1 | 192.*.*.60 | Centos7.9 | 4G 、 1個雙核 | IvorySQL 4.6數據庫 | 數據庫單節點 |
IvorySQL 安裝方式
IvorySQL安裝方式包括以下5種:
? yum源安裝
? docker安裝
? rpm安裝
? 源碼安裝
? deb安裝
IvorySQL 下載
下載地址:https://github.com/IvorySQL/IvorySQL/releases/tag/IvorySQL_4.6
本次體驗主要使用rpm安裝方式和源碼安裝方式安裝IvorySQL。兩種方式對應的安裝包下載方法:
cd /soft
# rpm安裝包下載
wget https://github.com/IvorySQL/IvorySQL/releases/download/IvorySQL_4.6/IvorySQL-4.6-adc1923-20250904.x86_64.rpm
# 源碼安裝包下載
wget https://github.com/IvorySQL/IvorySQL/archive/refs/tags/IvorySQL_4.6.tar.gz
[root@node1 soft]# ll
total 186316
-rw-r--r-- 1 root root 157130367 Sep 18 20:31 IvorySQL-4.6-adc1923-20250904.x86_64.rpm ##rpm安裝包
-rw-r--r-- 1 root root 33655973 Sep 18 20:31 IvorySQL-IvorySQL_4.6.tar.gz ##源碼安裝包
[root@node1 soft]#
rpm包安裝
安裝IvorySQL軟件
命令如下:
yum install -y lz4 libicu libxslt python3
cd /soft
yum --disablerepo=* localinstall *.rpm
安裝過程如下:
[root@node1 ~]# yum install -y lz4 libicu libxslt python3
略
[root@node1 ~]# cd /soft
[root@node1 soft]# ls
IvorySQL-4.6-adc1923-20250904.x86_64.rpm IvorySQL-IvorySQL_4.6.tar.gz
[root@node1 soft]# yum --disablerepo=* localinstall *.rpm
Loaded plugins: fastestmirror, langpacks
Examining IvorySQL-4.6-adc1923-20250904.x86_64.rpm: ivorysql4-4.6-adc1923.x86_64
Marking IvorySQL-4.6-adc1923-20250904.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package ivorysql4.x86_64 0:4.6-adc1923 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================================================================================================================
Installing:
ivorysql4 x86_64 4.6-adc1923 /IvorySQL-4.6-adc1923-20250904.x86_64 497 M
Transaction Summary
=============================================================================================================================================================================================================================================
Install 1 Package
Total size: 497 M
Installed size: 497 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : ivorysql4-4.6-adc1923.x86_64 1/1
Verifying : ivorysql4-4.6-adc1923.x86_64 1/1
Installed:
ivorysql4.x86_64 0:4.6-adc1923
Complete!
[root@node1 soft]#
安裝過程中會自動創建 ivorysql用戶和組,數據庫軟件被安裝在/usr/ivory-4/路徑下。
[root@node1 soft]# cd /usr/ivory-4/ [root@node1 ivory-4]# ll total 16 drwxr-xr-x 2 ivorysql ivorysql 4096 Sep 18 20:32 bin drwxr-xr-x 4 ivorysql ivorysql 4096 Sep 18 20:32 include drwxr-xr-x 6 ivorysql ivorysql 4096 Sep 18 20:32 lib drwxr-xr-x 8 ivorysql ivorysql 82 Sep 18 20:32 share [root@node1 ivory-4]#
切換到ivorysql用戶,配置環境變量:
su - ivorysql
vi .bash_profile 加入:
export PATH=/usr/ivory-4/bin:$PATH
export PGDATA=/usr/ivory-4/data
:wq
#環境變量生效
source .bash_profile
數據庫初始化
su - ivorysql mkdir /usr/ivory-4/data initdb -D /usr/ivory-4/data
初始化過程如下:
[root@node1 soft]# su - ivorysql Last login: Thu Sep 18 21:15:07 CST 2025 on pts/2 [ivorysql@node1 ~]$ exit logout [root@node1 soft]# cd /usr/ivory-4/ [root@node1 ivory-4]# ll total 16 drwxr-xr-x 2 ivorysql ivorysql 4096 Sep 18 20:32 bin drwxr-xr-x 4 ivorysql ivorysql 4096 Sep 18 20:32 include drwxr-xr-x 6 ivorysql ivorysql 4096 Sep 18 20:32 lib drwxr-xr-x 8 ivorysql ivorysql 82 Sep 18 20:32 share [root@node1 ivory-4]# su - ivorysql Last login: Thu Sep 18 21:22:10 CST 2025 on pts/2 [ivorysql@node1 ~]$ mkdir /usr/ivory-4/data [ivorysql@node1 ~]$ initdb -D /usr/ivory-4/data The files belonging to this database system will be owned by user "ivorysql". This user must also own the server process. The database cluster will be initialized with locale "en_US.UTF-8". The default database encoding has accordingly been set to "UTF8". The default text search configuration will be set to "english". Data page checksums are disabled. fixing permissions on existing directory /usr/ivory-4/data ... ok creating subdirectories ... ok selecting dynamic shared memory implementation ... posix selecting default "max_connections" ... 100 selecting default "shared_buffers" ... 128MB selecting default time zone ... Asia/Shanghai creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... ok syncing data to disk ... ok initdb: warning: enabling "trust" authentication for local connections initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. Success. You can now start the database server using: pg_ctl -D /usr/ivory-4/data -l logfile start [ivorysql@node1 ~]$
啟動數據庫
pg_ctl -D /usr/ivory-4/data -l /usr/ivory-4/data/ivory.log start
啟動數據庫過程如下:
[ivorysql@node1 ~]$ pg_ctl -D /usr/ivory-4/data -l /usr/ivory-4/data/ivory.log start
waiting for server to start.... done
server started
[ivorysql@node1 ~]$
查看數據庫進程:
[ivorysql@node1 ~]$ ps -ef|grep postgres ivorysql 5600 1 0 21:34 ? 00:00:00 /usr/ivory-4/bin/postgres -D /usr/ivory-4/data ivorysql 5601 5600 0 21:34 ? 00:00:00 postgres: checkpointer ivorysql 5602 5600 0 21:34 ? 00:00:00 postgres: background writer ivorysql 5604 5600 0 21:34 ? 00:00:00 postgres: walwriter ivorysql 5605 5600 0 21:34 ? 00:00:00 postgres: autovacuum launcher ivorysql 5606 5600 0 21:34 ? 00:00:00 postgres: logical replication launcher ivorysql 5622 5494 0 21:35 pts/2 00:00:00 grep --color=auto postgres [ivorysql@node1 ~]$
使用數據庫
psql連接數據庫
[ivorysql@node1 ~]$ psql
psql (17.6)
Type "help" for help.
[ivorysql@node1 ~]$ psql
psql (17.6)
Type "help" for help.
ivorysql=# \c
You are now connected to database "ivorysql" as user "ivorysql".
ivorysql=#
testdb=# select version();
version
---------------------------------------------------------------------------------------------
PostgreSQL 17.6 (IvorySQL 4.6) on x86_64-pc-linux-gnu, compiled by gcc (GCC) 10.4.0, 64-bit
(1 row)
testdb=# show port;
port
------
5432
(1 row)
ivorysql=# \l
List of databases
Name | Owner | Encoding | Locale Provider | Collate | Ctype | Locale | ICU Rules | Access privileges
-----------+----------+----------+-----------------+-------------+-------------+--------+-----------+-----------------------
ivorysql | ivorysql | UTF8 | libc | en_US.UTF-8 | en_US.UTF-8 | | |
postgres | ivorysql | UTF8 | libc | en_US.UTF-8 | en_US.UTF-8 | | |
template0 | ivorysql | UTF8 | libc | en_US.UTF-8 | en_US.UTF-8 | | | =c/ivorysql +
| | | | | | | | ivorysql=CTc/ivorysql
template1 | ivorysql | UTF8 | libc | en_US.UTF-8 | en_US.UTF-8 | | | =c/ivorysql +
| | | | | | | | ivorysql=CTc/ivorysql
(4 rows)
ivorysql=# create database testdb;
CREATE DATABASE
ivorysql=# \c testdb
You are now connected to database "testdb" as user "ivorysql".
testdb=# \du
List of roles
Role name | Attributes
-----------+------------------------------------------------------------
ivorysql | Superuser, Create role, Create DB, Replication, Bypass RLS
testdb=# create user testuser with password '********';
CREATE ROLE
testdb=# alter user testuser with superuser;
ALTER ROLE
testdb=# \c - testuser
You are now connected to database "testdb" as user "testuser".
testdb=# \dn
List of schemas
Name | Owner
--------+-------------------
public | pg_database_owner
(1 row)
testdb=# create schema testuser;
CREATE SCHEMA
testdb=# create table testtab(id int);
CREATE TABLE
testdb=# insert into testtab values(1),(2),(3);
INSERT 0 3
testdb=# \d
List of relations
Schema | Name | Type | Owner
----------+---------+-------+----------
testuser | testtab | table | testuser
(1 row)
testdb=#
dbeaver連接數據庫


源碼包安裝
創建組和用戶
groupadd ivorysql
useradd -u 5000 -g ivorysql ivorysql
echo "******" |passwd ivorysql --stdin
安裝依賴包
yum install -y bison readline-devel zlib-devel openssl-devel libicu-devel libxml2-devel
解壓安裝包
chown -R ivorysql:ivorysql /soft/
chown ivorysql:ivorysql /data
su - ivorysql
cd /soft
tar -zxvf /soft/IvorySQL-IvorySQL_4.6.tar.gz
解壓后目錄如下:
[ivorysql@node1 soft]$ ll total 32872 drwxrwxr-x 7 ivorysql ivorysql 4096 Sep 1 10:28 IvorySQL-IvorySQL_4.6 -rw-r--r-- 1 ivorysql ivorysql 33655973 Sep 18 20:31 IvorySQL-IvorySQL_4.6.tar.gz
配置、編譯、安裝
cd /soft/IvorySQL-IvorySQL_4.6/
./configure --prefix=/data/ivory-4/
make
make check
make install #執行以下命令安裝,數據庫將被安裝在上述由—prefix指定的路徑下。
./configure --prefix=/data/ivory-4/ 部分執行過程如下:
[ivorysql@node1 IvorySQL-IvorySQL_4.6]$ ./configure --prefix=/data/ivory-4/
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking which template to use... linux
checking whether NLS is wanted... no
checking whether CURSOR_UNNAME is wanted... checking for default port number... 5432
checking for default port number in oracle compatible mode... 1521
checking for block size... 8kB
checking for segment size... 1GB
checking for WAL block size... 8kB
checking for maximum number of arguments to a function... 100
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for gcc option to accept ISO C99... -std=gnu99
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for gawk... gawk
...略...
configure: using LDFLAGS= -Wl,--as-needed
configure: creating ./config.status
config.status: creating GNUmakefile
config.status: creating src/Makefile.global
config.status: creating src/include/pg_config.h
config.status: creating src/include/pg_config_ext.h
config.status: creating src/interfaces/ecpg/include/ecpg_config.h
config.status: linking src/backend/port/tas/dummy.s to src/backend/port/tas.s
config.status: linking src/backend/port/posix_sema.c to src/backend/port/pg_sema.c
config.status: linking src/backend/port/sysv_shmem.c to src/backend/port/pg_shmem.c
config.status: linking src/include/port/linux.h to src/include/pg_config_os.h
config.status: linking src/makefiles/Makefile.linux to src/Makefile.port
[ivorysql@node1 IvorySQL-IvorySQL_4.6]$
make部分執行過程如下:
gcc -std=gnu99 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -fPIC -fvisibility=hidden -I. -I. -I../../src/include -D_GNU_SOURCE -c -o btree_number.o btree_number.c
gcc -std=gnu99 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -fPIC -fvisibility=hidden -I. -I. -I../../src/include -D_GNU_SOURCE -c -o btree_interval.o btree_interval.c
gcc -std=gnu99 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -fPIC -fvisibility=hidden -I. -I. -I../../src/include -D_GNU_SOURCE -c -o btree_binary_float.o btree_binary_float.c
gcc -std=gnu99 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -fPIC -fvisibility=hidden -I. -I. -I../../src/include -D_GNU_SOURCE -c -o btree_binary_double.o btree_binary_double.c
gcc -std=gnu99 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -fPIC -fvisibility=hidden -I. -I. -I../../src/include -D_GNU_SOURCE -c -o btree_varcharchar.o btree_varcharchar.c
gcc -std=gnu99 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -fPIC -fvisibility=hidden -I. -I. -I../../src/include -D_GNU_SOURCE -c -o btree_timestamp.o btree_timestamp.c
gcc -std=gnu99 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -fPIC -fvisibility=hidden -I. -I. -I../../src/include -D_GNU_SOURCE -c -o btree_yminterval.o btree_yminterval.c
gcc -std=gnu99 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -fPIC -fvisibility=hidden -I. -I. -I../../src/include -D_GNU_SOURCE -c -o btree_dsinterval.o btree_dsinterval.c
gcc -std=gnu99 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -fPIC -fvisibility=hidden -I. -I. -I../../src/include -D_GNU_SOURCE -c -o btree_utils_num.o btree_utils_num.c
gcc -std=gnu99 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -fPIC -fvisibility=hidden -I. -I. -I../../src/include -D_GNU_SOURCE -c -o btree_utils_var.o btree_utils_var.c
gcc -std=gnu99 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -fPIC -fvisibility=hidden -shared -o ora_btree_gist.so btree_gist.o btree_number.o btree_interval.o btree_binary_float.o btree_binary_double.o btree_varcharchar.o btree_timestamp.o btree_yminterval.o btree_dsinterval.o btree_utils_num.o btree_utils_var.o -L../../src/port -L../../src/common -Wl,--as-needed -Wl,-rpath,'/data/ivory-4/lib',--enable-new-dtags -fvisibility=hidden -lm
make[1]: Leaving directory `/soft/IvorySQL-IvorySQL_4.6/contrib/ora_btree_gist'
make -C contrib/ora_btree_gin all
make[1]: Entering directory `/soft/IvorySQL-IvorySQL_4.6/contrib/ora_btree_gin'
gcc -std=gnu99 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -fPIC -fvisibility=hidden -I. -I. -I../../src/include -D_GNU_SOURCE -c -o ora_btree_gin.o ora_btree_gin.c
gcc -std=gnu99 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -fPIC -fvisibility=hidden -shared -o ora_btree_gin.so ora_btree_gin.o -L../../src/port -L../../src/common -Wl,--as-needed -Wl,-rpath,'/data/ivory-4/lib',--enable-new-dtags -fvisibility=hidden
make[1]: Leaving directory `/soft/IvorySQL-IvorySQL_4.6/contrib/ora_btree_gin'
[ivorysql@node1 IvorySQL-IvorySQL_4.6]$
編譯完畢,安裝之前可先執行make check或make all-check-world測試剛剛編譯的結果。
make check部分執行過程如下:
# parallel group (13 tests): predicate hash_part reloptions explain partition_info memoize compression stats partition_aggregate partition_join indexing partition_prune tuplesort
ok 205 + partition_join 4356 ms
ok 206 + partition_prune 4594 ms
ok 207 + reloptions 387 ms
ok 208 + hash_part 309 ms
ok 209 + indexing 4491 ms
ok 210 + partition_aggregate 4077 ms
ok 211 + partition_info 522 ms
ok 212 + tuplesort 5113 ms
ok 213 + explain 518 ms
ok 214 + compression 873 ms
ok 215 + memoize 795 ms
ok 216 + stats 2765 ms
ok 217 + predicate 261 ms
# parallel group (2 tests): oidjoins event_trigger
ok 218 + oidjoins 464 ms
ok 219 + event_trigger 520 ms
ok 220 - event_trigger_login 58 ms
ok 221 - fast_default 333 ms
ok 222 - tablespace 780 ms
1..222
# All 222 tests passed.
make[1]: Leaving directory `/soft/IvorySQL-IvorySQL_4.6/src/test/regress'
[ivorysql@node1 IvorySQL-IvorySQL_4.6]$
make install安裝部分執行過程如下:
make[1]: Leaving directory `/soft/IvorySQL-IvorySQL_4.6/src'
make -C config install
make[1]: Entering directory `/soft/IvorySQL-IvorySQL_4.6/config'
/bin/mkdir -p '/data/ivory-4/lib/postgresql/pgxs/config'
/bin/install -c -m 755 ./install-sh '/data/ivory-4/lib/postgresql/pgxs/config/install-sh'
/bin/install -c -m 755 ./missing '/data/ivory-4/lib/postgresql/pgxs/config/missing'
make[1]: Leaving directory `/soft/IvorySQL-IvorySQL_4.6/config'
make -C contrib/ivorysql_ora install
make[1]: Entering directory `/soft/IvorySQL-IvorySQL_4.6/contrib/ivorysql_ora'
'/bin/perl' gensql.pl gcc_build 1.0
/bin/mkdir -p '/data/ivory-4/lib/postgresql'
/bin/mkdir -p '/data/ivory-4/share/postgresql/extension'
/bin/mkdir -p '/data/ivory-4/share/postgresql/extension'
/bin/install -c -m 755 ivorysql_ora.so '/data/ivory-4/lib/postgresql/ivorysql_ora.so'
/bin/install -c -m 644 ./ivorysql_ora.control '/data/ivory-4/share/postgresql/extension/'
/bin/install -c -m 644 ./ivorysql_ora--1.0.sql '/data/ivory-4/share/postgresql/extension/'
make[1]: Leaving directory `/soft/IvorySQL-IvorySQL_4.6/contrib/ivorysql_ora'
make -C contrib/ora_btree_gist install
make[1]: Entering directory `/soft/IvorySQL-IvorySQL_4.6/contrib/ora_btree_gist'
/bin/mkdir -p '/data/ivory-4/lib/postgresql'
/bin/mkdir -p '/data/ivory-4/share/postgresql/extension'
/bin/mkdir -p '/data/ivory-4/share/postgresql/extension'
/bin/install -c -m 755 ora_btree_gist.so '/data/ivory-4/lib/postgresql/ora_btree_gist.so'
/bin/install -c -m 644 ./ora_btree_gist.control '/data/ivory-4/share/postgresql/extension/'
/bin/install -c -m 644 ./ora_btree_gist--1.0.sql '/data/ivory-4/share/postgresql/extension/'
make[1]: Leaving directory `/soft/IvorySQL-IvorySQL_4.6/contrib/ora_btree_gist'
make -C contrib/ora_btree_gin install
make[1]: Entering directory `/soft/IvorySQL-IvorySQL_4.6/contrib/ora_btree_gin'
/bin/mkdir -p '/data/ivory-4/lib/postgresql'
/bin/mkdir -p '/data/ivory-4/share/postgresql/extension'
/bin/mkdir -p '/data/ivory-4/share/postgresql/extension'
/bin/install -c -m 755 ora_btree_gin.so '/data/ivory-4/lib/postgresql/ora_btree_gin.so'
/bin/install -c -m 644 ./ora_btree_gin.control '/data/ivory-4/share/postgresql/extension/'
/bin/install -c -m 644 ./ora_btree_gin--1.0.sql '/data/ivory-4/share/postgresql/extension/'
make[1]: Leaving directory `/soft/IvorySQL-IvorySQL_4.6/contrib/ora_btree_gin'
切換到ivorysql用戶,配置環境變量:
su - ivorysql
vi .bash_profile 加入:
export PATH=/usr/ivory-4/bin:$PATH
export PGDATA=/usr/ivory-4/data
:wq
source .bash_profile
數據庫初始化
[ivorysql@node1 ~]$ initdb -D /usr/ivory-4/data
The files belonging to this database system will be owned by user "ivorysql".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
creating directory /usr/ivory-4/data ... initdb: error: could not create directory "/usr/ivory-4": Permission denied
[ivorysql@node1 ~]$ initdb -D /data/ivory-4/data
The files belonging to this database system will be owned by user "ivorysql".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
fixing permissions on existing directory /data/ivory-4/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default "max_connections" ... 100
selecting default "shared_buffers" ... 128MB
selecting default time zone ... Asia/Shanghai
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok
initdb: warning: enabling "trust" authentication for local connections
initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb.
Success. You can now start the database server using:
pg_ctl -D /data/ivory-4/data -l logfile start
數據庫啟動
[ivorysql@node1 ~]$ pg_ctl -D /data/ivory-4/data -l /data/ivory-4/data/ivory.log start
waiting for server to start.... done
server started
[ivorysql@node1 ~]$ ps -ef|grep postgres
ivorysql 34591 1 0 22:00 ? 00:00:00 /data/ivory-4/bin/postgres -D /data/ivory-4/data
ivorysql 34592 34591 0 22:00 ? 00:00:00 postgres: checkpointer
ivorysql 34593 34591 0 22:00 ? 00:00:00 postgres: background writer
ivorysql 34595 34591 0 22:00 ? 00:00:00 postgres: walwriter
ivorysql 34596 34591 0 22:00 ? 00:00:00 postgres: autovacuum launcher
ivorysql 34597 34591 0 22:00 ? 00:00:00 postgres: logical replication launcher
ivorysql 34600 34511 0 22:00 pts/1 00:00:00 grep --color=auto postgres
[ivorysql@node1 ~]$
總結
本文主要是使用rpm包和二進制安裝包兩種方式部署了ivorysql數據庫,后面會介紹oracle數據庫遷移到ivorysql數據庫的過程,敬請期待~~~
關于作者
網名:飛天,墨天輪2024年度優秀原創作者,擁有 Oracle 10g OCM 認證、PGCE認證、MySQL 8.0 OCP認證以及OBCA、KCP、KCSM、ACP、YCP、磐維等眾多國產數據庫認證證書,目前從事Oracle、Mysql、PostgresSQL、磐維數據庫管理運維工作,喜歡結交更多志同道合的朋友,熱衷于研究、分享數據庫技術。
微信公眾號:飛天online
墨天輪:http://www.sunline.cc/u/15197
如有任何疑問,歡迎大家留言,共同探討~~~




