
# 查看参数当前取值
GaussDB安装后，有一套默认的运行参数，为了使GaussDB与业务的配合度更高，用户需要根据业务场景和数据量的大小进行GUC参数调整。
#### 操作步骤
1. 使用如下命令连接数据库，具体操作请参考[通过gsql连接实例](https://support.huaweicloud.com/usermanual-gaussdb/gaussdb_01_503.html)章节。
   
   ```
   gsql -d postgres -p 8000
   ```
   postgres为需要连接的数据库名称，8000为数据库主节点的端口号。
   连接成功后，系统显示类似如下信息：
   ```
   gsql((GaussDB Kernel VxxxRxxxCxx build f521c606) compiled at 2021-09-16 14:55:22 commit 2935 last mr 6385 release)
   Non-SSL connection (SSL connection is recommended when requiring high-security)
   Type "help" for help.
   openGauss=#
   ```
   
   
2. 查看数据库运行参数当前取值。 
   - 方法一：使用SHOW命令。
     - 使用如下命令查看单个参数：
       ```
       openGauss=# SHOW server_version;
       ```
       server_version显示数据库版本信息的参数。
       
     
     - 使用如下命令查看所有参数：
       ```
       openGauss=#  SHOW ALL;
       ```
       
      
   
   
   
   - 方法二：使用pg_settings视图。
     - 使用如下命令查看单个参数：
       ```
       openGauss=# SELECT * FROM pg_settings WHERE NAME='server_version';
       ```
       
     
     - 使用如下命令查看所有参数：
       ```
       openGauss=# SELECT * FROM pg_settings;
       ```
       
      
   
   
   
   
 
#### 示例
查看客户端的字符编码类型。
```
openGauss=# SHOW client_encoding;
 client_encoding
----------------
 UTF8
(1 row)
```
