kingbase.conf配置修改:
附:查看search_path方式:
(1)select name,setting from sys_settings where name='search_path';
(2)selectcurrent_setting('search_path');
(3)showsearch_path;
一.设置/重置数据库级别search_path:(非全局修改参数)
1.ksql -USYSTEM -W123456 -p54321-dtest-->show search_path-->"$USER",PUBLIC
2.-->alter database test setsearch_path='a,b,c'-->\q
3.-->ksql -USYSTEM -W123456 -p54321-dtest-->show search_path;-->"a,b,c"
4.-->alter database test resetsearch_path;-->\q
5.-->ksql -USYSTEM -W123456 -p54321-dtest-->show search_path-->"$USER",PUBLIC
===========================================================
二.设置/重置会话级别search_path:
1.ksql -USYSTEM -W123456 -p54321-dtest-->show search_path-->"$USER",PUBLIC
2.set search_path='aa,bb,cc';-->showsearch_path;-->"aa,bb,cc"
3.set search_path to default;-->showsearch_path;-->"$USER",PUBLIC
4.select name,setting from sys_settingswhere name='search_path';-->"$USER",PUBLIC
5.update sys_settings set setting='aa,bb'where name='search_path'-->select name,setting from sys_settings wherename='search_path';-->aa,bb
6.\q-->ksql -USYSTEM -W123456 -p54321-dtest-->select name,setting from sys_settings where name='search_path';-->"$USER",PUBLIC
7.selectset_config('search_path','cc',false);-->select name,setting fromsys_settings where name='search_path';-->cc
8.\q-->ksql -USYSTEM -W123456 -p54321-dtest-->select name,setting from sys_settings wherename='search_path';-->"$USER",PUBLIC
===========================================================
三.设置/重置用户级别search_path:
1.\c samples system-->showsearch_path;-->"$USER",PUBLIC
2.alter role scott in database samples setsearch_path='aaa';-->\c samples scott-->show search_path;-->aaa
3.\c - system-->alter role scott indatabase samples reset search_path;-->\c - scott-->showsearch_path;-->"$USER",PUBLIC
===========================================================
数据库连接参数:
1.listen_address:指定数据库在哪些ip地址上启动客户端连接请求,默认值*,表示在运行数据库机器的所有ip地址上监听用户请求;
可以写成主机名或者ip地址,不同的值用逗号隔开;
如果设置成localhost,表示数据库只能接受本地客户端的连接请求;
context值为kingbase时表示该参数只有在启动数据库时,才能被引用生效。
2.port:指定数据库服务器监听端口,默认值是54321,可以修改但单实例环境只有一个;
context值为kingbase时表示该参数只有在启动数据库时,才能被引用生效。
3.max_connections:数据库可以同时建立的最大连接数,默认值是100;
context值为kingbase时表示该参数只有在启动数据库时,才能被引用生效;
work_mem应用于每个数据库连接,work_mem*max_connections不应该超出实际内存大小;
4.superuser_reserved_connections:是给超级用户预留的数据库连接数,必须小于max_connections,默认值是10;
普通用户可建立的最大并发连接数是max_connections减去superuser_reserved_connections;
context值为kingbase时表示该参数只有在启动数据库时,才能被引用生效。
5.tcp_keepalives_idle:表示会话连接不活动多少秒后,通过tcp向客户端发送一个keepalive消息,以防连接中断;
默认值是0,表示使用操作系统参数设定;
context值为user时表示这个参数可以动态修改并生效。
6.tcp_keepalives_interval:表示发送一个keepalive消息后没有收到回应时,间隔多少秒再发送一个;
该参数对于通过unix域套接字方式建立的连接没有影响;
默认值0,表示使用操作系统参数进行设定;
context为user时便是这个参数可以动态修改并生效。
7.tcp_keepalives_count:表示发送tcp心跳信息的次数,超过该值则被断开连接;
该参数对于通过unix域套接字方式建立的连接没有影响;
默认值是0,表示使用操作系统参数设定;
context为user时便是这个参数可以动态修改并生效。