当前位置:网站首页>Oceanbase Database Setup Test
Oceanbase Database Setup Test
2022-07-24 12:08:00 【xcSpark】
OceanBase The community version is an open source distributed HTAP(Hybrid Transactional/Analytical Processing) Database management system
Download mirroring , start-up
[[email protected] ~]# docker pull oceanbase/oceanbase-ce
Using default tag: latest
latest: Pulling from oceanbase/oceanbase-ce
13add961a70d: Pull complete
c8175aff0e18: Pull complete
39c994bcc219: Pull complete
71a870d28c6f: Pull complete
Digest: sha256:6c3f458abc38a017e604af1188726174b6dc81f38c96e2869dc2cb04931a8cd8
Status: Downloaded newer image for oceanbase/oceanbase-ce:latest
# deploy mini standalone instance
docker run -p 2881:2881 --name obstandalone -e MINI_MODE=1 -d oceanbase/oceanbase-ce
$ docker logs obstandalone | tail -1
boot success!
[[email protected] ~]# docker exec -it obstandalone ob-mysql sys # Connect to sys tenant
login as [email protected]
Command is: obclient -h127.1 [email protected] -A -Doceanbase -P2881
Welcome to the OceanBase. Commands end with ; or \g.
Your OceanBase connection id is 3221487642
Server version: 5.7.25 OceanBase 3.1.4 (r10000092022071511-b4bfa011ceaef428782dcb65ae89190c40b78c2f) (Built Jul 15 2022 11:45:14)
Copyright (c) 2000, 2022, OceanBase and/or its affiliates. All rights reserved.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
obclient [oceanbase]>
#utf8
#ue ctrl+h Edit the file
#0x0f
docker cp test.txt obstandalone:/tmp
#,
docker cp test2.txt obstandalone:/tmp
LAOD grammar
LOAD DATA
[/*+ parallel(N) load_batch_size(M)*/]
INFILE 'file_name'
[REPLACE | IGNORE]
INTO TABLE tbl_name
[{
FIELDS | COLUMNS}
[TERMINATED BY 'string']
[[OPTIONALLY] ENCLOSED BY 'char']
[ESCAPED BY 'char']
]
[LINES
[STARTING BY 'string']
[TERMINATED BY 'string']
]
[IGNORE number {
LINES | ROWS}]
[(col_name_var
[, col_name_var] ...)]
[SET col_name={
expr | DEFAULT},
[, col_name={
expr | DEFAULT}] ...]
Example
obclient [oceanbase]> LOAD DATA INFILE '/tmp/test.txt' INTO TABLE ocb.test FIELDS TERMINATED BY '0x0f' LINES TERMINATED BY '\n';
ERROR 1227 (42501): Access denied
obclient [oceanbase]>
# Invalid
set global secure_file_priv="";
# User authorization , Re login can execute load operation
obclient [oceanbase]> GRANT FILE ON *.* to [email protected]'%';
Query OK, 0 rows affected (0.024 sec)
obclient [oceanbase]> LOAD DATA INFILE '/tmp/test.txt' INTO TABLE ocb.test FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
ERROR 1227 (42501): Access denied
obclient [oceanbase]> exit
Bye
[[email protected] ~]# docker exec -it obstandalone ob-mysql sys # Connect to the root account of a general tenant
login as [email protected]
Command is: obclient -h127.1 [email protected] -A -Doceanbase -P2881
Welcome to the OceanBase. Commands end with ; or \g.
Your OceanBase connection id is 3221488957
Server version: 5.7.25 OceanBase 3.1.4 (r10000092022071511-b4bfa011ceaef428782dcb65ae89190c40b78c2f) (Built Jul 15 2022 11:45:14)
Copyright (c) 2000, 2022, OceanBase and/or its affiliates. All rights reserved.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
obclient [oceanbase]> LOAD DATA INFILE '/tmp/test.txt' INTO TABLE ocb.test FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
Query OK, 3 rows affected, 3 warnings (0.011 sec)
Records: 3 Deleted: 0 Skipped: 0 Warnings: 0
obclient [oceanbase]>
obclient [oceanbase]> show variables;
+--------------------------------------+------------------------------------------------------------------------------------------------------------+
| Variable_name | Value |
+--------------------------------------+------------------------------------------------------------------------------------------------------------+
| autocommit | ON |
| auto_increment_cache_size | 1000000 |
| auto_increment_increment | 1 |
| auto_increment_offset | 1 |
| binlog_row_image | FULL |
| block_encryption_mode | aes-128-ecb |
| character_set_client | utf8mb4 |
| character_set_connection | utf8mb4 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8mb4 |
| character_set_server | utf8mb4 |
| character_set_system | utf8mb4 |
| collation_connection | utf8mb4_general_ci |
| collation_database | utf8mb4_general_ci |
| collation_server | utf8mb4_general_ci |
| concurrent_insert | AUTO |
| connect_timeout | 10 |
| datadir | /root/ob/store |
| default_authentication_plugin | mysql_native_password |
| default_password_lifetime | 0 |
| disabled_storage_engines | |
| div_precision_increment | 4 |
| error_count | 0 |
| error_on_overlap_time | OFF |
| explicit_defaults_for_timestamp | ON |
| foreign_key_checks | ON |
| general_log | OFF |
| group_concat_max_len | 1024 |
| have_openssl | YES |
| have_profiling | YES |
| have_ssl | YES |
| hostname | |
| identity | 0 |
| init_connect | |
| interactive_timeout | 28800 |
| is_result_accurate | ON |
| last_insert_id | 0 |
| lc_messages | en_US |
| license | |
| local_infile | ON |
| lock_wait_timeout | 31536000 |
| long_query_time | 10 |
| lower_case_table_names | 2 |
| max_allowed_packet | 4194304 |
| max_connections | 4294967295 |
| max_execution_time | 0 |
| max_sp_recursion_depth | 0 |
| max_user_connections | 0 |
| net_buffer_length | 16384 |
| net_read_timeout | 30 |
| net_write_timeout | 60 |
| ob_bnl_join_cache_size | 10485760 |
| ob_check_sys_variable | ON |
| ob_compatibility_mode | MYSQL |
| ob_create_table_strict_mode | OFF |
| ob_default_replica_num | 1 |
| ob_early_lock_release | OFF |
| ob_enable_aggregation_pushdown | ON |
| ob_enable_batched_multi_statement | OFF |
| ob_enable_blk_nestedloop_join | OFF |
| ob_enable_hash_group_by | ON |
| ob_enable_index_direct_select | OFF |
| ob_enable_jit | OFF |
| ob_enable_plan_cache | ON |
| ob_enable_sql_audit | ON |
| ob_enable_trace_log | OFF |
| ob_enable_transformation | ON |
| ob_enable_transmission_checksum | ON |
| ob_enable_truncate_flashback | OFF |
| ob_interm_result_mem_limit | 2147483648 |
| ob_last_schema_version | 1658416775235592 |
| ob_log_level | disabled |
| ob_max_parallel_degree | 32 |
| ob_org_cluster_id | 0 |
| ob_plan_cache_evict_high_percentage | 90 |
| ob_plan_cache_evict_low_percentage | 50 |
| ob_plan_cache_percentage | 5 |
| ob_pl_block_timeout | 3216672000000000 |
| ob_query_timeout | 10000000 |
| ob_read_consistency | STRONG |
| ob_reserved_meta_memory_percentage | 10 |
| ob_route_policy | READONLY_ZONE_FIRST |
| ob_sql_audit_percentage | 3 |
| ob_sql_work_area_percentage | 5 |
| ob_stmt_parallel_degree | 1 |
| ob_tcp_invited_nodes | % |
| ob_temp_tablespace_size_percentage | 0 |
| ob_timestamp_service | LTS |
| ob_trace_info | |
| ob_trx_idle_timeout | 120000000 |
| ob_trx_lock_timeout | -1 |
| ob_trx_timeout | 100000000 |
| optimizer_capture_sql_plan_baselines | ON |
| optimizer_use_sql_plan_baselines | ON |
| parallel_max_servers | 5 |
| parallel_servers_target | 4 |
| performance_schema | OFF |
| plugin_dir | ./plugin_dir/ |
| protocol_version | 10 |
| query_cache_size | 1048576 |
| query_cache_type | OFF |
| read_only | OFF |
| recyclebin | OFF |
| resource_manager_plan | |
| secure_file_priv | NULL |
| server_id | 0 |
| session_track_schema | ON |
| session_track_state_change | OFF |
| session_track_system_variables | time_zone, autocommit, character_set_client, character_set_results, character_set_connection |
| sql_auto_is_null | OFF |
| sql_mode | STRICT_ALL_TABLES |
| sql_quote_show_create | ON |
| sql_safe_updates | OFF |
| sql_select_limit | 9223372036854775807 |
| sql_throttle_cpu | -1 |
| sql_throttle_current_priority | 100 |
| sql_throttle_io | -1 |
| sql_throttle_logical_reads | -1 |
| sql_throttle_network | -1 |
| sql_throttle_priority | -1 |
| sql_throttle_rt | -1 |
| sql_warnings | OFF |
| ssl_ca | |
| ssl_capath | |
| ssl_cert | |
| ssl_cipher | |
| ssl_crl | |
| ssl_crlpath | |
| ssl_key | |
| system_time_zone | +00:00 |
| timestamp | 0 |
| time_format | %H:%i:%s |
| time_zone | +8:00 |
| tls_version | |
| tmpdir | |
| tmp_table_size | 16777216 |
| tracefile_identifier | |
| transaction_isolation | READ-COMMITTED |
| transaction_read_only | OFF |
| tx_isolation | READ-COMMITTED |
| tx_read_only | OFF |
| undo_retention | 0 |
| unique_checks | ON |
| validate_password_check_user_name | on |
| validate_password_length | 0 |
| validate_password_mixed_case_count | 0 |
| validate_password_number_count | 0 |
| validate_password_policy | low |
| validate_password_special_char_count | 0 |
| version | 3.1.4-OceanBase CE |
| version_comment | OceanBase 3.1.4 (r10000092022071511-b4bfa011ceaef428782dcb65ae89190c40b78c2f) (Built Jul 15 2022 11:45:14) |
| version_compile_machine | |
| version_compile_os | |
| wait_timeout | 28800 |
| warning_count | 0 |
+--------------------------------------+------------------------------------------------------------------------------------------------------------+
156 rows in set (0.002 sec)
obclient [oceanbase]>
Maintenance operations
# Delete
docker rm obstandalone
# start-up
docker run -itd --memory 8G --name obstandalone oceanbase/oceanbase-ce
# see
docker ps -a
# Check the log
docker logs obstandalone
# oceanbase-standalone Mirror inclusion obclient(OceanBase Database client ) And default connection script ob-mysql
# Connect to sys tenant
docker exec -it obstandalone ob-mysql sys
# Connect to the root account of a general tenant
docker exec -it obstandalone ob-mysql root
# Connect to the test account of a general tenant
docker exec -it obstandalone ob-mysql test
# Into the container
docker exec it obstandalone bash
边栏推荐
- QT notes - EventFilter event filter
- Hash - 15. Sum of three numbers
- 【网络空间安全数学基础第3章】同余
- L2-011 play with binary tree
- makefile快速使用
- [C and pointer Chapter 11] dynamic memory allocation
- 如何最快找出复杂代码运行时的函数调用流程
- MySQL advanced (XVII) cannot connect to database server problem analysis
- Hash - 202. Happy number
- Difference between GCC -l parameter and -l parameter
猜你喜欢

