错误消息说明
- GCI错误码均为正数
- 小于900000的错误代码表明是GCI侧运行时产生的报错信息。
- 大于900000的错误码表明是Server报错信息,需减900000后结合Server错误码查看。Server错误码不区分正负值,取绝对值即可。
基于数据库版本:GBase 8s v8.8 3.6.3_3x2_1
| ErrCode | Description |
|---|---|
| -23101 | Unable to load locale categories. |
| -23102 | Memory allocation failed during locale processing. |
| -23103 | Code-set conversion function failed due to illegal sequence or invalid value. |
| -23104 | Error opening required code-set conversion object file. |
| -23105 | The current database engine does not support code-set conversion. |
| -23106 | Invalid argument for the code-set conversion initializing function. |
| -23107 | DBLANG and CLIENT_LOCALE environment variables are incompatible. |
| -23108 | An error occurred during locale structure creation. |
| -23109 | Invalid locale specification. |
| -23110 | An error occurred during environment variable processing. |
| -23111 | Internal error. Illegal argument for locale initialization. |
| -23112 | Place holder for invalid GCV argument. |
| -23113 | Place holder for unknown GCV error. |
| -23114 | Place holder for GCV truncation. |
| -23115 | Code sets of the locale categories are not the same. |
| -23190 | Multibyte database name is not allowed in this system. |
| -23194 | Code-set conversion restore failed. |
| -23195 | Reset locale failed. Connection refused. |
| -23196 | Unknown locale in selected database. |
| -23197 | Database locale information mismatch. |
| -23198 | GL_COLLATE information is missing from the system catalogs. |
| -23199 | GL_CTYPE information is missing from the system catalogs. |
| -23100 | An Error has occurred during locale structure creation. |
干支纪年可通过年份计算得来(东汉以后)
drop function if exists getY2TGDZ(int);
create function getY2TGDZ(p_year int)
returns varchar(20) with (not variant);
define v_tg int;
define v_dz int;
-- 天干:mod(年份,10),前移3
let v_tg = mod(p_year,10)+7;
if v_tg > 10 then
let v_tg = v_tg - 10;
end if;
-- 地支:mod(年份,12),前移3
let v_dz = mod(p_year,12)+9;
if v_dz > 12 then
let v_dz = v_dz - 12;
end if;
return substr('甲乙丙丁戊己庚辛壬癸',v_tg,1) || substr('子丑寅卯辰巳午未申酉戌亥',v_dz,1);
end function;示例:
select getY2TGDZ(2025) as tz from dual;结果:
tz 乙巳 从mysql迁移库,存在非聚集列不在group by 的语句。
这样的sql会被认为是不合法的sql,因为:
1,order by后面的列必须是在select后面存在的
2,select、having或order by后面存在的非聚合列必须全部在group by中存在
通用情况下,mysql可以通过以下三种方式解决报错问题
1,修改sql使其遵守only_full_group_by规则
2,关闭only_full_group_by规则
3,降级数据库版本在5.7以下
注:对非gbasedbt或者root用户
注:仅是大致过程
1,访问系统库sysuser的表sysintauthuser。
如果用户名不匹配username,则认为不是内部用户,转使用操作系统验证;如果匹配username,则继续2。
2,访问系统库sysuser的表sysusermap。
如果用户名不匹配username,刚使用默认用户(default user的properties);如果匹配username,则获取surrogate_id。继续3。
3,访问系统库sysuser的表syssurrogates。
如果surrogate_id不匹配,则报错退出; 如果匹配,则获取os_username。继续4。
4,与加载到内存中的allowed.surrogates对比。
如果不匹配,报警告,转使用操作系统验证;如果匹配,完成检验。
分为两个场景
用户验证使用操作系统检验。
将自动与同名操作系统用户绑定代理映射,用户检验时先从内部校验,但找不到代理映射用户(online.log中会的警告),而后将使用操作系统检验。
注:这种情况下,修改allowed.surrogates增加同名代理映射用户,并重新加载到内存。此时,内部用户检验通过,将使用内部检验。
用户检验使用内部检验
用户校验使用内部检验
用户校验使用内部检验
本文基于GBase 8s V8.8 3.6.2_2版本编写, 是对原文档:https://gbasedbt.com/index.php/archives/459/ 的更新。
常用的数据类型如下:
GBase 8s数据库数据类型参考:https://gbasedbt.com/index.php/archives/628/
内置字符类型包括:char, nchar, varchar, nvarchar, lvarchar, varchar2, nvarchar2和clob2
CHARACTER(n) 和 CHARACTER VARYING(n)这样的别名同样支持
启用SQLMODE=Oralce,即Oracle兼容模式
这里是 GBase 8s TRANSLATE() 函数的语法:
TRANSLATE(string, from_string, to_string)string
必需的。 要翻译的字符串。
from_set
必需的。 一个字符串,它是要翻译的字符的集合。
to_set
必需的。 一个字符串,它是要翻译成的字符集合。
to_set 中的字符和 from_set 中的字符一一对应形成翻译关系。
本文介绍了如何在同一台机器上使用 Docker 容器搭建GBase 8s主备集群环境。
拉取GBase 8s的最新镜像
docker pull liaosnet/gbase8s
或者
docker pull liaosnet/gbase8s:v8.8_3513x25_csdk_x64注:在tag为v8.8_3513x25_csdk_x64及之后的版本中,可通过参数方式自动创建集群
拉取镜像成功后,可通过docker images查看拉取镜像的版本。