GBase 8s 常用管理员命令汇总-gstat(上)

GBase 8s 常用管理员命令汇总-gstat(上)

gstat

命令 说明
gstat - 打印数据库当前运行模式
gstat -c 打印onconfig文件内容
gstat - m 打印系统在线日志最新信息
gstat - l 打印物理日志和逻辑日志使用状态
gstat -d 打印数据库空间和Chunk文件使用信息
gstat -D 打印数据库空间和Chunk文件读写信息
gstat -t 打印表空间信息
gstat -T 打印表空间信息
gstat - k 打印锁信息
gstat -p 打印系统运行状态统计
gstat -r 重复运行命令
gstat - u 打印用户线程
gstat - x 打印事务

打印数据库当前运行模式

语法

gstat -

操作演示

[gbasedbt@devsvr ~]$ gstat -
Your evaluation license will expire on 2022-10-14 00:00:00
On-Line -- Up 00:03:32 -- 333720 Kbytes

[gbasedbt@devsvr ~]$

打印onconfig文件内容

显示配置文件的内容。在输出中包含了配置文件的路径,可以通过该命令快速找到配置文件。

语法

gstat -c

操作演示

[gbasedbt@devsvr ~]$ gstat -c
Your evaluation license will expire on 2022-10-14 00:00:00
On-Line -- Up 00:04:57 -- 333720 Kbytes

Configuration File: /opt/gbase/etc/onconfig.gbase8s
##################################################################
# Licensed Material - Property Of GBASE 
#
# "Restricted Materials of GBASE"
#
# GBase
# Copyright General Data Corp. 2014, 2015. All rights reserved.
#
# Title: onconfig.std
# Description: GBase Configuration Parameters
#
# Important: $GBASEDBTDIR now resolves to the environment
# variable GBASEDBTDIR. Replace the value of the GBASEDBTDIR  
# environment variable only if the path you want is not under 
# $GBASEDBTDIR.
#
# For additional information on the parameters:
# http://www.gbase.cn
###################################################################

###################################################################
# Root Dbspace Configuration Parameters
###################################################################
# ROOTNAME     - The root dbspace name to contain reserved pages and
#                internal tracking tables.
# ROOTPATH     - The path for the device containing the root dbspace
# ROOTOFFSET   - The offset, in KB, of the root dbspace into the 
#                device. The offset is required for some raw devices. 
# ROOTSIZE     - The size of the root dbspace, in KB.  The value of 
#                200000 allows for a default user space of about 
#                100 MB and the default system space requirements.
# MIRROR       - Enable (1) or disable (0) mirroring
# MIRRORPATH   - The path for the device containing the mirrored 
#                root dbspace
# MIRROROFFSET - The offset, in KB, into the mirrored device 
#
# Warning: Always verify ROOTPATH before performing
#          disk initialization (oninit -i or -iy) to
#          avoid disk corruption of another instance
###################################################################

ROOTNAME rootdbs
ROOTPATH $GBASEDBTDIR/gbase8s_dbs/rootdbs.dbf
ROOTOFFSET 0
ROOTSIZE 204800
MIRROR 0
MIRRORPATH $GBASEDBTDIR/tmp/demo_on.root_mirror
MIRROROFFSET 0
......
BUFFERPOOL      default,buffers=10000,lrus=8,lru_min_dirty=50,lru_max_dirty=60.5
BUFFERPOOL      size=2K,buffers=50000,lrus=8,lru_min_dirty=50,lru_max_dirty=60 
BUFFERPOOL      size=16K    

打印系统在线日志最新信息

查看online日志的最新信息。在输出信息中,也包含了online日志的路径信息,可以根据该日志路径,查看online日志的完整内容。

语法

gstat -m

操作演示

[gbasedbt@devsvr ~]$ gstat -m
Your evaluation license will expire on 2022-10-14 00:00:00
On-Line -- Up 00:27:02 -- 333720 Kbytes