4*4图片权重的收敛规则

Shengxin weekly issue 37

What is prescaler in STM32

Day3: branch structure

Remember to optimize my personal blog once

TypeNameExtractor could not be found

1184. 公交站间的距离 : 简单模拟题

20000 words detailed explanation, thoroughly understand es!

6k+ star,面向小白的深度学习代码库!一行代码实现所有Attention机制!

QT notes - realize form adaptation
随机推荐
The art of management - driving software R & D efficiency through leadership
Shengxin weekly issue 37
Agile? DevOps ?
Shell Scripting tips
Design of digital oscilloscope based on arm and FPGA -- QMJ
6k+ star, a deep learning code base for Xiaobai! One line of code implements all attention mechanisms!
Chapter 1 Introduction
String matching KMP
容错、熔断的使用与扩展
Pushgateway installation and Prometheus configuration
AcWing 92. 递归实现指数型枚举
QT notes - EventFilter event filter
SQL multi condition query cannot be implemented
CCF 1-2 question answering record (1)
makefile快速使用
Acwing 92. recursive implementation of exponential enumeration
三层交换机配置MSTP协议详解【华为eNSP实验】
Linked list - Sword finger offer interview question 02.07. linked list intersection
The biggest crisis for testers in the workplace is not at the age of 30, but being laid off in middle age
L1-049 天梯赛座位分配