doc-exports/docs/dws/tool/dws_gsql_008.html
Lu, Huayi 346ac31da9 DWS TG 8.1.3.200 VERSION
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Reviewed-by: Jiang, Beibei <beibei.jiang@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2023-08-28 09:20:17 +00:00

154 lines
36 KiB
HTML

<a name="EN-US_TOPIC_0000001188681032"></a><a name="EN-US_TOPIC_0000001188681032"></a>
<h1 class="topictitle1">Troubleshooting</h1>
<div id="body0000001153570635"><div class="section" id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_sd791904529c741048ace424e4b84bf83"><h4 class="sectiontitle">Low Connection Performance</h4><ul id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_ue866924967b64735933141c1400113a1"><li id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_l220c67d466384106a03baa0569499f0e">The database kernel slowly runs the initialization statement.<p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_ac59bc64c460742dd8dd6e3330d6097a7"><a name="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_l220c67d466384106a03baa0569499f0e"></a><a name="en-us_topic_0000001188202592_en-us_topic_0000001145650331_l220c67d466384106a03baa0569499f0e"></a>Problems are difficult to locate in this scenario. Try using the <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b195957881419713">strace</strong> Linux trace command.</p>
<pre class="screen" id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_se96616d3738145e39f4911160868a1e5">strace gsql -U MyUserName -W <em id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_i167111444172612">{password}</em> -d postgres -h 127.0.0.1 -p 23508 -r -c '\q'</pre>
<p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_a560d09623afe4ad5ae6ba47ee6fd4e66">The database connection process will be printed on the screen. If the following statement takes a long time to run:</p>
<pre class="screen" id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_s2d7f83a4988442f4a1b809393daa284d">sendto(3, "Q\0\0\0\25SELECT VERSION()\0", 22, MSG_NOSIGNAL, NULL, 0) = 22
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])</pre>
<p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_a7c04e1b7342b4e6aa8636b7aab64e05c">It indicates that <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b842352706151337">SELECT VERSION()</strong> statement was run slowly.</p>
<p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_adbd6521b938249449d64f41181d61ab8">After the database is connected, you can run the <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b84235270615303">explain performance select version()</strong> statement to find the reason why the initialization statement was run slowly. For details, see "Introduction to the SQL Execution Plan" in the <em id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_i784433143316">Developer Guide</em>.</p>
<p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_p910555694717">An uncommon scenario is that the disk of the machine where the CN resides is full or faulty, affecting queries and leading to user authentication failures. As a result, the connection process is suspended. To solve this problem, simply clear the data disk space of the CN.</p>
</li><li id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_l22fc9ac890994b608970ae438f2a73f3">TCP connection is set up slowly.<p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_a42a78e08e253422abafa761926370536"><a name="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_l22fc9ac890994b608970ae438f2a73f3"></a><a name="en-us_topic_0000001188202592_en-us_topic_0000001145650331_l22fc9ac890994b608970ae438f2a73f3"></a>Adapt the steps of troubleshooting slow initialization statement execution. Use <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b842352706151615">strace</strong>. If the following statement was run slowly:</p>
<pre class="screen" id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_s73a56596307b4748a29dbb9ec0c6b551">connect(3, {sa_family=AF_FILE, path="/home/test/tmp/gaussdb_llt1/.s.PGSQL.61052"}, 110) = 0</pre>
<p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_ab2246850a0884edc94363a9520f28faf">Or</p>
<pre class="screen" id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_s6c0399a804ce40b4a122c6a66284e85d">connect(3, {sa_family=AF_INET, sin_port=htons(61052), sin_addr=inet_addr("127.0.0.1")}, 16) = -1 EINPROGRESS (Operation now in progress)</pre>
<p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_a17e593f938504d61b6d5c6c52b560b6e">It indicates that the physical connection between the client and the database was set up slowly. In this case, check whether the network is unstable or has high throughput.</p>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_sc3f76214018e41e381cc63a77a019001"><h4 class="sectiontitle">Problems in Setting Up Connections</h4><ul id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_ueb59ae732d984b67ac5873f667177b5f"><li id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_l4d9f767ab9db4a6797b6a569a4a01ddf">gsql: could not connect to server: No route to host<p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_ad5e6e7fbfdcb40f1ba00d291a30d58a7"><a name="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_l4d9f767ab9db4a6797b6a569a4a01ddf"></a><a name="en-us_topic_0000001188202592_en-us_topic_0000001145650331_l4d9f767ab9db4a6797b6a569a4a01ddf"></a>This problem occurs generally because an unreachable IP address or port number was specified. Check whether the values of <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b168541506152018">-h</strong> and <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b842352706152023">-p</strong> parameters are correct.</p>
</li><li id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_l3f81b0b7c63341118eb76c01d6fd32f8">gsql: FATAL: Invalid username/password,login denied.<p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_a9ad3e9695cea432eaa58bb5b5bc5f750"><a name="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_l3f81b0b7c63341118eb76c01d6fd32f8"></a><a name="en-us_topic_0000001188202592_en-us_topic_0000001145650331_l3f81b0b7c63341118eb76c01d6fd32f8"></a>This problem occurs generally because an incorrect user name or password was entered. Contact the database administrator to check whether the user name and password are correct.</p>
</li><li id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_li141598212111">The "libpq.so" loaded mismatch the version of gsql, please check it.<p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_p6160172116119"><a name="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_li141598212111"></a><a name="en-us_topic_0000001188202592_en-us_topic_0000001145650331_li141598212111"></a>This problem occurs because the version of <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b5165157492">libpq.so</strong> used in the environment does not match that of <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b216611571093">gsql</strong>. Run the <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b216745714919">ldd gsql</strong> command to check the version of the loaded <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b14168175715915">libpq.so</strong>, and then load correct <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b6168205719913">libpq.so</strong> by modifying the environment variable <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b181691572913">LD_LIBRARY_PATH</strong>.</p>
</li><li id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_li51014201954">gsql: symbol lookup error: xxx/gsql: undefined symbol: libpqVersionString<p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_p1910152019513"><a name="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_li51014201954"></a><a name="en-us_topic_0000001188202592_en-us_topic_0000001145650331_li51014201954"></a>This problem occurs because the version of <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b2028451991010">libpq.so</strong> used in the environment does not match that of <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b172841619111019">gsql</strong> (or the PostgreSQL <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b102851919181011">libpq.so</strong> exists in the environment). Run the <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b1285121911015">ldd gsql</strong> command to check the version of the loaded <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b4286191918104">libpq.so</strong>, and then load correct <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b12286101951015">libpq.so</strong> by modifying the environment variable <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b10287181951013">LD_LIBRARY_PATH</strong>.</p>
</li><li id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_li17256195265710">gsql: connect to server failed: Connection timed out<p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_p41317110582"><a name="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_li17256195265710"></a><a name="en-us_topic_0000001188202592_en-us_topic_0000001145650331_li17256195265710"></a>Is the server running on host "xx.xxx.xxx.xxx" and accepting TCP/IP connections on port xxxx?</p>
<p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_p7169814114913">This problem is caused by network connection faults. Check the network connection between the client and the database server. If you cannot ping from the client to the database server, the network connection is abnormal. Contact network management personnel for troubleshooting.</p>
<pre class="screen" id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_s8488b38310e54137b52ade00e4335bfd">ping -c 4 10.10.10.1
PING 10.10.10.1 (10.10.10.1) 56(84) bytes of data.
From 10.10.10.1: icmp_seq=2 Destination Host Unreachable
From 10.10.10.1 icmp_seq=2 Destination Host Unreachable
From 10.10.10.1 icmp_seq=3 Destination Host Unreachable
From 10.10.10.1 icmp_seq=4 Destination Host Unreachable
--- 10.10.10.1 ping statistics ---
4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 2999ms</pre>
</li><li id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_li205489341866">gsql: FATAL: permission denied for database "postgres"<p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_p954917346614"><a name="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_li205489341866"></a><a name="en-us_topic_0000001188202592_en-us_topic_0000001145650331_li205489341866"></a>DETAIL: User does not have CONNECT privilege.</p>
<p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_p115491234263">This problem occurs because the user does not have the permission to access the database. To solve this problem, perform the following steps:</p>
<ol id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_ol9118140111810"><li id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_li121181407186">Connect to the database as the system administrator <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b842352706172355">dbadmin</strong>.<pre class="screen" id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_screen711810409187"><strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b1411854016184">gsql -d </strong><em id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_i1846017116515">postgres</em> <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b9118104021816">-U</strong> <em id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_i141181140141812">dbadmin</em> -p<em id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_i31181740161814"> </em><em id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_i1511810409182">8000</em></pre>
</li><li id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_li6781358121812">Grant the users with the access permission to the database.<div class="p" id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_p12836171051815"><a name="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_li6781358121812"></a><a name="en-us_topic_0000001188202592_en-us_topic_0000001145650331_li6781358121812"></a>GRANT CONNECT ON DATABASE postgres TO user1;<div class="note" id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_note1183621014189"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_p083461041816">Common misoperations may also cause a database connection failure, for example, entering an incorrect database name, user name, or password. In this case, the client tool will display the corresponding error messages.</p>
<pre class="screen" id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_screen128366108188"><strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b8834151081810">gsql -d</strong> <em id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_i0739101411519">postgres</em> <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b1383431016184">-p</strong> <em id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_i1383416107181">8000</em>
gsql: FATAL: database "postgres" does not exist
<strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b6834310171814">gsql -d</strong> <em id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_i14834161011189">postgres </em><strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b283461071819">-U</strong> <em id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_i78341108186">user1</em> <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b14834111012187">-W</strong> <em id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_i15835171017184">gauss@789</em><strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b683531061811"> -p</strong> <em id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_i08351110181817">8000</em>
gsql: FATAL: Invalid username/password,login denied.</pre>
</div></div>
</div>
</li></ol>
</li><li id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_li229194983518">gsql: FATAL: sorry, too many clients already, active/non-active: 197/3.<p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_p628661403612"><a name="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_li229194983518"></a><a name="en-us_topic_0000001188202592_en-us_topic_0000001145650331_li229194983518"></a>This problem occurs because the number of system connections exceeds the allowed maximum. Contact the database administrator to release unnecessary sessions.</p>
<p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_adf2af66006d540c387ad93ef3c6380de">You can check the number of connections as described in <a href="#EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_tee9a019644dc4b32aad8d0aa00a7e061">Table 1</a>.</p>
<p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_p17362491288">You can view the session status in the <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b842352706172739">PG_STAT_ACTIVITY</strong> view. To release unnecessary sessions, use the pg_terminate_backend function.</p>
<pre class="screen" id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_s202d3ce3c6df4ae79df4d4cf993f42ac"><strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_acc3a3e5df6944bfbb9a18501e8dadca7">select datid,pid,state from pg_stat_activity;</strong></pre>
<pre class="screen" id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_sb96a2f5d7a144dd4b65c2f8185799bb8"> datid | pid | state
-------+-----------------+--------
13205 | 139834762094352 | active
13205 | 139834759993104 | idle
(2 rows)</pre>
<p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_adcb9e985e4974650a1f4bbb5f0d2e4ae">The value of pid is the thread ID of the session. Terminate the session using its thread ID.</p>
<pre class="screen" id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_sbbdddf54531247a492f2260ef6e75347"><strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_ac2242d3c07ae4ab98204553f6cb1a3e2">SELECT PG_TERMINATE_BACKEND(139834759993104);</strong></pre>
<p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_a41a69650607d4957af5e36b5491f3e3a">If information similar to the following is displayed, the session is successfully terminated:</p>
<pre class="screen" id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_s0e9674ccb01846a1aee2652b9c2cae1f">PG_TERMINATE_BACKEND
----------------------
t
(1 row)</pre>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_tee9a019644dc4b32aad8d0aa00a7e061"></a><a name="en-us_topic_0000001188202592_en-us_topic_0000001145650331_tee9a019644dc4b32aad8d0aa00a7e061"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_tee9a019644dc4b32aad8d0aa00a7e061" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Viewing the numbers of connections</caption><thead align="left"><tr id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_r3acdade378554f0ba742455d9e1cbcc1"><th align="left" class="cellrowborder" valign="top" width="31.41%" id="mcps1.3.2.2.7.10.2.3.1.1"><p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_a2275c90caa88407e8b6dbaa777259b7e">Description</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="68.58999999999999%" id="mcps1.3.2.2.7.10.2.3.1.2"><p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_a37c282a90ed44d5998d4ec993a10c96b">Command</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_r9e51afb960a84b63bfce55f002087f32"><td class="cellrowborder" valign="top" width="31.41%" headers="mcps1.3.2.2.7.10.2.3.1.1 "><p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_aea0fc4f10c464bdb8400d14997d8bfc6">View the upper limit of a user's connections.</p>
</td>
<td class="cellrowborder" valign="top" width="68.58999999999999%" headers="mcps1.3.2.2.7.10.2.3.1.2 "><p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_a94118c2b76294d98b2a918b825b143f0">Run the following command to view the upper limit of user <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b842352706173132">USER1</strong>'s connections. <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b842352706171140">-1</strong> indicates that no connection upper limit is set for user <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b84235270617454">USER1</strong>.</p>
<pre class="screen" id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_s962ba26500684eaab716f88e3202df14">SELECT ROLNAME,ROLCONNLIMIT FROM PG_ROLES WHERE ROLNAME='user1';
rolname | rolconnlimit
---------+--------------
user1 | -1
(1 row)</pre>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_r4d9852e9aa4b40999e004df5c9ad0c41"><td class="cellrowborder" valign="top" width="31.41%" headers="mcps1.3.2.2.7.10.2.3.1.1 "><p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_a312ee51a2a564e9488dec7cd2f4d3e0f">View the number of connections that have been used by a user.</p>
</td>
<td class="cellrowborder" valign="top" width="68.58999999999999%" headers="mcps1.3.2.2.7.10.2.3.1.2 "><p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_a8a24fe27072a4cfeb44286970a982ac9">Run the following command to view the number of connections that have been used by user <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b842352706171210">user1</strong>. <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_b1064549793112828">1</strong> indicates the number of connections that have been used by user <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b842352706171231">user1</strong>.</p>
<pre class="screen" id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_s948d59ad78dc4783b60580cd0705213b">SELECT COUNT(*) FROM V$SESSION WHERE USERNAME='user1';
count
-------
1
(1 row)</pre>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_rab1ef86be9db4a9892941fa20bb00f7a"><td class="cellrowborder" valign="top" width="31.41%" headers="mcps1.3.2.2.7.10.2.3.1.1 "><p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_ac6b3a8a174a4455a8f2f518459561c74">View the upper limit of connections to database.</p>
</td>
<td class="cellrowborder" valign="top" width="68.58999999999999%" headers="mcps1.3.2.2.7.10.2.3.1.2 "><p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_a6bca000931134542925be7ab3d8f244f">Run the following command to view the upper limit of connections used by <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_en-us_topic_0058967576_b1271355072172025">postgres</strong>. <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_b1173507437112828">-1</strong> indicates that no upper limit is set for the number of connections that have been used by <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b109697293172054">postgres</strong>.</p>
<pre class="screen" id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_s88e10c0ca22f4510920350f499bbbe6c">SELECT DATNAME,DATCONNLIMIT FROM PG_DATABASE WHERE DATNAME='postgres';
datname | datconnlimit
----------+--------------
postgres | -1
(1 row)</pre>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_r0785f850f5fc4f87956bde95dd63697b"><td class="cellrowborder" valign="top" width="31.41%" headers="mcps1.3.2.2.7.10.2.3.1.1 "><p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_aa34c8f9d63b64da1b4b5931e58fe6037">View the number of connections that have been used by a database.</p>
</td>
<td class="cellrowborder" valign="top" width="68.58999999999999%" headers="mcps1.3.2.2.7.10.2.3.1.2 "><p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_a54c59e309845425d969c0d438bda6cb8">Run the following command to view the number of connections that have been used by <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_en-us_topic_0058967576_b842352706171923">postgres</strong>. <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_en-us_topic_0058967576_b842352706171912">1</strong> indicates the number of connections that have been used by <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_en-us_topic_0058967576_b842352706171940">postgres</strong>.</p>
<pre class="screen" id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_s39efa786f82347cf81291b0c7283c18a">SELECT COUNT(*) FROM PG_STAT_ACTIVITY WHERE DATNAME='postgres';
count
-------
1
(1 row)</pre>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_r3763ab1133ce4557bf772cc35435e4b0"><td class="cellrowborder" valign="top" width="31.41%" headers="mcps1.3.2.2.7.10.2.3.1.1 "><p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_aacdfd9ebf77940829e71d92364f35802">View the total number of connections that have been used by users.</p>
</td>
<td class="cellrowborder" valign="top" width="68.58999999999999%" headers="mcps1.3.2.2.7.10.2.3.1.2 "><p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_ac193f69c11184c168debf37871031c84">Run the following command to view the number of connections that have been used by users:</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_screen13964171113368"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="k">COUNT</span><span class="p">(</span><span class="o">*</span><span class="p">)</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">PG_STAT_ACTIVITY</span><span class="p">;</span>
<span class="w"> </span><span class="k">count</span>
<span class="c1">-------</span>
<span class="w"> </span><span class="mi">10</span>
<span class="p">(</span><span class="mi">1</span><span class="w"> </span><span class="k">row</span><span class="p">)</span>
</pre></div></td></tr></table></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_li10975422163217">gsql: wait xxx.xxx.xxx.xxx:xxxx timeout expired<p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_p3951438183217"><a name="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_li10975422163217"></a><a name="en-us_topic_0000001188202592_en-us_topic_0000001145650331_li10975422163217"></a>When <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b1406642194216">gsql</strong> initiates a connection request to the database, a 5-minute timeout period is used. If the database cannot correctly authenticate the client request and client identity within this period, <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b05039613444">gsql</strong> will exit the connection process for the current session, and will report the above error.</p>
<p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_p14956511183418">Generally, this problem is caused by the incorrect host and port (that is, the <em id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_i135019354539">xxx</em> part in the error information) specified by the <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b392335235212">-h</strong> and <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b61855115216">-p</strong> parameters. As a result, the communication fails. Occasionally, this problem is caused by network faults. To resolve this problem, check whether the host name and port number of the database are correct.</p>
</li><li id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_li196501010109">gsql: could not receive data from server: Connection reset by peer.<p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_p865212103011"><a name="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_li196501010109"></a><a name="en-us_topic_0000001188202592_en-us_topic_0000001145650331_li196501010109"></a>Check whether CN logs contain information similar to "FATAL: cipher file "/data/coordinator/server.key.cipher" has group or world access". This error is usually caused by incorrect tampering with the permissions for data directories or some key files. For details about how to correct the permissions, see related permissions for files on other normal instances.</p>
</li><li id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_li204791151105719">gsql: FATAL: GSS authentication method is not allowed because XXXX user password is not disabled.<p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_p247995115574"><a name="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_li204791151105719"></a><a name="en-us_topic_0000001188202592_en-us_topic_0000001145650331_li204791151105719"></a>In <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b1674422836">pg_hba.conf</strong> of the target CN, the authentication mode is set to <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b67461421335">gss</strong> for authenticating the IP address of the current client. However, this authentication algorithm cannot authenticate clients. Change the authentication algorithm to <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_b15747321634">sha256</strong> and try again. For details, see "Configuration File Reference" in the <em id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_i196612031947">Developer Guide</em>.</p>
<div class="note" id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_note1583074910198"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_ul1182174592611"><li id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_li2821144512610">Do not modify the configurations of database cluster hosts in the <strong id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_b2073440875">pg_hba. conf</strong> file. Otherwise, the database may become faulty.</li><li id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_li10821174592620">You are advised to deploy service applications outside the database cluster.</li></ul>
</div></div>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_section1457563481712"><h4 class="sectiontitle">Other Faults</h4><ul id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_ul113071756181718"><li id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_li1641218571176">There is a core dump or abnormal exit due to the bus error.<p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_p12418125771716"><a name="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_li1641218571176"></a><a name="en-us_topic_0000001188202592_en-us_topic_0000001145650331_li1641218571176"></a>Generally, this problem is caused by changes in loading the shared dynamic library (.so file in Linux) during process running. Alternatively, if the process binary file changes, the execution code for the OS to load machines or the entry for loading a dependent library will change accordingly. In this case, the OS kills the process for protection purposes, generating a core dump file.</p>
<p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_p121021212182116">To resolve this problem, try again. In addition, do not run service programs in a cluster during O&amp;M operations, such as an upgrade, preventing such a problem caused by file replacement during the upgrade.</p>
<div class="note" id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_note3175124752315"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001188681032__en-us_topic_0000001188202592_en-us_topic_0000001145650331_p18175164742315">A possible stack of the core dump file contains dl_main and its function calling. The file is used by the OS to initialize a process and load the shared dynamic library. If the process has been initialized but the shared dynamic library has not been loaded, the process cannot be considered completely started.</p>
</div></div>
</li></ul>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_gsql_index.html">gsql</a></div>
</div>
</div>