Skip to content

Commit f77fa9b

Browse files
author
Cary Huang
committed
reupload snapshot engine page
1 parent 8145521 commit f77fa9b

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

docs/en/user-guide/configure_snapshot_engine.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,63 @@ SELECT synchdb_start_engine_bgw('olrconn', 'schemasync');
2525

2626
## **Build and Install oracle_fdw**
2727

28+
If "fdw" is selected as snapshot engine, you need to ensure the corresponding Foreign Data Wrapper has been installed or available for synchdb. For your reference, below is a brief procedure to build and install oracle_fdw from source code.
2829

30+
### **Install OCI**
2931

32+
OCI is required to build and run oracle_fdw. For this example, I am using version 23.9.0:
3033

34+
```bash
35+
# Get the pre-build packages:
36+
wget https://download.oracle.com/otn_software/linux/instantclient/2390000/instantclient-basic-linux.x64-23.9.0.25.07.zip
37+
wget https://download.oracle.com/otn_software/linux/instantclient/2390000/instantclient-sdk-linux.x64-23.9.0.25.07.zip
38+
39+
# unzip them: Select 'Y' to overwrite metadata files
40+
unzip instantclient-basic-linux.x64-23.9.0.25.07.zip
41+
unzip instantclient-sdk-linux.x64-23.9.0.25.07.zip
42+
```
43+
44+
Update environment variables so the system knows where to find OCI headers and libraries.
45+
46+
```bash
47+
export OCI_HOME=/home/$USER/instantclient_23_9
48+
export OCI_LIB_DIR=$OCI_HOME
49+
export OCI_INC_DIR=$OCI_HOME/sdk/include
50+
export LD_LIBRARY_PATH=$OCI_HOME:${LD_LIBRARY_PATH}
51+
export PATH=$OCI_HOME:$PATH
52+
53+
```
54+
55+
You could add the above commands to the end of `~/.bashrc` to automatically set the PATHs every time you login to your system.
56+
57+
You can also add $OCI_HOME to `/etc/ld.so.conf.d/x86_64-linux-gnu.conf` (ubuntu example), as a new path to find shared libraries.
58+
59+
You should do a ldconfig so your linker knows where to find shared libraries:
60+
61+
### **Build oracle_fdw 2.8.0**
62+
63+
```bash
64+
git clone https://github.com/laurenz/oracle_fdw.git --branch ORACLE_FDW_2_8_0
65+
66+
```
67+
68+
Ensure oracle_fdw's Makefile can find OCI includes and libraries by adjusting these 2 lines in Makefile:
69+
70+
```bash
71+
FIND_INCLUDE := $(wildcard /usr/include/oracle/*/client64 /usr/include/oracle/*/client /home/$USER/instantclient_23_9/sdk/include)
72+
FIND_LIBDIRS := $(wildcard /usr/lib/oracle/*/client64/lib /usr/lib/oracle/*/client/lib /home/$USER/instantclient_23_9)
73+
74+
```
75+
76+
Build and install oracle_fdw:
77+
78+
```bash
79+
make PG_CONFIG=/usr/local/pgsql/bin/pg_config
80+
sudo make install PG_CONFIG=/usr/local/pgsql/bin/pg_config
81+
82+
```
83+
84+
Oralce_fdw is ready to go.
85+
86+
**<<IMPORTANT>>** You do not have to run `CREATE EXTENSION oracle_fdw` prior to using FDW based initial snapshot, nor do you have to `CREATE SERVER` or `CREATE USER MAPPING`. SynchDB takes care of all of these when it performs the snapshot..
3187

0 commit comments

Comments
 (0)