一个PostgreSql cli的工具

news2024/10/5 23:25:59

        GitHub - xuejiazhi/pgii: pgii is a PostgreSql cli tool. PostgreSql is developed in CMD or Golang and can be compiled for multiple platforms

        pgii 是一个PostgreSql cli的工具,对PostgreSql 在CMD或者,采用Golang进行开发,可以多平台下面编译使用:

  • 跨平台: 可以在多平台下编译,跨平台使用;
  • 零学习成本:类似于MySQL Cli的指令,对熟悉mysql操作的人上手快;
  • 互动 Console: 通过命令行 console。
  • 增加了交互式提示: 可以提示要输入的命令 

登录

cmd:

  ./pgii [-h|--host] [-u|--user] [-p|--password] [-d|--db] [--port]
      [-h|--host] postgresql 数据库地址  # eg: -h localhost | --host=localhost
      [-u|--user] 数据库用户名  # eg: -u postgres | --user=postgres
      [-p|--password]  数据库密码  # eg: -p postgres | --password=postgres
      [-d|--db] 选择的数据库 默认为postgres # eg: -d postgres | --db=postgres
      [--port] 指定的端口 # eg: --port=5432

  #### 示例
  $ pgii -h 127.0.0.1 -u postgres -p 123456 
    Connect Pgsql Success Host 127.0.0.1
    PostgresSql Version: 14.5
    pgii~[postgres/]#

设置语言

set language <cn|en>

功能:

使用些命令设置语言后,指令的头部显示可以是中文或英文

使用方式:

pgii~[postgres/]# show db;
+--------+-------------+----------+----------+------------+----------+-----------+-----------+------------+------------+---------+
| #OID   | DBNAME      | AUTH     | ENCODING | LC_COLLATE | LC_CTYPE | ALLOWCONN | CONNLIMIT | LASTSYSOID | TABLESPACE | SIZE    |
| 13891  | template0   | postgres | UTF8     | C          | C        | false     |        -1 | 13891      | pg_default | 8385 kB |
+--------+-------------+----------+----------+------------+----------+-----------+-----------+------------+------------+---------+
| 280382 | benchmark   | postgres | UTF8     | C          | C        | true      |        -1 | 13891      | pg_default | 10 MB   |
+--------+-------------+----------+----------+------------+----------+-----------+-----------+------------+------------+---------+
pgii~[postgres/]# set language cn;
Set Language Success
pgii~[postgres/]# show db;
+--------+-------------+--------------+----------+------------+----------+----------+----------------+-----------------+------------+------------+
| #OID   | 数据库      | 数据库拥用者 | 字符编码 | LC_COLLATE | LC_CTYPE | 允许连接 | 最大并发连接数 | 最后一个系统OID | 表空间     | 数据库尺寸 |
+--------+-------------+--------------+----------+------------+----------+----------+----------------+-----------------+------------+------------+
| 13892  | postgres[✓] | postgres     | UTF8     | C          | C        | true     |             -1 | 13891           | pg_default | 8537 kB    |
+--------+-------------+--------------+----------+------------+----------+----------+----------------+-----------------+------------+------------+
| 16384  | clouddb     | postgres     | UTF8     | C          | C        | true     |             -1 | 13891           | pg_default | 25 MB      |
+--------+-------------+--------------+----------+------------+----------+----------+----------------+-----------------+------------+------------+
| 1      | template1   | postgres     | UTF8     | C          | C        | true     |             -1 | 13891           | pg_default | 8385 kB    |
+--------+-------------+--------------+----------+------------+----------+----------+----------------+-----------------+------------+------------+
| 13891  | template0   | postgres     | UTF8     | C          | C        | false    |             -1 | 13891           | pg_default | 8385 kB    |
+--------+-------------+--------------+----------+------------+----------+----------+----------------+-----------------+------------+------------+
| 280382 | benchmark   | postgres     | UTF8     | C          | C        | true     |             -1 | 13891           | pg_default | 10 MB      |
+--------+-------------+--------------+----------+------------+----------+----------+----------------+-----------------+------------+------------+

相关指令

use 指令

use <db|database>

  功能:
    用于选择数据库,选中数据后,可以使用show db 或 show selectdb 查看当前选中的数据库
  用法:
    pgii~[postgres/]# use db benchmark
	pgii~[postgres/]# use database benchmark
      # Use Database Success!
    pgii~[benchmark/]#

use <sc|schema>

  功能:
    用于选择数据库模式,选中模式后,可以使用show sc 或 show schema 查看当前选中的模式
  用法:
    pgii~[benchmark/]# use sc  public;
	pgii~[benchmark/]# use schema public;
     # Use Schema Success!
    pgii~[benchmark/public]#

show 指令

show <db|database>

  功能:
    用于查看数据库的相关信息,包括当前选中的库,以及库的大小
  用法
   pgii~[postgres/]# show database;
   pgii~[postgres/]# show db;
