Before you run OBLOADER & OBDUMPER, make sure that you have the appropriate operating environment and privileges.
Operating environment configurations
| Configuration item | Requirements |
|---|---|
| OS | Linux, macOS, and Windows 7 or later |
| Java environment | Install Oracle JDK 1.8.0_3xx, and configure the JAVA_HOME environment variable. |
| Character sets | We recommend that you use UTF-8 as the file character set. |
| Java virtual machine (JVM) parameters | Modify the JVM memory parameter in the bin/obloader and bin/obdumper scripts to avoid JVM memory insufficiency. |
Note
Some minor versions of OpenJDK 1.8 have serious garbage collection (GC) bugs. OBLOADER & OBDUMPER may run out of memory or hang. Therefore, you need to install the latest minor version of OpenJDK 1.8.
Privileges
OBLOADER
When you use OBLOADER to import data to an OceanBase database, the account used to connect to the database must have the privileges to execute the CREATE, SELECT, INSERT, and UPDATE statements. You can view the privileges granted to a user by using the SHOW GRANTS statement. Sample code:
obclient> SHOW GRANTS FOR user1;
+------------------------------------------+
| Grants for user1@% |
+------------------------------------------+
| GRANT CREATE ON *.* TO 'user1' |
| GRANT SELECT ON `db1`.* TO 'user1' |
| GRANT INSERT ON `db1`.* TO 'user1' |
| GRANT UPDATE ON `db1`.* TO 'user1' |
| GRANT SELECT ON `oceanbase`.* TO 'user1' |
+------------------------------------------+
2 rows in set
OBDUMPER
When you use OBDUMPER to export data from an OceanBase database, the account used to connect to the database must have the privileges to execute the CREATE and SELECT statements. You can view the privileges granted to a user by using the SHOW GRANTS statement. Sample code:
obclient> SHOW GRANTS FOR user1;
+------------------------------------------+
| Grants for user1@% |
+------------------------------------------+
| GRANT CREATE ON *.* TO 'user1' |
| GRANT SELECT ON `db1`.* TO 'user1' |
| GRANT SELECT ON `oceanbase`.* TO 'user1' |
+------------------------------------------+
2 rows in set
Note
For OceanBase Database of a version earlier than V4.0.0, the
--sys-userand--sys-passwordoptions must be specified on the command lines of OBLOADER and OBDUMPER.For more information, see Scenarios and examples in the “OBLOADER” chapter and Scenarios and examples in the “OBDUMPER” chapter.
The
–sys-userand–sys-passwordoptions must be set to the username and password of a user with system table and view query privileges in the sys tenant.For more information about the privileges, see View user privileges, Users and privileges, and Modify user privileges.