操作系统环境:Linux
1. 查看数据库进程,线程
root@modb:~# ps -ef |grep -i gauss
root@modb:~# ps -Tp 1
PID SPID TTY TIME CMD
1 1 ? 00:00:00 gaussdb
1 293 ? 00:00:00 jemalloc_bg_thd
1 299 ? 00:00:00 gaussdb
1 300 ? 00:00:00 syslogger
1 301 ? 00:00:00 jemalloc_bg_thd
2. 使用gs_ctl status 看数据库状态:
omm@modb:~$ gs_ctl status
[2022-11-24 13:38:07.513][450][][gs_ctl]: gs_ctl status,datadir is /var/lib/opengauss/data
gs_ctl: server is running (PID: 1)
/usr/local/opengauss/bin/gaussdb
3. 使用gs_ctl 查看数据文件的目录
omm@modb:~$ gs_ctl notify
[2022-11-24 13:45:00.482][496][][gs_ctl]: gs_ctl notify ,datadir is /var/lib/opengauss/data
4. 查看omm用户的环境变量
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
5. 从omm用户的环境变量文件里查看gaussDB的目录
omm@modb:~$ cat ~/.bashrc |grep -i PGDATA
export PGDATA=/var/lib/opengauss/data
6. 查看数据文件目录和数据库版本
root@modb:~# su - omm
omm@modb:~$ gsql -r
gsql ((openGauss 3.0.0 build 02c14696) compiled at 2022-04-01 18:12:00 commit 0 last mr )
Non-SSL connection (SSL connection is recommended when requiring high-security)
Type "help" for help.
omm=# show data_directory ;
data_directory
-------------------------
/var/lib/opengauss/data
(1 row)
omm=# select version();
version
---------------------------------------------------------------------------------------------
----------------------------------------------------------
(openGauss 3.0.0 build 02c14696) compiled at 2022-04-01 18:12:00 commit 0 last mr on aarch
64-unknown-linux-gnu, compiled by g++ (GCC) 7.3.0, 64-bit
(1 row)
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