+-------+-------------+----------+----------+------------+----------+-----------+-----------+------------+------------+---------+
| #OID  | DBNAME      | AUTH     | ENCODING | LC_COLLATE | LC_CTYPE | ALLOWCONN | CONNLIMIT | LASTSYSOID | TABLESPACE | SIZE    |
+-------+-------------+----------+----------+------------+----------+-----------+-----------+------------+------------+---------+
| 13892 | postgres[✓] | postgres | UTF8     | C          | C        | true      |        -1 | 13891      | pg_default | 8537 kB |
| 16384 | clouddb     | postgres | UTF8     | C          | C        | true      |        -1 | 13891      | pg_default | 18 MB   |
| 1     | template1   | postgres | UTF8     | C          | C        | true      |        -1 | 13891      | pg_default | 8385 kB |
| 13891 | template0   | postgres | UTF8     | C          | C        | false     |        -1 | 13891      | pg_default | 8385 kB |
| 91966 | benchmark   | postgres | UTF8     | C          | C        | true      |        -1 | 13891      | pg_default | 3370 MB |
+-------+-------------+----------+----------+------------+----------+-----------+-----------+------------+------------+---------+

show <sc|schema>

  功能:
    用于查看数据库的相关模式信息,包括当前选中的模式
  用法
   pgii~[postgres/]# show schema;
   pgii~[postgres/]# show sc;
┌───────┬──────────────────────────┬──────────┬─────────────────────────────────────┐
│ #OID  │ SCHEMANAME               │ OWNER    │ ACL                                 │
├───────┼──────────────────────────┼──────────┼─────────────────────────────────────┤
│ 99    │ pg_toast                 │ postgres │ <nil>                               │
│ 11    │ pg_catalog               │ postgres │ {postgres=UC/postgres,=U/postgres}  │
│ 2200  │ public[✓]                │ postgres │ {postgres=UC/postgres,=UC/postgres} │
│ 13526 │ information_schema       │ postgres │ {postgres=UC/postgres,=U/postgres}  │
│ 91989 │ _timescaledb_cache       │ postgres │ {postgres=UC/postgres,=U/postgres}  │
│ 91987 │ _timescaledb_catalog     │ postgres │ {postgres=UC/postgres,=U/postgres}  │
│ 91988 │ _timescaledb_internal    │ postgres │ {postgres=UC/postgres,=U/postgres}  │
│ 91990 │ _timescaledb_config      │ postgres │ {postgres=UC/postgres,=U/postgres}  │
│ 91992 │ timescaledb_information  │ postgres │ {postgres=UC/postgres,=U/postgres}  │
│ 91991 │ timescaledb_experimental │ postgres │ {postgres=UC/postgres,=U/postgres}  │
└───────┴──────────────────────────┴──────────┴─────────────────────────────────────┘

show <tb|table> [filter|equal] [value]

  功能:
    用于查看数据库的相关表信息,使用filter,可以过滤TABLENAME包含value的记录,equal 为全等于
  用法
   pgii~[postgres/]# show table;
   pgii~[postgres/]# show tb;
+--------+-----------+------------+------------+-----------+-----------+
| SCHEMA | TABLENAME | TABLEOWNER | TABLESPACE | TABLESIZE | INDEXSIZE |
+--------+-----------+------------+------------+-----------+-----------+
| public | tags      | postgres   | <nil>      | 400 kB    | 264 kB    |
+--------+-----------+------------+------------+-----------+-----------+
| public | cpu       | postgres   | <nil>      | 32 kB     | 24 kB     |
+--------+-----------+------------+------------+-----------+-----------+
pgii~[benchmark/public]# show tb filter c
+--------+-----------+------------+------------+-----------+-----------+
| SCHEMA | TABLENAME | TABLEOWNER | TABLESPACE | TABLESIZE | INDEXSIZE |
+--------+-----------+------------+------------+-----------+-----------+
| public | cpu       | postgres   | <nil>      | <nil>     | <nil>     |
+--------+-----------+------------+------------+-----------+-----------+

show <vw|view> [filter|equal] [value]

  功能:
    用于查看数据库的相关视图信息,使用filter,可以过滤VIEWNAME包含value的记录,equal 为全等于
  用法
   pgii~[postgres/]# show view;
   pgii~[postgres/]# show vw;
+--------+----------+-----------+
| SCHEMA | VIEWNAME | VIEWOWNER |
+--------+----------+-----------+
| public | cpu_view | postgres  |
+--------+----------+-----------+
pgii~[benchmark/public]# show tb filter c
+--------+----------+-----------+
| SCHEMA | VIEWNAME | VIEWOWNER |
+--------+----------+-----------+
| public | cpu_view | postgres  |
+--------+----------+-----------+

show <tg|trigger> [filter|equal] [value]

  功能:
    用于查看数据库的相关触发器信息,使用filter,可以过滤触发器包含value的记录,equal 为全等于
  用法
   pgii~[postgres/]# show tg;
   pgii~[postgres/]# show trigger;
