diff --git a/content/en/docs/Toolreference/faqs.md b/content/en/docs/Toolreference/faqs.md index 21e88f5782252dc51481bb2162ddbd29bec63b34..a0d15407fbb3efe08b455d10e82064e31f938574 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.
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)-
执行如下命令查看指定用户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)-