暂无图片
暂无图片
2
暂无图片
暂无图片
暂无图片

GBase 8s 学习笔记 005 —— GBase 8s 运行模式与切换

心有阳光 2023-02-10
1355

GBase 8s 学习笔记 005 —— 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 可从一个运行模式,转换到另一个运行模式。

GBase051.png模式转换

离线转单用户

[gbasedbt@192 ~]$ onstat - Your evaluation license will expire on 2024-02-07 00:00:00 shared memory not initialized for GBASEDBTSERVER 'gbaseserver' [gbasedbt@192 ~]$ oninit -j Your evaluation license will expire on 2024-02-07 00:00:00 [gbasedbt@192 ~]$ onstat - Your evaluation license will expire on 2024-02-07 00:00:00 Single-User -- Up 00:00:17 -- 597864 Kbytes [gbasedbt@192 ~]$

GBase040.png离线转单用户

单用户转在线

[gbasedbt@192 ~]$ onstat - Your evaluation license will expire on 2024-02-07 00:00:00 Single-User -- Up 00:02:04 -- 597864 Kbytes [gbasedbt@192 ~]$ onmode -m Your evaluation license will expire on 2024-02-07 00:00:00 [gbasedbt@192 ~]$ onstat - Your evaluation license will expire on 2024-02-07 00:00:00 On-Line -- Up 00:02:22 -- 597864 Kbytes [gbasedbt@192 ~]$

GBase041.png单用户转在线

离线转在线

[gbasedbt@192 ~]$ onstat - Your evaluation license will expire on 2024-02-07 00:00:00 shared memory not initialized for GBASEDBTSERVER 'gbaseserver' [gbasedbt@192 ~]$ oninit Your evaluation license will expire on 2024-02-07 00:00:00 [gbasedbt@192 ~]$ onstat - Your evaluation license will expire on 2024-02-07 00:00:00 On-Line -- Up 00:00:12 -- 597864 Kbytes [gbasedbt@192 ~]$

GBase042.png离线转在线

离线转静态

[gbasedbt@192 ~]$ onstat - Your evaluation license will expire on 2024-02-07 00:00:00 shared memory not initialized for GBASEDBTSERVER 'gbaseserver' [gbasedbt@192 ~]$ oninit -s Your evaluation license will expire on 2024-02-07 00:00:00 [gbasedbt@192 ~]$ onstat - Your evaluation license will expire on 2024-02-07 00:00:00 Quiescent -- Up 00:00:13 -- 597864 Kbytes [gbasedbt@192 ~]$

GBase043.png离线转静态

静态转在线

[gbasedbt@192 ~]$ onstat - Your evaluation license will expire on 2024-02-07 00:00:00 Quiescent -- Up 00:01:28 -- 597864 Kbytes [gbasedbt@192 ~]$ onmode -m Your evaluation license will expire on 2024-02-07 00:00:00 [gbasedbt@192 ~]$ onstat - Your evaluation license will expire on 2024-02-07 00:00:00 On-Line -- Up 00:01:43 -- 597864 Kbytes [gbasedbt@192 ~]$

GBase044.png静态转在线

GBase052.png模式转换

在线转单用户

[gbasedbt@192 ~]$ onstat - Your evaluation license will expire on 2024-02-07 00:00:00 On-Line -- Up 00:02:48 -- 597864 Kbytes [gbasedbt@192 ~]$ onmode -j Your evaluation license will expire on 2024-02-07 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@192 ~]$ onstat - Your evaluation license will expire on 2024-02-07 00:00:00 Single-User -- Up 00:03:09 -- 597864 Kbytes [gbasedbt@192 ~]$

GBase045.png在线转单用户

单用户转离线

[gbasedbt@192 ~]$ onstat - Your evaluation license will expire on 2024-02-07 00:00:00 Single-User -- Up 00:04:29 -- 597864 Kbytes [gbasedbt@192 ~]$ onmode -k Your evaluation license will expire on 2024-02-07 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@192 ~]$ onstat - Your evaluation license will expire on 2024-02-07 00:00:00 shared memory not initialized for GBASEDBTSERVER 'gbaseserver' [gbasedbt@192 ~]$

GBase046.png单用户转离线

在线转离线

[gbasedbt@192 ~]$ onstat - Your evaluation license will expire on 2024-02-07 00:00:00 On-Line -- Up 00:00:20 -- 597864 Kbytes [gbasedbt@192 ~]$ onmode -k Your evaluation license will expire on 2024-02-07 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@192 ~]$ onstat - Your evaluation license will expire on 2024-02-07 00:00:00 shared memory not initialized for GBASEDBTSERVER 'gbaseserver' [gbasedbt@192 ~]$

GBase047.png在线转离线

在线转静态

[gbasedbt@192 ~]$ onstat - Your evaluation license will expire on 2024-02-07 00:00:00 On-Line -- Up 00:00:19 -- 597864 Kbytes [gbasedbt@192 ~]$ onmode -s Your evaluation license will expire on 2024-02-07 00:00:00 This will perform a GRACEFUL SHUTDOWN - Do you wish to continue (y/n)? y [gbasedbt@192 ~]$ onstat - Your evaluation license will expire on 2024-02-07 00:00:00 Quiescent -- Up 00:00:44 -- 597864 Kbytes [gbasedbt@192 ~]$

GBase048.png在线转静态

[gbasedbt@192 ~]$ onstat - Your evaluation license will expire on 2024-02-07 00:00:00 On-Line -- Up 00:02:16 -- 597864 Kbytes [gbasedbt@192 ~]$ onmode -u Your evaluation license will expire on 2024-02-07 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@192 ~]$ onstat - Your evaluation license will expire on 2024-02-07 00:00:00 Quiescent -- Up 00:02:28 -- 597864 Kbytes [gbasedbt@192 ~]$

GBase049.png在线转静态

静态转离线

[gbasedbt@192 ~]$ onstat - Your evaluation license will expire on 2024-02-07 00:00:00 Quiescent -- Up 00:03:53 -- 597864 Kbytes [gbasedbt@192 ~]$ onmode -k Your evaluation license will expire on 2024-02-07 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@192 ~]$ onstat - Your evaluation license will expire on 2024-02-07 00:00:00 shared memory not initialized for GBASEDBTSERVER 'gbaseserver' [gbasedbt@192 ~]$

GBase050.png静态转离线

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
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

文章被以下合辑收录

评论