+-----------+--------+-------------------+--------------------+--------------------+--------------------+---------------+
| DATABASE  | SCHEMA | TRIGGER_NAME      | EVENT_MANIPULATION | EVENT_OBJECT_TABLE | ACTION_ORIENTATION | ACTION_TIMING |
+-----------+--------+-------------------+--------------------+--------------------+--------------------+---------------+
| benchmark | public | ts_insert_blocker | INSERT             | cpu                | ROW                | BEFORE        |
+-----------+--------+-------------------+--------------------+--------------------+--------------------+---------------+
pgii~[benchmark/public]# show trigger filter ts;
+-----------+--------+-------------------+--------------------+--------------------+--------------------+---------------+
| DATABASE  | SCHEMA | TRIGGER_NAME      | EVENT_MANIPULATION | EVENT_OBJECT_TABLE | ACTION_ORIENTATION | ACTION_TIMING |
+-----------+--------+-------------------+--------------------+--------------------+--------------------+---------------+
| benchmark | public | ts_insert_blocker | INSERT             | cpu                | ROW                | BEFORE        |
+-----------+--------+-------------------+--------------------+--------------------+--------------------+---------------+

show <ver|version>

  功能:
    用于查看数据库的相关版本信息
  用法
   pgii~[postgres/]# show version;
   pgii~[postgres/]# show ver;
+-------------+---------+
| #           | VERSION |
+-------------+---------+
| PostgresSql | 14.5    |
+-------------+---------+

show <sd|selectdb>

  功能:
    用于查看数据库的当前选中的database 和schema
  用法
   pgii~[benchmark/public]# show sd;
   pgii~[benchmark/public]# show selectdb;
     DataBase: benchmark ;Schema: public

show <connection|conn>

功能:

用于查看链接的一些参数 MAX_CONNECTION 最大连接数 SUPERUSER_RESERVED_CONNECTIONS 超级用户保留的连接数 REMAINING_CONNECTIONS 剩余连接数 INUSE_CONNECTIONS 当前正使用的连接数

方法:

pgii~[benchmark/public]# show connection;
+----------------+--------------------------------+-----------------------+-------------------+
| MAX_CONNECTION | SUPERUSER_RESERVED_CONNECTIONS | REMAINING_CONNECTIONS | INUSE_CONNECTIONS |
+----------------+--------------------------------+-----------------------+-------------------+
|            800 |                             13 |                   760 |                40 |
+----------------+--------------------------------+-----------------------+-------------------+

show <process|proc> [all]|[pid start and end]

功能:

用于查看当前数据库中的会话: all: 如果没有带 all 参数,那么只显示当前选择数据库下面的会话,带了all显示所有的会话; pid: 列出pid 在 start 和 end 区间内的会话

方法:

