如何为 Oracle goldengate BigQuery 适配器设置 gg.classpath

How to setup gg.classpath for Oracle goldengate BigQuery Adapter

我正在尝试为 Oracle golden gate (12c) 配置 BigQuery 适配器。但不幸的是,我无法理解这一点 gg.classpath。在文档中,他们提到从 GitHub

下载客户端 Lib

但是文件夹太多了,不知道下载到哪个文件夹,复制到哪里

我们也下载了一些JAR文件,放在一个目录下。

Next, download the following JARs from Maven Central, and then include them in the classpath for the BigQuery Handler:

我可以把这些 JAR 文件放在哪里?

谁能给我一个例子来配置 gg.classpath

Oracle 文档 link: https://docs.oracle.com/en/middleware/goldengate/big-data/12.3.2.1/gadbd/using-bigquery-handler.html#GUID-A8426075-81E8-47AB-BA15-3C564751A490

示例 gg.classpathgg.classpath= /path_to_repository/bigquery/libs/*:/path_to_repository/bigquery/*

您可以按照文档中的说明从 maven 下载 jars 文件。下载 jar 文件后,您可以将它们放在安装了 Oracle GoldenGate for BigData 的 server/machine 的任何目录中。比方说 /u01/OGG。之后,您可以将该目录包含在类路径中,如下所示。

示例: gg.classpath=dirprm:/u01/OGG/jdk1.8.0_221/:/u01/OGG/oci-java-sdk/lib/:/u01/OGG/oci-java-sdk/third-party/lib/:/u01/OGG/hdfs_jar/: /u01/OGG/parquet_jar/*

在上面的示例中,我下载了 OCI Handler、Parquet Handler 及其依赖项并将它们放在路径 /u01/OGG/ 中。这里handler_name是oci-java-sdk和parquet_jar.

这里只留下答案,以便其他人可以从中受益。

-- Steps for manually build the jar files
-- Or download all the jar from the above link and skip all these steps.

apt install maven
git clone https://github.com/googleapis/google-api-java-client-services.git
cd google-api-java-client-services/clients/google-api-services-bigquery/v2/1.29.2/
mvn clean install

-- Copy all the jar files to /opt/ogg/jar
mkdir -p /opt/ogg/jar
cp target/*.jar /opt/ogg/jar

-- We also need to download the following JARs from Maven Central
-- download path /opt/ogg/jar

api-common-1.6.0.jar
gax-1.28.0.jar
gax-httpjson-0.45.0.jar
google-auth-library-credentials-0.9.1.jar
google-auth-library-oauth2-http-0.9.1.jar
google-cloud-bigquery-1.31.0.jar
google-cloud-core-1.35.0.jar
google-cloud-core-http-1.35.0.jar
google-http-client-jackson-1.23.0.jar
guava-25.1-jre.jar
threetenbp-1.3.6.jar

或者我有一个包含所有必要文件的 zip 文件。可以从下方link获取。 https://github.com/BhuviTheDataGuy/medium-blog-files/raw/master/golden-gate-bigquery/jar-files.zip

有关从 Oracle 到 BigQuery 的更详细的分步设置,请参阅下面的 link。 https://medium.com/searce/sync-oracle-to-bigquery-with-golden-gate-bigquery-adapter-59991bbdb5e3