GBase 8s 运行模式与切换
GBase 8s的四种运行模式。
- 离线模式
不能执行任何操作
shared memory not initialized for GBASEDBTSERVER ‘gbaseserver’(执行数据库管理员命令时)
908: Attempt to connect to database server (gbaseserver) failed.(执行数据库SQL操作时)
执行dbaccess时,可以出现菜单,选择数据库出现RUNNING后,一段时间报错。
- 在线模式
可以执行各种操作。
- 单用户模式
可以执行SQL操作和命令行维护操作。只能管理员(GBASEDBT / DBSA)连接,其它普通用户不能连接。
27010: Only an administrative user can connect in administrative user mode.
- 静态模式
只能执行命令行维护操作(如备份数据库)。
不能执行SQL命令(27002: No connections are allowed in quiescent mode.)
GBase 8s的3种过渡状态。
-
初始化(Initialization)
-
快速恢复(Fast Recovery)
-
关闭(Shutting Down)
GBase 8s的模式转换状态图
GBase 8s 可从一个运行模式,转换到另一个运行模式。
- 离线转单用户
[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
[gbasedbt@devsvr ~]$
- 单用户转在线
[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
[gbasedbt@devsvr ~]$
- 离线转在线
[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
[gbasedbt@devsvr ~]$
- 离线转静态
[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
[gbasedbt@devsvr ~]$
- 静态转在线
[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
[gbasedbt@devsvr ~]$
- 在线转单用户
[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
[gbasedbt@devsvr ~]$
- 单用户转离线
[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'
[gbasedbt@devsvr ~]$
- 在线转离线
[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'
[gbasedbt@devsvr ~]$
- 在线转静态
[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 ~]$
或
[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
[gbasedbt@devsvr ~]$
- 静态转离线
[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'
[gbasedbt@devsvr ~]$
附录
GBase 8s的模式转换状态表
离线 | 在线 | 单用户 | 静态 | |
---|---|---|---|---|
离线 | oninit | oninit -j | oninit -s | |
在线 | onmode -ky | onmode -j | onmode –s onmode -u | |
单用户 | onmode -ky | onmode -m | onmode –s onmode -u | |
静态 | onmode -ky | onmode -m | onmode -j |