pgii~[postgres/]# show process;
+--------+---------------+-----------+---------------+-------------+--------------------------------------+--------+
| PID    | DATABASE_NAME | USER_NAME | CLIENT_ADDR   | CLIENT_PORT | APPLICATION_NAME                     | STATE  |
+--------+---------------+-----------+---------------+-------------+--------------------------------------+--------+
| 142668 | postgres      | postgres  | 10.161.55.214 | 56766       | DBeaver 22.0.2 - Main <postgres>     | idle   |
+--------+---------------+-----------+---------------+-------------+--------------------------------------+--------+
| 142669 | postgres      | postgres  | 10.161.55.214 | 56767       | DBeaver 22.0.2 - Metadata <postgres> | idle   |
+--------+---------------+-----------+---------------+-------------+--------------------------------------+--------+
| 206841 | postgres      | postgres  | 10.161.55.214 | 42969       |                                      | active |
+--------+---------------+-----------+---------------+-------------+--------------------------------------+--------+
pgii~[postgres/]# show process all; 
+--------+---------------+-----------+-----------------+-------------+--------------------------------------------+--------+
| PID    | DATABASE_NAME | USER_NAME | CLIENT_ADDR     | CLIENT_PORT | APPLICATION_NAME                           | STATE  |
+--------+---------------+-----------+-----------------+-------------+--------------------------------------------+--------+
| 88720  |               |           |                 |             |                                            |        |
+--------+---------------+-----------+-----------------+-------------+--------------------------------------------+--------+
| 117720 | clouddb       | postgres  | 100.123.237.153 | 38390       |                                            | idle   |
+--------+---------------+-----------+-----------------+-------------+--------------------------------------------+--------+
| 90141  | clouddb       | postgres  | 100.123.237.196 | 54220       |                                            | idle   |
+--------+---------------+-----------+-----------------+-------------+--------------------------------------------+--------+
| 142668 | postgres      | postgres  | 10.161.55.214   | 56766       | DBeaver 22.0.2 - Main <postgres>           | idle   |
+--------+---------------+-----------+-----------------+-------------+--------------------------------------------+--------+
| 142669 | postgres      | postgres  | 10.161.55.214   | 56767       | DBeaver 22.0.2 - Metadata <postgres>       | idle   |
+--------+---------------+-----------+-----------------+-------------+--------------------------------------------+--------+
| 142670 | clouddb       | postgres  | 10.161.55.214   | 56768       | DBeaver 22.0.2 - SQLEditor <Script-24.sql> | idle   |
+--------+---------------+-----------+-----------------+-------------+--------------------------------------------+--------+
| 142671 | clouddb       | postgres  | 10.161.55.214   | 56769       | DBeaver 22.0.2 - Main <clouddb>            | idle   |
+--------+---------------+-----------+-----------------+-------------+--------------------------------------------+--------+
| 142672 | clouddb       | postgres  | 10.161.55.214   | 56770       | DBeaver 22.0.2 - Metadata <clouddb>        | idle   |
+--------+---------------+-----------+-----------------+-------------+--------------------------------------------+--------+
| 206841 | postgres      | postgres  | 10.161.55.214   | 42969       |                                            | active |
+--------+---------------+-----------+-----------------+-------------+--------------------------------------------+--------+
| 33133  |               |           |                 |             |                                            |        |
+--------+---------------+-----------+-----------------+-------------+--------------------------------------------+--------+
| 33135  |               |           |                 |             |                                            |        |
+--------+---------------+-----------+-----------------+-------------+--------------------------------------------+--------+
pgii~[postgres/]# show process pid 1 and 88585; 
+-------+---------------+-----------+-----------------+-------------+------------------+-------+
| PID   | DATABASE_NAME | USER_NAME | CLIENT_ADDR     | CLIENT_PORT | APPLICATION_NAME | STATE |
+-------+---------------+-----------+-----------------+-------------+------------------+-------+
| 88585 | clouddb       | postgres  | 100.123.237.162 | 54040       |                  | idle  |
+-------+---------------+-----------+-----------------+-------------+------------------+-------+
| 88583 | clouddb       | postgres  | 100.123.237.150 | 58828       |                  | idle  |
+-------+---------------+-----------+-----------------+-------------+------------------+-------+
| 88581 |               | postgres  |                 |             |                  |       |
+-------+---------------+-----------+-----------------+-------------+------------------+-------+
| 88579 | clouddb       | postgres  | 100.123.237.196 | 35001       |                  | idle  |
+-------+---------------+-----------+-----------------+-------------+------------------+-------+
| 88578 | clouddb       | postgres  | 100.123.237.148 | 48182       |                  | idle  |
+-------+---------------+-----------+-----------------+-------------+------------------+-------+
| 88577 | clouddb       | postgres  | 100.123.237.149 | 44360       |                  | idle  |
+-------+---------------+-----------+-----------------+-------------+------------------+-------+
| 88576 | clouddb       | postgres  | 100.123.237.154 | 43840       |                  | idle  |
+-------+---------------+-----------+-----------------+-------------+------------------+-------+
| 88575 | clouddb       | postgres  | 100.123.237.164 | 57554       |                  | idle  |
+-------+---------------+-----------+-----------------+-------------+------------------+-------+
| 33135 |               |           |                 |             |                  |       |
+-------+---------------+-----------+-----------------+-------------+------------------+-------+
| 33133 |               |           |                 |             |                  |       |
+-------+---------------+-----------+-----------------+-------------+------------------+-------+
| 33134 |               |           |                 |             |                  |       |
+-------+---------------+-----------+-----------------+-------------+------------------+-------+

desc 指令

desc

  功能:
     用于查看表结构
  用法
    pgii~[benchmark/public]# desc cpu;
+----+------------------+-------------+--------+--------+--------------+
| #  | COLUMN           | DATATYPE    | LENGTH | ISNULL | DEFAULTVALUE |
+----+------------------+-------------+--------+--------+--------------+
| 1  | time             | timestamptz | <nil>  | NO     | <nil>        |
| 2  | tags_id          | int4        | <nil>  | YES    | <nil>        |
| 3  | hostname         | text        | <nil>  | YES    | <nil>        |
| 4  | usage_user       | float8      | <nil>  | YES    | <nil>        |
| 5  | usage_system     | float8      | <nil>  | YES    | <nil>        |
| 6  | usage_idle       | float8      | <nil>  | YES    | <nil>        |
| 7  | usage_nice       | float8      | <nil>  | YES    | <nil>        |
| 8  | usage_iowait     | float8      | <nil>  | YES    | <nil>        |
| 9  | usage_irq        | float8      | <nil>  | YES    | <nil>        |
| 10 | usage_softirq    | float8      | <nil>  | YES    | <nil>        |
| 11 | usage_steal      | float8      | <nil>  | YES    | <nil>        |
| 12 | usage_guest      | float8      | <nil>  | YES    | <nil>        |
| 13 | usage_guest_nice | float8      | <nil>  | YES    | <nil>        |
| 14 | additional_tags  | jsonb       | <nil>  | YES    | <nil>        |
+----+------------------+-------------+--------+--------+--------------+

size 指令

size <db|database>

  功能:
     用于查看数据库的大小
  用法
    pgii~[benchmark/public]# size database benchmark;
    pgii~[benchmark/public]# size db benchmark;
┌───────────┬─────────┐
│ DATABASE  │ SIZE    │
├───────────┼─────────┤
│ benchmark │ 3370 MB │
└───────────┴─────────┘

size <tb|table>

功能:

用于查看数据库表的大小

方法:

  pgii~[benchmark/public]# size table cpu;
  pgii~[benchmark/public]# size tb cpu;
