GBase 8s内置dbms_lob函数说明

获取clob/blob的长度

同名函数,参数输入不同

-- dbms_lob_getlength
create function 'gbasedbt'.dbms_lob_getlength (blob)
returns integer
external name '$GBASEDBTDIR/extend/excompat.1.0/excompat.bld(dbms_lob_getlength)' language c;

create function 'gbasedbt'.dbms_lob_getlength (clob)
returns integer
external name '$GBASEDBTDIR/extend/excompat.1.0/excompat.bld(dbms_lob_getlength)' language c;

阅读全文»

GBase 8s数据库配置使用IPv6

1, 网卡配置(CentOS 7)

修改/etc/sysconfig/network-scripts/ifcfg-ens33配置文件,按以下内容提示修改

TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="none"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="yes"
# 确认IPV6INIT的值为yes
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
# 增加IPV6ADDR和IPV6_DEFAULTGW,注意不要使用私网地址
IPV6ADDR="3ffe:ffff:ffff:ffff::12/64"
IPV6_DEFAULTGW="3ffe:ffff:ffff:ffff::1"
NAME="ens33"
UUID="caab0c05-8e0d-4526-9dcf-e966cd9eef34"
DEVICE="ens33"
ONBOOT="yes"
IPADDR="192.168.80.70"
PREFIX="24"
GATEWAY="192.168.80.2"
DNS1="192.168.80.2"
DOMAIN="192.168.80.2"
IPV6_PRIVACY="no"

阅读全文»

GBase 8s数据库JDBC连接字符串

连接字符串格式

JDBC连接字符串的完整格式:

>>-jdbc:gbasedbt-sqli://-hostname:portnum--/database_name:------>

>--+--------------------------------+--------------------------->
   '-USER=userid;-PASSWORD=password-'   

>--+----------------------------+------------------------------->
   '-GBASEDBTSERVER=servername;-'   

>--+-----------------------------------------------------------+-><
   |                                           .-;-----------. |   
   |                                           V             | |   
   '-CSM=(SSO=database_server@realm,ENC=true)}---;name=value-+-'  

阅读全文»

GBase 8s clob数据类型操作函数

GBase 8s clob数据类型操作函数

GBase 8s中clob数据类型的操作一般使用filetoclob,lotofile和locopy函数;

示例如下:

-- 插入文本文件到指定字段中
insert into tabclob(id, clobcol) values (1, filetoclob('/home/gbase/clob.file','client'));
-- 导出clob内容至文件
select lotofile(clobcol,'/home/gbase/clob.file.20220103','client') from tabclob;
-- 复制clob
insert into tabclob2 select 2,locopy(clobcol) from tabclob where id = 1;

阅读全文»