数据库运维
记录DBA学习成长历程

第4章:GBase 8s 运行模式与切换

文章目录

1 GBase 8s的四种运行模式

—1.1 离线模式

不能执行任何操作
shared memory not initialized for GBASEDBTSERVER ‘gbaseserver’(执行数据库管理员命令时)
908: Attempt to connect to database server (gbaseserver) failed.(执行数据库SQL操作时)
执行dbaccess时,可以出现菜单,选择数据库出现RUNNING后,一段时间报错。

—1.2 在线模式

可以执行各种操作。

—1.3 单用户模式

可以执行SQL操作和命令行维护操作。只能管理员(GBASEDBT / DBSA)连接,其它普通用户不能连接。
27010: Only an administrative user can connect in administrative user mode.

—1.4 静态模式

只能执行命令行维护操作(如备份数据库)。
不能执行SQL命令(27002: No connections are allowed in quiescent mode.)

2 GBase 8s的3种过渡状态

初始化(Initialization)

快速恢复(Fast Recovery)

关闭(Shutting Down)

3 GBase 8s的模式转换状态图

GBase 8s 可从一个运行模式,转换到另一个运行模式。
一直返回模式状态
[gbasedbt@gbase01 ~]$ onstat -r 1

—3.1 离线转单用户

[gbasedbt@devsvr ~]$ onstat -
Your evaluation license will expire on 2022-06-18 00:00:00
shared memory not initialized for GBASEDBTSERVER 'gbaseserver'
[gbasedbt@devsvr ~]$ oninit -j
Your evaluation license will expire on 2022-06-18 00:00:00
[gbasedbt@devsvr ~]$ onstat -
Your evaluation license will expire on 2022-06-18 00:00:00
Single-User -- Up 00:00:14 -- 597864 Kbytes

—3.2 单用户转在线

[gbasedbt@devsvr ~]$ onstat -
Your evaluation license will expire on 2022-06-18 00:00:00
Single-User -- Up 00:04:33 -- 597864 Kbytes

[gbasedbt@devsvr ~]$ onmode -m
Your evaluation license will expire on 2022-06-18 00:00:00
[gbasedbt@devsvr ~]$ onstat -
Your evaluation license will expire on 2022-06-18 00:00:00
On-Line -- Up 00:04:53 -- 597864 Kbytes

—3.3 离线转在线

[gbasedbt@devsvr ~]$ onstat -
Your evaluation license will expire on 2022-06-18 00:00:00
shared memory not initialized for GBASEDBTSERVER 'gbaseserver'
[gbasedbt@devsvr ~]$ oninit
Your evaluation license will expire on 2022-06-18 00:00:00
[gbasedbt@devsvr ~]$ onstat -
Your evaluation license will expire on 2022-06-18 00:00:00
On-Line -- Up 00:00:14 -- 597864 Kbytes

—3.4 离线转静态

[gbasedbt@devsvr ~]$ onstat -
Your evaluation license will expire on 2022-06-18 00:00:00
shared memory not initialized for GBASEDBTSERVER 'gbaseserver'
[gbasedbt@devsvr ~]$ oninit -s
Your evaluation license will expire on 2022-06-18 00:00:00
[gbasedbt@devsvr ~]$ onstat -
Your evaluation license will expire on 2022-06-18 00:00:00
Quiescent -- Up 00:00:15 -- 597864 Kbytes

—3.5 静态转在线

[gbasedbt@devsvr ~]$ onstat -
Your evaluation license will expire on 2022-06-18 00:00:00
Quiescent -- Up 00:00:15 -- 597864 Kbytes

[gbasedbt@devsvr ~]$ onmode -m
Your evaluation license will expire on 2022-06-18 00:00:00
[gbasedbt@devsvr ~]$ onstat -
Your evaluation license will expire on 2022-06-18 00:00:00
On-Line -- Up 00:00:49 -- 597864 Kbytes

—3.6 在线转单用户

[gbasedbt@devsvr ~]$ onstat -
Your evaluation license will expire on 2022-06-18 00:00:00
On-Line -- Up 00:00:56 -- 597864 Kbytes