┌───────────┬───────┐
│ TABLENAME │ SIZE  │
├───────────┼───────┤
│ cpu       │ 32 kB │
└───────────┴───────┘

size <tbsp|tablespace>

功能:

用于查看表空间的大小

方法:

pgii~[benchmark/public]# size tablespace pg_default;
+-----------------+-----------------+
| TABLESPACE_NAME | TABLESPACE_SIZE |
+-----------------+-----------------+
| pg_default      | 60 MB           |
+-----------------+-----------------+

ddl 指令

ddl <tb|table>

  功能:
     用于查看表的ddl建表语句
  用法
  pgii~[benchmark/public]# ddl table cpu;
  pgii~[benchmark/public]# ddl tb cpu;
========= Create Table Success ============
-- DROP Table;
-- DROP Table cpu;
CREATE TABLE "public".cpu (
    time timestamptz NOT NULL,
    tags_id int4 NULL,
    hostname text NULL,
    usage_user float8 NULL,
    usage_system float8 NULL,
    usage_idle float8 NULL,
    usage_nice float8 NULL,
    usage_iowait float8 NULL,
    usage_irq float8 NULL,
    usage_softirq float8 NULL,
    usage_steal float8 NULL,
    usage_guest float8 NULL,
    usage_guest_nice float8 NULL,
    additional_tags jsonb NULL
);
CREATE INDEX cpu_usage_user_time_idx ON public.cpu USING btree (usage_user, "time" DESC);
CREATE INDEX cpu_time_idx ON public.cpu USING btree ("time" DESC);
CREATE INDEX cpu_hostname_time_idx ON public.cpu USING btree (hostname, "time" DESC);

ddl <sc|schema>

  功能:
     用于查看模式的ddl建表语句
  用法
  pgii~[benchmark/public]# ddl schema public;
  pgii~[benchmark/public]# ddl sc public;
========= Create Schema Success ============
-- DROP SCHEMA public;
CREATE SCHEMA "public" AUTHORIZATION postgres;

ddl <vw|view>

  功能:
     用于查看视图的ddl建表语句
  用法
  pgii~[benchmark/public]# ddl view cpu_view;
  pgii~[benchmark/public]# ddl vw cpu_view;
========= Create View Success ============
 CREATE OR REPLACE VIEW "public".cpu_view
 AS SELECT cpu."time",
    cpu.tags_id,
    cpu.hostname,
    cpu.usage_user,
    cpu.usage_system,
    cpu.usage_idle,
    cpu.usage_nice,
    cpu.usage_iowait,
    cpu.usage_irq,
    cpu.usage_softirq,
    cpu.usage_steal,
    cpu.usage_guest,
    cpu.usage_guest_nice,
    cpu.additional_tags
   FROM cpu
  WHERE ((cpu."time" > '2023-03-01 08:00:00+08'::timestamp with time zone) AND (cpu.tags_id > 10) AND (cpu.tags_id < 1000) AND (cpu.usage_user = ANY (ARRAY[(21)::double precision, (22)::double precision, (23)::double precision, (24)::double precision, (25)::double precision, (26)::double precision, (27)::double precision, (28)::double precision, (29)::double precision])));

kill 指令

kill pid

功能:

关闭数据库中的会话,关闭后可以使用“show proc”查看是否关闭

用法:

pgii~[postgres/]# kill pid 33134;
Kill Process Success,pid[33134]

dump 指令

dump <tb|table>

  功能:
     用于dump一个表的备份文件,可以用于后续的恢复;
  用法
    pgii~[clouddb/common]# dump tb role;
      Dump Table Success
    ## linux下查看
    [root@localhost src]# ls *.pgi
      dump_table_role_time.pgi

dump <sc|schema>

  功能:
     用于dump当前模式和下面的表的建模式语句和建表语句,并将表下面数据生成批量插入的T-SQL语句,生成一个pgi文件;
  用法
    pgii~[clouddb/db_mcs.com]# dump sc;
        Dump Schema Success [db_mcs.com]
        Dump Table Struct Success [dgna]
         ->Dump Table Record Success [dgna]
        Dump Table Struct Success [dgna_member]
         ->Dump Table Record Success [dgna_member]
        Dump Table Struct Success [syspatch_info]
         ->Dump Table Record Success [syspatch_info]
        Dump Table Struct Success [syspatch_member]
         ->Dump Table Record Success [syspatch_member]
        Dump Table Struct Success [predefineddgna_info]
         ->Dump Table Record Success [predefineddgna_info]
        Dump Table Struct Success [simulselect_info]
         ->Dump Table Record Success [simulselect_info]
        Dump Table Struct Success [simulselect_member]
         ->Dump Table Record Success [simulselect_member]
    ## linux下查看
    [root@localhost src]# ls *.pgi
       dump_schema_db_mcs.com.pgi

dump <db|database>

功能:

用于dump当前选择的数据库下面,并生成创建库,模式,表的语句,并将表里的数据生成批量插入的数据,生成一个压缩的pgi文件;

方法:

