Configuring a Database Connection in Linux
To create a database connection in Linux for Oracle GoldenGate processes,
create a DSN (Data Source Name) inside the /etc/odbc.ini
file.
Multiple DSNs can be part of the same ODBC file.
-
Data Source Name
: A user defined name of a source or target database connection that will be referenced by Oracle GoldenGate processes, such as Extract or Replicat. DSN names are allowed up to 32 alpha-numeric characters in length, and can include only underscore (_) and dash (-) from special characters.
-
IANAAppCodePage=4
: Is the default setting but can be modified according to the guidance specified on the https://docs.progress.com/bundle/datadirect-connect-odbc-71/page/IANAAppCodePage_9.html#IANAAppCodePage_9 page when the database character set is not Unicode. -
InstallDir
: Is the value of the Oracle GoldenGate installation path, for example:/u01/app/ogg
. -
Driver
: For Oracle GoldenGate release versions prior to 21.8, set to/GoldenGate_Installation_Path/lib/GGpsql25.so
.For Oracle GoldenGate release versions 21.8 and later, set the value to
/<GoldenGate_Installation_Path>/datadirect/lib/ggpsql25.so
. -
Database
: Is the name of the source or target database. -
HostName
: Is the database host IP address or host name. -
PortNumber
: Is the listening port of the database. -
You can also provide a
LogonID
andPassword
for the Extract or Replicat user, but these will be stored in clear text. It is recommended to leave these fields out of the DSN and instead store them in the Oracle GoldenGate wallet as a credential alias, and reference them with theUSERIDALIAS
parameter in Extract and Replicat.
The following is a sample /etc/odbc.ini
file with two
DSN entries. The Data Source names used in the example below are
PG_src
and PG_tgt.
-
Create a DSN for each source or target database in the
/etc/odbc.ini
file.sudo vi /etc/odbc.ini
#Sample DSN entries [ODBC Data Sources]
PG_src=Oracle GoldenGate PostgreSQL Wire Protocol
PG_tgt=Oracle GoldenGate PostgreSQL Wire Protocol
[ODBC] IANAAppCodePage=4 InstallDir=/u01/app/ogg
[PG_src]
Driver=/u01/app/ogg/datadirect/lib/ggpsql25.so
Description=Oracle GoldenGate PostgreSQL Wire Protocol
Database=sourcedb
HostName=remotehost
PortNumber=5432
[PG_tgt]
Driver=/u01/app/ogg/datadirect/lib/ggpsql25.so
Description=Oracle GoldenGate PostgreSQL Wire Protocol
Database=targetdb
HostName=remotehost
PortNumber=5432
-
Save and close the
odbc.ini
file.
Note:
You can enableODBC
tracing without changing the
ODBCINI
file using the ODBCTRACE parameter. See
ODBCTRACE
in Parameters and Functions Reference
for Oracle GoldenGate.