OceanBase product family and basic concepts, importing data, OceanBase supports multiple client tools, black screen tools, white screen tools, connecting MySQL tenants through MySQL client

Chapter 2: OceanBase Product Family and Basic Concepts

2. Import data

2.1 OceanBase supports multiple client tools

2.1.1 Black Screen Tool

insert image description here

2.1.1.1 OceanBase client

OceanBase client (OBClient) is also compatible with MySQL and Oracle tenants accessing OceanBase, so it is the recommended black screen client tool.

2.1.1.2 MySQL client

OceanBase is fully compatible with the MySQL protocol, and you can use a standard MySQL client to connect to OceanBase's MySQL tenant. It is recommended to use version 5.6 or 5.7 of the MySQL client

2.1.2 White Screen Tool

insert image description here

2.1.2.1 OceanBase cloud platform

It not only provides full lifecycle management services for components such as OceanBase clusters and tenants, but also provides management services for OceanBase-related resources (hosts, networks, software packages, etc.)

2.1.2.2 OceanBase Developer Center

Enterprise-level database development platform. ODC supports connecting to MySQL and Oracle databases in OceanBase, and provides database developers with functions such as daily database development operations, WebSQL, SQL diagnosis, session management, and data import and export.

2.2 Connect to the MySQL tenant through the MySQL client

When you need to use the MySQL tenant of OceanBase, you can use the MySQL client to connect to the tenant

2.2.1 Operation steps

• Open a command line terminal and make sure that the environment variable PATH includes the directory where the MySQL client command is located
• Refer to the following format to provide the running parameters of MySQL
$mysql -h192.168.1.101 -uroot@obmysql#obdemo -P2883 -pabcABC123 -c -A ocean base

2.2.2 Parameter description

• -h: Provide the OceanBase database connection IP, usually an OBProxy address
• -u: Provide the tenant's connection account, in two formats: username@tenantname#clustername or clustername:tenantname:username. The administrator username of the MySQL tenant is root by
default • -P: Provide the OceanBase database connection port, which is also the listening port of OBProxy
. Input at the following prompt, the password text is invisible
• -c: Indicates that comments should not be ignored in the MySQL operating environment
• -A: Indicates that statistical information is not automatically obtained when MySQL connects to the database
• oceanbase: The name of the database accessed, which can be changed to business database

After the connection is successful, there will be a command line prompt by default: MySQL [oceanbase]>. If you want to exit the OceanBase command line, enter exit and press Enter, or press the shortcut key ctrl + d

2.3 Connect to OceanBase tenants through obclient

Obclient is a command-line client tool dedicated to OceanBase. Through obclient, you can connect to OceanBase's MySQL and ORACLE tenants. Refer to the following format to provide obclient operating parameters: $ obclient -h192.168.1.101 -usys@t_oracle0_91#obdoc -P2883 -pabcABC123
-c -A sys

2.3.1 Explanation:

• -h: Provide the IP of the OceanBase database connection, usually an OBProxy address.
• -u: Provide the connection account of the tenant. There are two formats: "username@tenantname#clustername" or "clustername:tenantname:username". The administrator username for the Oracle tenant is sys by default.
• -P: Provide the OceanBase database connection port, which is also the listening port of OBProxy. The default is 2883, which can be customized.
• -p: Provide the account password. For the sake of security, it can not be provided. Instead, enter it at the prompt later, and the password text will not be visible.
• -C: Indicates that the comments in the SQL statement are sent to the database side.
• -A: Indicates not to obtain all table information when connecting to the database, which can make the login to the database the fastest. .sys: The name of the accessed database, which can be changed to a business database.

• After the connection is successful, there will be the following command line prompt by default, obclient>,
• If you want to exit the OceanBase command line, enter exit and press Enter, or press the shortcut key ctrl + d.

2.4 Java database connection driver

• OceanBase implements its own JDBC driver, enabling Java to send SQL statements to OceanBase's MySQL and Oracle tenants. OceanBase JDBC supports exposing SQL data types, PL/SQL objects for Java, and quickly accessing SQL data
• OceanBase JDBC driver file name: oceanbase-client-[version number].jar
• OceanBase database driver file 1.0 related version class name :com.alipay.oceanbase.obproxy.mysql.jdbc.Driver
• The class name of the OceanBase database driver file changed from 1.1.0 to: com.alipay.oceanbase.jdbc.Driver, the original class name will be retained, but it is not recommended to use

The MySQL tenant of OceanBase is compatible with the MySQL connection protocol, and the MySQL tenant of OceanBase can be connected using the standard MySQL JDBC. But JDBC does not support Oracle tenant's connection protocol by default

2.5 Connect to OceanBase database through ODC

On the create connection page, select the connection mode as MySQL/Oracle, enter the connection name, host name, port, cluster, tenant, database user name, and database password on the page, and click Save. If it can be saved successfully, it means that the connection to the database is successful.

insert image description here

2.6 About data migration and synchronization

• Migrate data from traditional databases to OceanBase databases, you can choose to export data as CSV files, SQL files, and then import them into OceanBase • You can also use
OceanBase products DataX or OMS to do offline or online data between traditional databases and OceanBase Migration
• Note: When the data volume of data migration is very large, if the migration speed is fast, the incremental memory consumption of OceanBase may be faster than the memory release speed of dumping and merging. At this time, it is necessary to modify the parameters for data migration, or limit the speed of memory writing, or expand the memory of the instance

2.7 Introduction to DataX, a general data synchronization framework

• DataX is an offline data synchronization tool/platform widely used in Alibaba Group, including MySQL, Oracle, SqlServer, Postgre, HDFS, Hive, ADS, HBase, TableStore(OTS), MaxCompute(ODPS), DRDS and OceanBase, etc. Efficient data synchronization function between various heterogeneous data sources
DataX itself acts as a data synchronization framework, abstracting the synchronization of different data sources into a Reader plug-in that reads data from the source data source, and a Writer plug-in that writes data to the target end In theory, the DataX framework can support data synchronization of any data source type
• After DataX is installed, the default directory is /home/admin/datax3. There is a folder job under the directory, which stores the configuration file of the data migration task by default. Of course, the directory can also be customized. • The
parameter file of each task is a json format, mainly composed of a reader and a writer. There is a default sample task configuration file job.json under the job folder
• DataX official website supports reading and writing plug-ins for most mainstream data sources, and has detailed usage documents. For Oracle database, use oraclereader and oraclewriter plug-ins to read and write

Guess you like

Origin blog.csdn.net/Redamancy06/article/details/128048321