pgii~[clouddb/]# dump db;
>Dump DataBase Begin
Dump DataBase Struct Success            
----------------------------------------
>>Dump Schema Success[db_mcs1.com]      
>>>Dump Table Struct Success [pub_vpn]
 >>>>Dump Table Record Success ["db_mcs1.com".pub_vpn]
>>>Dump Table Struct Success [userprofile]
 >>>>Dump Table Record Success ["db_mcs1.com".userprofile]
>>>Dump Table Struct Success [pub_groupprofile]
 >>>>Dump Table Record Success ["db_mcs1.com".pub_groupprofile]
>>>Dump Table Struct Success [mcs_groupprofile]
 >>>>Dump Table Record Success ["db_mcs1.com".mcs_groupprofile]
>>>Dump Table Struct Success [pub_groupmember]
 >>>>Dump Table Record Success ["db_mcs1.com".pub_groupmember]
>>>Dump Table Struct Success [mcs_blacklist]
 >>>>Dump Table Record Success ["db_mcs1.com".mcs_blacklist]
>>>Dump Table Struct Success [mcs_groupareaconfig]
 >>>>Dump Table Record Success ["db_mcs1.com".mcs_groupareaconfig]
>>>Dump Table Struct Success [mcs_groupgpsareaconfig]
 >>>>Dump Table Record Success ["db_mcs1.com".mcs_groupgpsareaconfig]
>>>Dump Table Struct Success [pub_ldsvpn]
 >>>>Dump Table Record Success ["db_mcs1.com".pub_ldsvpn]
>>>Dump Table Struct Success [pub_record_user]
 >>>>Dump Table Record Success ["db_mcs1.com".pub_record_user]
>>>Dump Table Struct Success [pub_record_group]
 >>>>Dump Table Record Success ["db_mcs1.com".pub_record_group]
>>>Dump Table Struct Success [pub_record_vpn]
 >>>>Dump Table Record Success ["db_mcs1.com".pub_record_vpn]
>>>Dump Table Struct Success [mcs_user_area_authorize]
 >>>>Dump Table Record Success ["db_mcs1.com".mcs_user_area_authorize]
>>>Dump Table Struct Success [pub_ldsgmk]
 >>>>Dump Table Record Success ["db_mcs1.com".pub_ldsgmk]
>>>Dump Table Struct Success [pub_grouppatch_gmk]
 >>>>Dump Table Record Success ["db_mcs1.com".pub_grouppatch_gmk]
>>>Dump Table Struct Success [kms_random]
 >>>>Dump Table Record Success ["db_mcs1.com".kms_random]
>>>Dump Table Struct Success [callrecord]
 >>>>Dump Table Record Success ["db_mcs1.com".callrecord]
>>>Dump Table Struct Success [datarecord]
 >>>>Dump Table Record Success ["db_mcs1.com".datarecord]
>>>Dump Table Struct Success [t_frs_fileinfo]
 >>>>Dump Table Record Success ["db_mcs1.com".t_frs_fileinfo]
>>>Dump Table Struct Success [ue_register_backup]
 >>>>Dump Table Record Success ["db_mcs1.com".ue_register_backup]
>>>Dump Table Struct Success [mcs_user_contact_list]
 >>>>Dump Table Record Success ["db_mcs1.com".mcs_user_contact_list]
>>>Dump Table Struct Success [fa_info]
 >>>>Dump Table Record Success ["db_mcs1.com".fa_info]
>>>Dump Table Struct Success [fa_users]
 >>>>Dump Table Record Success ["db_mcs1.com".fa_users]
>>>Dump Table Struct Success [fa_history]
 >>>>Dump Table Record Success ["db_mcs1.com".fa_history]
>>>Dump Table Struct Success [user_roles]
 >>>>Dump Table Record Success ["db_mcs1.com".user_roles]
>>>Dump Table Struct Success [group_roles]
 >>>>Dump Table Record Success ["db_mcs1.com".group_roles]
>>>Dump Table Struct Success [pcall_role_pri]
 >>>>Dump Table Record Success ["db_mcs1.com".pcall_role_pri]
>>>Dump Table Struct Success [gcall_role_pri]
 >>>>Dump Table Record Success ["db_mcs1.com".gcall_role_pri]
>>>Dump Table Struct Success [mcs_user_common_sms_list]
 >>>>Dump Table Record Success ["db_mcs1.com".mcs_user_common_sms_list]
>>>Dump Table Struct Success [tetra_gid]
 >>>>Dump Table Record Success ["db_mcs1.com".tetra_gid]
>>>Dump Table Struct Success [service_priority]
 >>>>Dump Table Record Success ["db_mcs1.com".service_priority]
----------------------------------------
>>Dump Schema Success[public]
tips:Dump Cmd Table fail,no table in Schema!
----------------------------------------
>>Dump Schema Success[common]
>>>Dump Table Struct Success [app_cfg]
 >>>>Dump Table Record Success ["common".app_cfg]
>>>Dump Table Struct Success [gw_info]
 >>>>Dump Table Record Success ["common".gw_info]
>>>Dump Table Struct Success [listening_info]
 >>>>Dump Table Record Success ["common".listening_info]
>>>Dump Table Struct Success [mcs_user_area]
 >>>>Dump Table Record Success ["common".mcs_user_area]
