From d8d33eb269fbf2bbeca9a4fd76b59932dbc25472 Mon Sep 17 00:00:00 2001 From: li-jun056 Date: Thu, 6 Aug 2020 09:58:57 +0800 Subject: [PATCH] update documents --- content/en/docs/Toolreference/faqs.md | 41 ++++------------- ...56\351\242\230\345\244\204\347\220\206.md" | 45 +++++-------------- 2 files changed, 20 insertions(+), 66 deletions(-) diff --git a/content/en/docs/Toolreference/faqs.md b/content/en/docs/Toolreference/faqs.md index 21e88f578..a0d15407f 100644 --- a/content/en/docs/Toolreference/faqs.md +++ b/content/en/docs/Toolreference/faqs.md @@ -168,7 +168,7 @@

View the maximum number of sessions connected to a specific user.

-

Run the following command to view the upper limit of the number of USER1's session connections. -1 indicates that no upper limit is set for the number of USER1's session connections.

+

Run the following command to view the number of session connections that have been used by USER1's session connections. -1 indicates that no upper limit is set for the number of USER1's session connections.

SELECT ROLNAME,ROLCONNLIMIT FROM PG_ROLES WHERE ROLNAME='user1';
      rolname | rolconnlimit
     ---------+--------------
@@ -176,26 +176,15 @@
     (1 row)
-

View the number of session connections that have been used by a user.

+

View the maximum number of sessions connected to a specific database.

-

Run the following command to view the number of session connections that have been used by USER1. 1 indicates the number of session connections that have been used by USER1.

-
SELECT COUNT(*) FROM V$SESSION WHERE USERNAME='user1';
-    
-    ######  count
-         1
+    

Run the following command to view the number of session connections that have been used by postgres. -1 indicates that no upper limit is set for the number of postgres's session connections.

+
SELECT DATNAME,DATCONNLIMIT FROM PG_ROLES WHERE ROLNAME='postgres';
+     datname | datconnlimit
+    ---------+--------------
+     postgres    |       -1
     (1 row)
- - -

View the maximum number of sessions connected to a specific database.

- -

Run the following command to view the upper limit of the number of postgres's session connections. -1 indicates that no upper limit is set for the number of postgres's session connections.

-
SELECT DATNAME,DATCONNLIMIT FROM PG_DATABASE WHERE DATNAME='postgres';
-    
-     datname  | datconnlimit
-    ----------+--------------
-     postgres |           -1
-    (1 row)
- +

View the number of session connections that have been used by a specific database.

@@ -205,20 +194,8 @@ ------- 1 (1 row)
- - -

View the number of session connections that have been used by all users.

- -

Run the following command to view the number of session connections that have been used by all users:

-
SELECT COUNT(*) FROM V$SESSION;
     
-    ######  count
-         10
-    (1 row)
- - - - + ​ - gsql: wait xxx.xxx.xxx.xxx:xxxx timeout expired diff --git "a/content/zh/docs/Toolreference/\345\270\270\350\247\201\351\227\256\351\242\230\345\244\204\347\220\206.md" "b/content/zh/docs/Toolreference/\345\270\270\350\247\201\351\227\256\351\242\230\345\244\204\347\220\206.md" index bbc378e72..b17c09565 100644 --- "a/content/zh/docs/Toolreference/\345\270\270\350\247\201\351\227\256\351\242\230\345\244\204\347\220\206.md" +++ "b/content/zh/docs/Toolreference/\345\270\270\350\247\201\351\227\256\351\242\230\345\244\204\347\220\206.md" @@ -168,49 +168,26 @@ (1 row) -

查看指定用户已使用的会话连接数。

+

查看指定数据库的会话连接数上限。

-

执行如下命令查看指定用户USER1已使用的会话连接数。其中,1表示USER1已使用的会话连接数。

-
SELECT COUNT(*) FROM V$SESSION WHERE USERNAME='user1';
-    
-    ######  count
-         1
-    (1 row)
- - -

查看指定数据库的会话连接数上限。

- -

执行如下命令查看连接到指定数据库postgres的会话连接数上限。其中-1表示没有对数据库postgres设置连接数的限制。

-
SELECT DATNAME,DATCONNLIMIT FROM PG_DATABASE WHERE DATNAME='postgres';
-    
-     datname  | datconnlimit
-    ----------+--------------
-     postgres |           -1
+    

执行如下命令查看连接到指定数据库postgres的会话连接数上限。其中,-1表示没有对数据库postgres设置连接数的限制。

+
SELECT DATNAME,DATCONNLIMIT FROM PG_DATABASE WHERE DATNAME='postgres';
+     datname | datconnlimit
+    ---------+--------------
+     postgres    |           -1
     (1 row)
-

查看指定数据库已使用的会话连接数。

+

查看指定数据库已使用的会话连接数。

-

执行如下命令查看指定数据库postgres上已使用的会话连接数。其中,1表示数据库postgres上已使用的会话连接数。

-
SELECT COUNT(*) FROM PG_STAT_ACTIVITY WHERE DATNAME='postgres';
-     count 
+    

执行如下命令查看指定数据库postgres已使用的会话连接数。其中,1表示数据库postgres已使用的绘画连接数。

+
SELECT COUNT(*) FROM PG_STAT_ACTIVITY WHERE DATNAME='postgres';
+     count
     -------
          1
     (1 row)
- - -

查看所有用户已使用会话连接数。

- -

执行如下命令查看所有用户已使用的会话连接数。

-
SELECT COUNT(*) FROM V$SESSION;
     
-    ######  count
-         10
-    (1 row)
- - - - + - gsql: wait xxx.xxx.xxx.xxx:xxxx timeout expired -- Gitee