返回列表 发布新帖

[技术交流] Linux上OcenBase单机版部署及基本信息查询

24 0
发表于 2024-5-2 01:46:58 | 查看全部 阅读模式 来自: 上海松江区

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
OceanBase单机版部署可以通过在线和离线两种方式部署。在线部署可以通过yum源或者apt源部署,直接拉取官方源码即可。实际使用中,大部分环境连不了外网,本文介绍离线方式安装。
  下载“OceanBase All in One”离线安装包下载官方地址:
游客,如果您要查看本帖隐藏内容请回复

1. 解压安装包
  1. [root@tidb01 db_ob]# ll
  2. -rwxr-xr-x 1 root root 692947447 May 1 19:23 oceanbase-all-in-one-4.3.0.1-100000242024032211.el7.x86_64.tar.gz
  3. [root@tidb01 db_ob]# tar -xzvf oceanbase-all-in-one-4.3.0.1-100000242024032211.el7.x86_64.tar.gz
  4. [root@tidb01 db_ob]# ll
  5. total 676708
  6. drwxr-xr-x 6 root root 88 Mar 29 11:46 oceanbase-all-in-one
  7. -rwxr-xr-x 1 root root 692947447 May 1 19:23 oceanbase-all-in-one-4.3.0.1-100000242024032211.el7.x86_64.tar.gz
复制代码

2. 一键部署并添加到系统环境变量
  1. [root@tidb01 db_ob]# cd oceanbase-all-in-one/bin/
  2. [root@tidb01 bin]# ./install.sh
  3. [root@tidb01 bin]# source ~/.oceanbase-all-in-one/bin/env.sh
  4. [root@tidb01 bin]# obd demo
复制代码

3. 连接数据库
  1. #通过2881端口直连数据库
  2. [root@tidb01 ~]# obclient -h127.0.0.1 -P2881 -uroot@sys -Doceanbase -A
  3. Welcome to the OceanBase. Commands end with ; or \g.
  4. Your OceanBase connection id is 3221497482
  5. Server version: OceanBase_CE 4.3.0.1 (r100000242024032211-0193a343bc60b4699ec47792c3fc4ce166a182f9) (Built Mar 22 2024 13:19:48)

  6. Copyright (c) 2000, 2018, OceanBase and/or its affiliates. All rights reserved.

  7. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

  8. obclient [oceanbase]>

  9. #通过ODP代理访问数据库
  10. [root@tidb01 ~]# obclient -h127.0.0.1 -P2883 -uroot@sys -Doceanbase -A
  11. Welcome to the OceanBase. Commands end with ; or \g.
  12. Your OceanBase connection id is 1815347202
  13. Server version: OceanBase_CE 4.3.0.1 (r100000242024032211-0193a343bc60b4699ec47792c3fc4ce166a182f9) (Built Mar 22 2024 13:19:48)

  14. Copyright (c) 2000, 2018, OceanBase and/or its affiliates. All rights reserved.

  15. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

  16. obclient [oceanbase]>
复制代码

4. 查询数据库版本、字符集等基本信息
  1. obclient [oceanbase]> SELECT VERSION();
  2. +------------------------------+
  3. | VERSION() |
  4. +------------------------------+
  5. | 5.7.25-OceanBase_CE-v4.3.0.1 |
  6. +------------------------------+
  7. 1 row in set (0.002 sec)

  8. obclient [oceanbase]>

  9. #查看字符集
  10. obclient [oceanbase]> SHOW SESSION VARIABLES LIKE 'character\_set\_%';
  11. +--------------------------+---------+
  12. | Variable_name | Value |
  13. +--------------------------+---------+
  14. | character_set_client | utf8mb4 |
  15. | character_set_connection | utf8mb4 |
  16. | character_set_database | utf8mb4 |
  17. | character_set_filesystem | binary |
  18. | character_set_results | utf8mb4 |
  19. | character_set_server | utf8mb4 |
  20. | character_set_system | utf8mb4 |
  21. +--------------------------+---------+
  22. 7 rows in set (0.003 sec)
  23. obclient [oceanbase]> SHOW SESSION VARIABLES LIKE 'collation\_%';
  24. +----------------------+--------------------+
  25. | Variable_name | Value |
  26. +----------------------+--------------------+
  27. | collation_connection | utf8mb4_general_ci |
  28. | collation_database | utf8mb4_general_ci |
  29. | collation_server | utf8mb4_general_ci |
  30. +----------------------+--------------------+
  31. 3 rows in set (0.003 sec)
复制代码

版权声明:本文为博客园博主原创文章,遵循 CC 4.0 BY-SA 版权协议
要么刷卡,要么投币,要么滚蛋。看什么看!公交车都坐不起,还冒充黑客帝国。

回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

幸运大抽奖,更多好礼等你来抢!
投诉/建议联系

8641340@qq.com

欢迎各位朋友加入本社区,
共同维护良好的社区氛围
  • 加入QQ群
  • 添加微信客服
Copyright © 2001-2024 荷包蛋部落 版权所有 All Rights Reserved. 鲁ICP备20023396号-6
关灯 在本版发帖
扫一扫添加微信客服
QQ客服返回顶部
快速回复 返回顶部 返回列表