>>>Dump Table Struct Success [tenant_info]
 >>>>Dump Table Record Success ["common".tenant_info]
>>>Dump Table Struct Success [pstn_info]
 >>>>Dump Table Record Success ["common".pstn_info]
>>>Dump Table Struct Success [terminal_statistic]
 >>>>Dump Table Record Success ["common".terminal_statistic]
>>>Dump Table Struct Success [tetra_cfg]
 >>>>Dump Table Record Success ["common".tetra_cfg]
----------------------------------------
## linux下查看
[root@localhost src]# ls *.pgi
dump_Database_clouddb_1680227905.pgi

explain

功能:

用于分析T-SQL执行计划

方法:

pgii~[clouddb/db_mcs.com]# explain ANALYZE select * from userprofile;
+---------------------------------------------------------------------------------------------------------------+
| QUERY PLAN                                                                                                    |
+---------------------------------------------------------------------------------------------------------------+
| Seq Scan on userprofile  (cost=0.00..105.41 rows=2241 width=230) (actual time=0.024..0.705 rows=2241 loops=1) |
| Planning time: 0.131 ms                                                                                       |
| Execution time: 0.882 ms                                                                                      |
+---------------------------------------------------------------------------------------------------------------+
[Total: 3 Rows]  [RunTimes 3.50s]

pgii~[clouddb/db_mcs.com]# explain  select * from userprofile;        
+------------------------------------------------------------------+
| QUERY PLAN                                                       |
+------------------------------------------------------------------+
| Seq Scan on userprofile  (cost=0.00..105.41 rows=2241 width=230) |
+------------------------------------------------------------------+
[Total: 1 Rows]  [RunTimes 2.18s]

TODO

  • dump database ✅
  • kill pid ✅
  • show process ✅
  • load table
  • load schema
  • load database

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/425967.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

C/C++|物联网开发入门+项目实战|嵌入式C语言高级|C语言常用关键字及运算符操作-学习笔记(8)

文章目录2-2: C语言常用关键字及运算符操作关键字参考&#xff1a; 麦子学院-嵌入式C语言高级2-2: C语言常用关键字及运算符操作 [重点] 掌握C语言的常用关键宇及其应用场景&#xff0c;使用技巧 关键字 编译器&#xff1a;预先定义了一定意义的字符串&#xff0c;32个。 s…

RHCE3

综合练习&#xff1a;请给openlab搭建web网站 ​ 网站需求&#xff1a; ​ 1.基于域名[www.openlab.com](http://www.openlab.com)可以访问网站内容为 welcome to openlab!!! ​ 2.给该公司创建三个子界面分别显示学生信息&#xff0c;教学资料和缴费网站&#xff0c;基于[www.…

对Spring循环依赖的一些理解

什么是循环依赖 类A有个字段需要注入类B&#xff0c;类B有个字段需要注入类C&#xff0c;类C有个字段需要注入类A&#xff0c;它们之间的依赖关系形成了一个循环。 Spring初始化完一个对象之后会把实例放入单例池&#xff08;singletonObjects&#xff09;中&#xff0c;也就是…

【FFT】快速傅里叶变换

开个新坑&#xff0c; 快速傅里叶变换在现在世界的各个领域都发挥重要作用。 包括音视频压缩、5G、WIFI、卷积、航空、雷达、核武等等 为什么使用快速傅里叶变换 快速傅里叶变换计算复杂度仅为O(nlogn) 而原傅里叶变换是O(n^2) 什么是快速傅里叶变换 是指对傅里叶变换中的重…

蓝桥杯嵌入式第十一届客观题解析

文章目录 前言一、题目1二、题目2三、题目3四、题目4五、题目5六、题目6七、题目7八、题目8九、题目9十、题目10总结前言 本篇文章将为大家带来蓝桥杯嵌入式省赛第11届客观题的解析。 一、题目1 积分电路的作用是对输入信号进行积分,因此在输入一个矩形波时,输出波形将是输…

租车管理系统【GUI/Swing+MySQL】(Java课设)

系统类型 Swing窗口类型Mysql数据库存储数据 使用范围 适合作为Java课设&#xff01;&#xff01;&#xff01; 部署环境 jdk1.8Mysql8.0Idea或eclipsejdbc 运行效果 本系统源码地址&#xff1a;https://download.csdn.net/download/qq_50954361/87682508 更多系统资源库…

【MySQL】索引优化与查询优化(重点:索引失效的11种情况)

【大家好&#xff0c;我是爱干饭的猿&#xff0c;本文重点介绍MySQL的内连接、外连接、索引失效的11种情况、关联查询优化、子查询优化、排序优化、GROUP BY优化、优化分页查询、覆盖索引、索引条件下推和其它查询优化策略的一些问题。 后续会继续分享MySQL和其他重要知识点总…

Springboot基础学习之(二十一):Swagger基础学习(swagger信息介绍,配置扫描接口和开关,分组和接口注释)

