2. 快速开始
本章包含安装LightDB后启停数据库和进行一些常规设置的查看。
2.1. 启停数据库
安装完LightDB数据库(安装步骤可参考 官网 ),可以使用LightDB客户端工具lt_ctl启动或关停LightDB数据库服务器。常见的lt_ctl操作有:
- lt_ctl start #启动LightDB数据库
- lt_ctl stop #关停LightDB数据库
- lt_ctl restart #重启LightDB数据库
- lt_ctl reload #用于配置文件lightdb.conf更新后重新载入配置文件
- 此外lt_ctl还有数个选项,具体的使用规则可通过lt_ctl --help 来查看。
2.2. 检查项查看
使用LightDB客户端程序ltsql登录后,可查看LightDB当前的各项配置信息。
2.2.1. 查看服务端口
show port;
通过该命令可以看到如下结果:
lightdb@postgres=# show port;
port
------
5432
(1 row)
2.2.2. 查看兼容模式
show %compatible%;
通过该命令可以看到如下结果:
lightdb@oracle=# show %compatible%;
name | setting | description
----------------------------------------+---------+---------------------------------------------------------------------------------
lightdb_dblevel_syntax_compatible_type | Oracle | Show syntax compatible type for current database.
lightdb_syntax_compatible_type | off | Default syntax compatible type when create database. Support MySQL and Oracle.
(2 rows)
lightdb_syntax_compatible_type表示LightDB 集簇级别 的设置,而lightdb_dblevel_syntax_compatible_type是LightDB 数据库级别 的设置。上面的信息说明当前数据库集簇的兼容模式为PostgreSQL(off),而当前登录的数据库的兼容模式为Oracle。