You can install OceanBase LogMiner (oblogminer) by using yum commands or the installation package. Choose an installation method as needed.
Note
This topic describes how to install oblogminer of Community Edition. oblogminer of Enterprise Edition is automatically installed during the deployment of OceanBase Database.
Install oblogminer by using yum commands
You can use yum commands to directly install OceanBase Utils and then use oblogminer.
Add an image source.
[admin@test001 ~]$ sudo yum-config-manager --add-repo https://mirrors.aliyun.com/oceanbase/OceanBase.repoInstall OceanBase Utils.
[admin@test001 ~]$ sudo yum install oceanbase-ce-utilsView the help information of oblogminer.
After the installation succeeds, you can run the following command to view the help information of oblogminer:
[admin@test001 ~]$ oblogminer -h
Install oblogminer by using the OceanBase Utils installation package
You can install OceanBase Utils and then use oblogminer.
Search for
OceanBase Utilsin the OceanBase Download Center and then download the required version.Run the following command under the directory where OceanBase Utils resides:
[admin@test001 ~]$ sudo rpm -ivh oceanbase-ce-utils-<version>.rpmIf you need only oblogminer, run the following rpm2cpio command to obtain oblogminer:
[admin@test001 ~]$ rpm2cpio oceanbase-ce-utils-<version> | cpio -idmv ./usr/bin/oblogminerWhen using the rpm2cpio command, run the following command after the deployment completes to copy
oblogminerto the/usr/local/bindirectory:[admin@test001 ~]$ sudo cp usr/bin/oblogminer /usr/local/binView the help information of oblogminer.
After the installation succeeds, you can run the following command to view the help information of oblogminer:
[admin@test001 ~]$ oblogminer -h
Compile oblogminer by using the source code
You can also compile oblogminer by using the source code of OceanBase Database.
Pull the open source code of OceanBase Database to your local server.
[admin@test001 ~]$ git clone https://github.com/oceanbase/oceanbase.gitRun the following command under the code directory to switch to branch 4.2.x:
[admin@test001 oceanbase]$ git checkout 4.2.xSelect one of the following compilation methods to compile oblogminer:
Debug mode
Execute the build.sh script and specify the debug mode.
[admin@test001 oceanbase]$ bash build.sh debug --initEnter the compilation directory.
[admin@test001 oceanbase]$ cd build_debugCompile oblogminer.
[admin@test001 build_debug]$ make oblogminerCopy the compiled files to the
/usr/local/bindirectory.[admin@test001 build_debug]$ sudo cp src/logservice/logminer/oblogminer /usr/local/binBy default, after you compile oblogminer, you can find the compiled files in the
<DEBUG_BUILD_DIR>/src/logservice/logminerdirectory.<DEBUG_BUILD_DIR>indicates the compilation directory, which isbuild_debugin debug mode.Release mode
Execute the build.sh script and specify the release mode.
[admin@test001 oceanbase]$ bash build.sh release --initEnter the compilation directory.
[admin@test001 oceanbase]$ cd build_releaseCompile oblogminer.
[admin@test001 build_release]$ make oblogminerCopy the compiled files to the
/usr/local/bindirectory.[admin@test001 build_release]$ sudo cp src/logservice/logminer/oblogminer /usr/local/binBy default, after you compile oblogminer, you can find the compiled files in the
<DEBUG_BUILD_DIR>/src/logservice/logminerdirectory.<DEBUG_BUILD_DIR>indicates the compilation directory, which isbuild_releasein release mode.
View the help information of oblogminer.
After the compilation succeeds, you can run the following command to view the help information of oblogminer:
[admin@test001 ~]$ oblogminer -h
FAQ
What do I do if the following error occurs due to the missing dynamic library libmariadb.so.3 when I use oblogminer?
oblogminer: error while loading shared libraries: libmariadb.so.3: cannot open shared object file: No such file or directory
The libmariadb.so.3 dynamic library is built in OceanBase Database. You can use the find command to find its path and then set the environment variable to specify the dynamic library search path. The procedure is as follows:
Run the
findcommand to find the path oflibmariadb.so.3.[admin@test001 ~]$ find / -name libmariadb.so.3The path of
libmariadb.so.3is returned iflibmariadb.so.3exists in the environment, as shown in the following example:/home/admin/observer/lib/libmariadb.so.3Set the
LD_LIBRARY_PATHenvironment variable to specify the dynamic library search path.[admin@test001 ~]$ export LD_LIBRARY_PATH=/home/admin/observer/lib
After performing the preceding steps, you can use the oblogminer command. For more information about the oblogminer command, see Command-line options.