什么是Swagger&#xff1f; Swagger2是一个规范和完整的框架&#xff0c;用于生成、描述、调用和可视化RESTful 风格的Web 服务 使用Swagger你只需要按照它的规范去定义接口及接口相关的信息。再通过Swagger衍生出来的一系列项目和工具&#xff0c;就可以做到生成各种格式的接口…

Flutter 滚动组件ListView,GridView,Sliver以及滚动监听

前言 身是菩提树 心是明镜台 时时勤拂拭 模式染尘埃 这玩意不难&#xff0c;就是东西多。。。 1 看一下继承关系 class GridView extends BoxScrollView abstract class BoxScrollView extends ScrollView abstract class ScrollView extends StatelessWidget 2 下面是scr…

set和map

set和map关联式容器键值对树状结构关联式容器set介绍使用multiset介绍使用map介绍使用multimap介绍使用底层容器AVL树概念操作节点定义插入旋转红黑树&#xff08;RBTree&#xff09;概念节点的设计迭代器的设计结构插入红黑树模拟实现set与map模拟实现map模拟实现set关联式容器…

【Java 数据结构】单向链表和双向链表的实现 (LinkedList)

&#x1f389;&#x1f389;&#x1f389;点进来你就是我的人了 博主主页&#xff1a;&#x1f648;&#x1f648;&#x1f648;戳一戳,欢迎大佬指点!人生格言&#xff1a;当你的才华撑不起你的野心的时候,你就应该静下心来学习! 欢迎志同道合的朋友一起加油喔&#x1f9be;&am…

android studio 页面布局(2)

<?xml version"1.0" encoding"utf-8"?> <LinearLayout xmlns:android"http://schemas.android.com/apk/res/android"xmlns:app"http://schemas.android.com/apk/res-auto"xmlns:tools"http://schemas.android.com/too…

【数据挖掘与商务智能决策】第九章 随机森林模型

9.1.3 随机森林模型的代码实现 和决策树模型一样&#xff0c;随机森林模型既可以做分类分析&#xff0c;也可以做回归分析。 分别对应的模型为随机森林分类模型&#xff08;RandomForestClassifier&#xff09;及随机森林回归模型&#xff08;RandomForestRegressor&#xff…

Vue.js 2.0 组件

什么是组件&#xff1f; 组件&#xff08;Component&#xff09;是 Vue.js 最强大的功能之一。组件可以扩展 HTML 元素&#xff0c;封装可重用的代码。在较高层面上&#xff0c;组件是自定义元素&#xff0c; Vue.js 的编译器为它添加特殊功能。在有些情况下&#xff0c;组件也…

《花雕学AI》19:比较ChatGPT与新Bing在文章润色方面的应用优势与测试案例

引言&#xff1a; 文章润色是指对已经写好的文章进行修改、优化或完善的过程&#xff0c;以提高文章的质量和效果。文章润色涉及到多方面的内容&#xff0c;如语言表达、逻辑结构、文献引用、格式规范等。文章润色对于提升写作水平、提高论文发表率、增加学术影响力等都有重要意…

JavaScript【趣味】做一个网页版2048

文章目录&#x1f31f;前言&#x1f31f;先看效果&#xff08;粉丝特权哈哈&#xff09;&#x1f31f;代码实现&#x1f31f;页面布局 【index.html】&#x1f31f;样式文件【2048.css】&#x1f31f;index.html 里用到的JS文件&#x1f31f;jquery.min.js&#x1f31f;util.js…

300元左右的蓝牙耳机哪个好?300左右音质最好的蓝牙耳机

无线耳机是人们日常生活中必不可少的设备&#xff0c;无论是听音乐化石看电影都能获得身临其境的感觉&#xff0c;由于科技真在发展中&#xff0c;不断地的发生变化&#xff0c;百元价位就可以感受到不错的音色&#xff0c;下面小编整理了几款300左右音质表现不错的蓝牙耳机。 …

Linux 、Android将在汽车舞台上开战

导读在 CES 2017 上&#xff0c;AGL 宣布&#xff0c;Mercedes-Benz 的母公司 Daimler 正式加入。这是第十家汽车制造商加入 AGL&#xff0c;也是第一家德国公司加入 AGL。AGL&#xff08;Automotive Grade Linux&#xff09;&#xff0c;是 Linux 基金会的一个相互协作的开源组…

mallox勒索病毒数据恢复|金蝶、用友、管家婆、OA、速达、ERP等软件数据库恢复

目录 前言&#xff1a; 一、mallox勒索病毒及xollam勒索病毒的特点 二、mallox勒索病毒及xollam勒索病毒的影响 三、mallox勒索病毒及xollam勒索病毒数据恢复服务 四、mallox勒索病毒及xollam勒索病毒加密数据库恢复案例 五、以下是预防mallox勒索病毒及xollam勒索病毒安全…

解读CANDT测试项-采样点测试

原标题&#xff1a;解读CANDT测试项-采样点测试 一、为什么要进行采样点测试&#xff1f; 本文引用地址&#xff1a;http://www.eepw.com.cn/article/202004/411611.htm 为了保证有效的通信&#xff0c;对于一个只有两个节点的CAN网络&#xff0c;其两边距离不超过最大的传输…