Message Log File: /opt/gbase/tmp/online.log
02:41:44  Loading Module <SPLNULL>
02:41:44  Auto Registration is synced
02:41:44  SCHAPI: Started 2 dbWorker threads.
02:41:47  Defragmenter cleaner thread now running
02:41:47  Defragmenter cleaner thread cleaned:0 partitions
02:42:44  Loading Module <$GBASEDBTDIR/extend/ifxmngr/ifxmngr.bld>
02:42:44  The C Language Module </opt/gbase/extend/ifxmngr/ifxmngr.bld> loaded
02:43:22  sid 4 username gbasedbt@devsvr pid 4560 terminated by onmode.
02:47:11  Checkpoint Completed:  duration was 0 seconds.
02:47:11  Mon Oct 18 - loguniq 10, logpos 0x6c018, timestamp: 0x889bb Interval: 150

02:47:11  Maximum server connections 1
02:47:11  Checkpoint Statistics - Avg. Txn Block Time 0.000, # Txns blocked 0, Plog used 26, Llog used 33

02:57:12  Checkpoint Completed:  duration was 0 seconds.
02:57:12  Mon Oct 18 - loguniq 10, logpos 0x6e018, timestamp: 0x889ca Interval: 151

02:57:12  Maximum server connections 1
02:57:12  Checkpoint Statistics - Avg. Txn Block Time 0.000, # Txns blocked 0, Plog used 17, Llog used 2


[gbasedbt@devsvr ~]$

打印物理日志和逻辑日志使用状态

显示物理日志缓冲区,逻辑日志缓冲区,逻辑日志使用情况等。

语法

gstat -l

操作演示

[gbasedbt@devsvr ~]$ gstat -l
Your evaluation license will expire on 2022-10-14 00:00:00
On-Line -- Up 00:28:09 -- 333720 Kbytes

Physical Logging
Buffer bufused  bufsize  numpages   numwrits   pages/io
  P-1  0        1024     59         4          14.75
      phybegin         physize    phypos     phyused    %used
      3:102400         102400     2324       0          0.00

Logical Logging
Buffer bufused  bufsize  numrecs    numpages   numwrits   recs/pages pages/io
  L-2  0        512      197        37         28         5.3        1.3
	Subsystem    numrecs    Log Space used
	OLDRSAM      194        38432
	HA           3          132

address          number   flags    uniqid   begin                size     used    %used
45793f88         4        U-B----  7        2:53                25600       14     0.05
45572f30         5        U-B----  8        2:25653             25600    18004    70.33
45572f98         6        U-B----  9        2:51253             25600       12     0.05
45641f30         7        U---C-L  10       2:76853             25600      112     0.44
45641f98         8        A------  0        2:102453            25600        0     0.00
45778050         9        A------  0        2:128053            25600        0     0.00
457780b8         10       A------  0        2:153653            25600        0     0.00
45778120         11       A------  0        2:179253            25600        0     0.00
45778188         12       A------  0        2:204853            25600        0     0.00
 9 active, 9 total

[gbasedbt@devsvr ~]$

物理日志标题

标题 说明
Buffer 是当前的物理日志缓冲区名称
bufused 是已使用的物理日志缓冲区页数
bufsize 是每个物理日志缓冲区的大小(以页为单位)
numpages 是写入物理日志的页数
numwrits 是对磁盘的写入数
pages/io 计算方法是 numpages/numwrits,该值指示正在缓存的物理日志写入
phybegin 是日志开始处的物理页号
physize 是物理日志的大小(以页为单位)
phypos 是日志中发生下一个日志记录写入的当前数量
phyused 是日志中已使用页的数量
%used 是已使用页的百分比

逻辑日志标题

标题 说明
Buffer 逻辑日志缓冲区数
bufused 逻辑日志缓冲区呢已使用的页数
bufsize 每个逻辑日志缓冲区的大小(以页为单位)
numrecs 是已写入记录的数量
numpages 是已写入页的数量
numwrits 是对逻辑日志的写入数
recs/pages 计算方法是 numrecs/numpages
pages/io 计算方法是 numpages/numwrits
Subsystem 子系统
numrecs 记录数
Log Space used 逻辑日志空间已使用数
address 是日志文件描述符的地址
number 是逻辑日志文件的日志标识号
flags 提供每个日志的状态
uniqid 是日志的唯一 ID 号
begin 是日志文件的起始页
size 是日志的大小(以页为单位)
used 是已使用页数量
%used 是已使用页的百分比