[gbasedbt@devsvr ~]$ onmode -j
Your evaluation license will expire on 2022-06-18 00:00:00
This will change mode to single user. Only DBSA/gbasedbt can connect
in this mode.
Do you wish to continue (y/n)? y

All threads which are not owned by DBSA/gbasedbt will be killed.
Do you wish to continue (y/n)? y
[gbasedbt@devsvr ~]$ onstat -
Your evaluation license will expire on 2022-06-18 00:00:00
Single-User -- Up 00:01:25 -- 597864 Kbytes

—3.7 单用户转离线

[gbasedbt@devsvr ~]$ onstat -
Your evaluation license will expire on 2022-06-18 00:00:00
Single-User -- Up 00:00:14 -- 597864 Kbytes

[gbasedbt@devsvr ~]$ onmode -k
Your evaluation license will expire on 2022-06-18 00:00:00

This will take GBase Database Server OFF-LINE -
Do you wish to continue (y/n)? y

There are 0 user threads that will be killed.
Do you wish to continue (y/n)? y
[gbasedbt@devsvr ~]$ onstat -
Your evaluation license will expire on 2022-06-18 00:00:00
shared memory not initialized for GBASEDBTSERVER 'gbaseserver'

—3.8 在线转离线

[gbasedbt@devsvr ~]$ onstat -
Your evaluation license will expire on 2022-06-18 00:00:00
On-Line -- Up 00:04:53 -- 597864 Kbytes

[gbasedbt@devsvr ~]$ onmode -k
Your evaluation license will expire on 2022-06-18 00:00:00

This will take GBase Database Server OFF-LINE -
Do you wish to continue (y/n)? y

There are 0 user threads that will be killed.
Do you wish to continue (y/n)? y
[gbasedbt@devsvr ~]$ onstat -
Your evaluation license will expire on 2022-06-18 00:00:00
shared memory not initialized for GBASEDBTSERVER 'gbaseserver'

—3.9 在线转静态

[gbasedbt@devsvr ~]$ onstat -
Your evaluation license will expire on 2022-06-18 00:00:00
On-Line -- Up 00:00:14 -- 597864 Kbytes

[gbasedbt@devsvr ~]$ onmode -s
Your evaluation license will expire on 2022-06-18 00:00:00

This will perform a GRACEFUL SHUTDOWN -
Do you wish to continue (y/n)? y
[gbasedbt@devsvr ~]$ onstat -
Your evaluation license will expire on 2022-06-18 00:00:00
Quiescent -- Up 00:00:45 -- 597864 Kbytes

[gbasedbt@devsvr ~]$ onstat -
Your evaluation license will expire on 2022-06-18 00:00:00
On-Line -- Up 00:00:38 -- 597864 Kbytes

[gbasedbt@devsvr ~]$ onmode -u
Your evaluation license will expire on 2022-06-18 00:00:00

This will perform an IMMEDIATE SHUTDOWN -
Do you wish to continue (y/n)? y

There are 0 user threads that will be killed.
Do you wish to continue (y/n)? y
[gbasedbt@devsvr ~]$ onstat -
Your evaluation license will expire on 2022-06-18 00:00:00
Quiescent -- Up 00:00:53 -- 597864 Kbytes

—3.10 静态转离线

[gbasedbt@devsvr ~]$ onstat -
Your evaluation license will expire on 2022-06-18 00:00:00
Quiescent -- Up 00:00:45 -- 597864 Kbytes

[gbasedbt@devsvr ~]$ onmode -k
Your evaluation license will expire on 2022-06-18 00:00:00

This will take GBase Database Server OFF-LINE -
Do you wish to continue (y/n)? y

There are 0 user threads that will be killed.
Do you wish to continue (y/n)? y
[gbasedbt@devsvr ~]$ onstat -
Your evaluation license will expire on 2022-06-18 00:00:00
shared memory not initialized for GBASEDBTSERVER 'gbaseserver'

4 如何关闭数据库

赞(0)
MySQL学习笔记 » 第4章:GBase 8s 运行模式与切换