Before you run OBLOADER & OBDUMPER, make sure that you have the appropriate operating environment and privileges.
Operating environment
| 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 set | 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. Here is an example:
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
Note
The account must also have the SELECT privilege on the oceanbase database.
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. Here is an example:
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
The account must also have the SELECT privilege on the oceanbase database.
Other considerations
For OceanBase Database of a version earlier than V4.0.0, the
--sys-userand--sys-passwordoptions must be specified on the command line of OBLOADER & OBDUMPER.For more information, see Command-line options of OBLOADER and Command-line options of OBDUMPER.
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, Overview, and Modify user privileges.