暂无图片
暂无图片
1
暂无图片
暂无图片
暂无图片

openGauss每日一练第3天 | 学习心得体会

原创 郭栋 2022-11-26
919

1.创建表空间music_tbs1和多个数据库music_db、music_db1、music_db2

–进入数据库omm,创建表空间、测试数据库
$ gsql -d postgres -p 15400 -r
gsql ((openGauss 3.0.0 build 02c14696) compiled at 2022-04-01 18:12:19 commit 0 last mr  )
Non-SSL connection (SSL connection is recommended when requiring high-security)
Type "help" for help.

openGauss=# CREATE TABLESPACE music_tbs1 RELATIVE LOCATION 'tablespace/test_ts1';
CREATE TABLESPACE
openGauss=# CREATE DATABASE   music_db  WITH TABLESPACE = music_tbs1;
CREATE DATABASE
openGauss=# CREATE DATABASE   music_db1 WITH TABLESPACE = music_tbs1;
CREATE DATABASE
openGauss=# CREATE DATABASE   music_db2 WITH TABLESPACE = music_tbs1;
CREATE DATABASE


2.执行\db命令,查看openGauss数据库上有哪些表空间

openGauss=# \db
           List of tablespaces
    Name     | Owner |      Location
-------------+-------+---------------------
 music_tbs1  | omm   | tablespace/test_ts1
 pg_default  | omm   |
 pg_global   | omm   |

3.执行\l命令,查看openGauss实例中有哪些数据库

openGauss=# \l
                          List of databases
   Name    | Owner | Encoding  | Collate | Ctype | Access privileges
-----------+-------+-----------+---------+-------+-------------------
 music_db  | omm   | SQL_ASCII | C       | C     |
 music_db1 | omm   | SQL_ASCII | C       | C     |
 music_db2 | omm   | SQL_ASCII | C       | C     |
 mydb      | omm   | GBK       | C       | C     |
 postgres  | omm   | SQL_ASCII | C       | C     |
 template0 | omm   | SQL_ASCII | C       | C     | =c/omm           +
           |       |           |         |       | omm=CTc/omm
 template1 | omm   | SQL_ASCII | C       | C     | =c/omm           +
           |       |           |         |       | omm=CTc/omm
(7 rows)

4.查看openGauss数据库上实例的进程、线程

--查看实例中的进程
omm         3369       1  3 17:24 ?        00:00:11 /opt/opengauss/install/app/bin/gaussdb -D /opt/opengauss/ins
--查看实例中的线程
openGauss=# \! ps -Tp 3369
    PID    SPID TTY          TIME CMD
   3369    3369 ?        00:00:02 gaussdb
   3369    3370 ?        00:00:00 jemalloc_bg_thd
   3369    3375 ?        00:00:00 gaussdb
   3369    3376 ?        00:00:00 syslogger
   3369    3377 ?        00:00:00 alarm
   3369    3378 ?        00:00:00 reaper
   3369    3403 ?        00:00:00 checkpointer
   3369    3404 ?        00:00:00 Spbgwriter
   3369    3405 ?        00:00:00 pagewriter
   3369    3406 ?        00:00:00 pagewriter
   3369    3407 ?        00:00:00 pagewriter
   3369    3408 ?        00:00:00 pagewriter
   3369    3409 ?        00:00:00 pagewriter
   3369    3410 ?        00:00:00 WALwriter
   3369    3411 ?        00:00:00 WALwriteraux
   3369    3412 ?        00:00:00 AVClauncher
   3369    3413 ?        00:00:00 Jobscheduler
   3369    3414 ?        00:00:00 asyncundolaunch
   3369    3415 ?        00:00:00 globalstats
   3369    3416 ?        00:00:00 applylauncher
   3369    3417 ?        00:00:00 statscollector
   3369    3418 ?        00:00:00 percentworker
   3369    3419 ?        00:00:05 ashworker
   3369    3420 ?        00:00:01 TrackStmtWorker
   3369    3421 ?        00:00:00 auditor
   3369    3422 ?        00:00:00 2pccleaner
   3369    3423 ?        00:00:00 faultmonitor
   3369    3425 ?        00:00:00 undorecycler
   3369    4274 ?        00:00:00 worker
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论