flags

标志 说明
A 新添加的(可以使用)
B 已备份
C 当前的逻辑日志文件
D 标记为已删除。要删除日志文件并释放其空间以再利用,那么必须对所有存储空间执
F 可用的,可以使用
L 最新的 checkpoint 记录
U 已使用的

打印数据库空间和Chunk文件使用信息

查询数据库已经创建的数据库空间,及每个数据库空间的文件编号,文件数量,文件路径,文件大小,页大小等信息。

语法

gstat -d

操作演示

[gbasedbt@devsvr ~]$ gstat -d
Your evaluation license will expire on 2022-10-14 00:00:00
On-Line -- Up 00:31:11 -- 333720 Kbytes

Dbspaces
address          number   flags      fchunk   nchunks  pgsize   flags    owner    name
45641028         1        0x40001    1        1        2048     N  BA    gbasedbt rootdbs
45778280         2        0x40001    2        1        2048     N  BA    gbasedbt llogdbs
457784b0         3        0x1040001  3        1        2048     N PBA    gbasedbt plogdbs
457786e0         4        0x42001    4        1        16384    N TBA    gbasedbt tempdbs1
45778910         5        0x42001    5        1        16384    N TBA    gbasedbt tempdbs2
45778b40         6        0x42001    6        1        16384    N TBA    gbasedbt tempdbs3
45778d70         7        0x40011    7        2        32768    N BBA    gbasedbt binspaces
46ac0028         8        0x48001    9        2        2048     N SBA    gbasedbt sbspaces
46ac0258         9        0x40001    11       1        2048     N  BA    gbasedbt datadbs1
46ac0488         10       0x40001    12       1        2048     N  BA    gbasedbt datadbs2
46ac06b8         11       0x40001    13       1        2048     N  BA    gbasedbt datadbs3
46ac08e8         12       0x40001    14       1        2048     N  BA    gbasedbt datadbs4
46ac0b18         13       0x40001    15       1        2048     N  BA    gbasedbt datadbs5
 13 active, 2047 maximum

Note: For BLOB chunks, the number of free pages shown is out of date.
      Run 'onstat -d update' for current stats.

Chunks
address          chunk/dbs     offset     size       free       bpages     flags pathname
45641258         1      1      0          102400     90940                 PO-B-- /opt/gbase/gbase8s_dbs/rootdbs.dbf
46ac2028         2      2      0          256000     25547                 PO-B-- /opt/gbase/gbase8s_dbs/llogdbs.dbf
46ac3028         3      3      0          204800     102347                PO-BE- /opt/gbase/gbase8s_dbs/plogdbs.dbf
46ac4028         4      4      0          32000      31947                 PO-B-- /opt/gbase/gbase8s_dbs/tempdbs1.dbf
46ac5028         5      5      0          32000      31947                 PO-B-- /opt/gbase/gbase8s_dbs/tempdbs2.dbf
46ac6028         6      6      0          32000      31947                 PO-B-- /opt/gbase/gbase8s_dbs/tempdbs3.dbf
46ac7028         7      7      0          51200     ~3200       3200       POBB-- /opt/gbase/gbase8s_dbs/binspaces_1.dbf
46ac8028         8      7      0          51200     ~3200       3200       POBB-- /opt/gbase/gbase8s_dbs/binspaces_2.dbf
46ac9028         9      8      0          51200      47678      47678      POSB-- /opt/gbase/gbase8s_dbs/sbspaces_1.dbf
                                 Metadata 3469       1700       3469
46aca028         10     8      0          51200      47725      47725      POSB-- /opt/gbase/gbase8s_dbs/sbspaces_2.dbf
                                 Metadata 3472       3472       3472
46acb028         11     9      0          102400     99009                 PO-B-- /opt/gbase/gbase8s_dbs/datadbs1_1.dbf
46acc028         12     10     0          102400     102347                PO-B--
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值