返回首页

gbase数据、南大通用产品文档:GBase8s

更新日期:2024年09月11日

An unexpected exception was thrown. See next exception for details
当出现非 SQL 异常时会发生此错误;例如,IO 异常。

语法:

元素
用途
关键注意事项
-p
更改物理日志
使用 onparams -p 命令时,必须包含 -s 参数。
另外,您可以指定 -d 和 -y 参数。数据库服务
器必须处于管理、联机或静默方式才能指定 -p
参数。数据库服务器无须重启,这些更改即可生
效。
-s size 更改物理日志的大小(千字
节)
该值必须是大于等于 200 千字节的无符号整数。

注意: 如果将日志移动到没有足够连续空间的
dbspace 中或将日志大小增至超出可用连续空
间,那么操作将发生失败,并且物理日志不会更
改。
-d
dbspace
将物理日志的位置更改为指
定的 dbspace
分配给物理日志的空间必须是连续的。
语法必须符合 Identifier 段;请参阅 《GBase
8s SQL 指南:语法》
-y
导致数据库服务器自动对所
有提示响应“是”


更改物理日志大小或位置之后进行备份

GBase 8s 管理员参考
南大通用数据技术股份有限公司 - 385 -
当您更改物理日志时,数据库服务器必须处于联机或静默方式。且无需重启数据库服务器,
这些更改即可生效。
更改物理日志大小或位置后请立即创建 root dbspace 的 0 级备份。
该备份对于数据库服务
器的正确恢复具有至关重要的作用。
更改物理日志的大小和使用非缺省页大小
如果使用非缺省页大小,那么可能需要扩充物理日志的大小。如果要对非缺省页执行多次
更新,
那么您可能需要增加 150% 到 200% 物理日志大小。
您可以根据物理日志触发器和
检查点填充的频率调整物理日志大小。

同步系统时间
GBase 8c 主备式数据库系统,需要主备节点间完成时间同步,来保证数据库一致性。
一般采用NTP 服务方式来保证各节点间的时间同步。
检查和配置NTP 服务的操作步骤如下:
步骤1 首先检查服务器是否安装NTP 服务以及是否正常运行:
[gbase@gbase8c ~]$ sudo systemctl status ntpd.service
ntpd.service - Network Time Service
Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; vendor preset:
disabled)
Active: active (running) since Thu 2021-12-02 19:26:50 CST; 1 weeks 1 days ago
Main PID: 14440 (ntpd)
CGroup: /system.slice/ntpd.service
└─14440 /usr/sbin/ntpd -u ntp:ntp -g
如果显示running,则表示服务正在运行,则跳过步骤2,直接执行后续步骤。

GBase 8c V5 安装部署手册(主备式)
南大通用数据技术股份有限公司
12
步骤2 如NTP 服务未处于正常运行状态,考虑如下操作:

如果系统可以与外网通信,可以使用如下命令与NTP 服务器同步:
[gbase@gbase8c ~]$ sudo ntpdate asia.pool.ntp.org

如果服务器所在网络无法与外网通信,需要手动配置NTP 服务:
首先确认是否安装ntp:
[gbase@gbase8c ~]$ rpm -qa|grep ntp
若已安装ntp 应返回如下内容:
[gbase@gbase8c ~]$ ntp-4.2.6p5-29.el7.centos.x86_64
[gbase@gbase8c ~]$ ntpdate-4.2.6p5-29.el7.centos.x86_64
若没有ntp 显示,则应删除原有ntpdate 后重新安装ntp:
[gbase@gbase8c ~]$ sudo yum -y remove ntpdate-4.2.6p5-29.el7.centos.x86_64
[gbase@gbase8c ~]$ sudo yum -y install ntp
步骤4 配置NTP 服务。
安装完毕后,在所有节点上配置NTP 服务。选定NTP 服务主节点,一般选用主节点作
为NTP 主节点。
NTP 节点配置通过修改/etc 目录下的ntp.conf 配置文件实现,
分为主节点配
置及其他节点配置。
修改各节点上ntp.conf 配置文件,命令如下:
[gbase@gbase8c ~]$ sudo vi /etc/ntp.conf

主节点修改配置文件,涉及部分配置文件及修改位置如下:
# Permit all access over the loopback interface.
This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 10.0.7.16 nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict ::1
# Hosts on local network are less restricted.
restrict 10.0.7.255 mask 255.255.248.0 nomodify notrap
# Use public servers from the pool.ntp.org project.

GBase 8c V5 安装部署手册(主备式)
南大通用数据技术股份有限公司
13
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
# 注释掉以下四行
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
server 127.127.1.0
Fudge 127.127.1.0 stratum 10

NTP 其他节点修改配置文件,修改涉及部分配置文件及修改位置如下:
# the administrative functions.
restrict 10.0.7.17 nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict ::1
# Hosts on local network are less restricted.
restrict 10.0.7.255 mask 255.255.248.0 nomodify notrap
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
# 注释掉以下四行
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
server 10.0.7.16
Fudge 10.0.7.16 stratum 10
步骤5 启动NTP 服务,并设置开机自启动。
全部节点配置完成后,在所有节点启动NTP 服务。
[gbase@gbase8c ~]$ sudo systemctl start ntpd.service
设置开机自启动:
[gbase@gbase8c ~]$ sudo systemctl enable ntpd.service
注意

某些虚拟机环境下无法配置NTP 开机自启动,需要每次重启后进行手工启动。

时间同步会影响数据库集群部署及一致性操作,须提前配置生效。

GBase 8c V5 安装部署手册(主备式)
南大通用数据技术股份有限公司
14
步骤6 配置完毕后,在各节点执行以下命令,查看NTP 服务是否连通。
[gbase@gbase8c ~]$ ntpstat
NTP 主节点应返回:
synchronised to local net (127.127.1.0) at stratum 6
time correct to within 11 ms
polling server every 64 s
NTP 其他节点应返回:
synchronised to NTP server (10.0.7.16) at stratum 7
time correct to within 57 ms
polling server every 1024 s
注意
NTP 服务器配置完毕后,需要等待5~20 分钟才能完成时间同步,如果在配置后提示
unsynchronised time server re-starting polling server every 8 s 或unsynchronised polling
server every 8 s 均属正常,等待一段时间再次执行ntpstat 命令查看即可。