

# Amazon RDS for Db2 故障排除
<a name="db2-troubleshooting"></a>

以下内容可以帮助您解决在 RDS for Db2 中遇到的问题。

要详细了解如何排查一般 Amazon RDS 问题，请参阅[Amazon RDS 故障排除](CHAP_Troubleshooting.md)。

**Topics**
+ [数据库连接错误](#db2-database-connection-error)
+ [文件 I/O 错误](#db2-file-input-output-error)
+ [存储过程错误](#db2-troubleshooting-stored-procedures)

## 数据库连接错误
<a name="db2-database-connection-error"></a>

以下错误消息表示数据库连接失败，因为服务器没有足够的内存。

```
SQL1643C The database manager failed to allocate shared memory because the
database manager instance memory limit has been reached.
```

增加数据库实例的内存，然后尝试再次连接到数据库。有关内存使用情况和数据库建议的信息，请参阅[Amazon RDS for Db2 数据库实例上的多个数据库](db2-multiple-databases.md)。有关如何更新 RDS for Db2 数据库内存的信息，请参阅 [rdsadmin.update\$1db\$1param](db2-sp-managing-databases.md#db2-sp-update-db-param)。

## 文件 I/O 错误
<a name="db2-file-input-output-error"></a>

由于不同的原因（例如在使用 `LOAD` 命令或通过调用 `rdsadmin.restore_database` 存储过程时），您可能会遇到文件 I/O 错误。

在本例中，您运行以下 `LOAD` 命令：

```
db2 "call sysproc.admin_cmd('load from "DB2REMOTE://s3test//public/datapump/t6.del" of del lobs from "DB2REMOTE://s3test/public/datapump/" modified by lobsinfile MESSAGES ON SERVER insert INTO RDSDB.t6 nonrecoverable ')"
```

`LOAD` 命令将返回以下消息：

```
  Result set 1
  --------------

  ROWS_READ            ROWS_SKIPPED         ROWS_LOADED          ROWS_REJECTED        ROWS_DELETED         ROWS_COMMITTED       ROWS_PARTITIONED     NUM_AGENTINFO_ENTRIES MSG_RETRIEVAL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    MSG_REMOVAL
  -------------------- -------------------- -------------------- -------------------- -------------------- -------------------- -------------------- --------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                     -                    -                    -                    -                    -                    -                    -                     - SELECT SQLCODE, MSG FROM TABLE(SYSPROC.ADMIN_GET_MSGS('1594987316_285548770')) AS MSG                                                                                                                                                                                                                                                                                                                                                                                                                                            CALL SYSPROC.ADMIN_REMOVE_MSGS('1594987316_285548770')

  1 record(s) selected.

  Return Status = 0

SQL20397W  Routine "SYSPROC.ADMIN_CMD" execution has completed, but at least
one error, "SQL1652", was encountered during the execution. More information
is available.  SQLSTATE=01H52
```

要查看错误消息，请按照上一个响应中建议的方式运行 SQL 命令。`SELECT SQLCODE, MSG FROM TABLE(SYSPROC.ADMIN_GET_MSGS('1594987316_285548770')) AS MSG` 返回以下消息：

```
SQLCODE   MSG
--------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL2025N  An I/O error occurred. Error code “438”. Media on which this error occurred: “DB2REMOTE://s3test//public/datapump/t6.del”

SQL3500W The utility is beginning the LOAD phase at time “07/05/2024 21:21:48.082954”

SQL1652N File I/O error occurred
```

Db2 诊断日志包含与以下内容类似的日志文件：

```
2024-07-05-21.20.09.440609+000 I1191321E864          LEVEL: Error
PID     : 2710                 TID : 139619509200640 PROC : db2sysc 0
INSTANCE: rdsdb                NODE : 000            DB   : NTP
APPHDL  : 0-12180              APPID: xxx.xx.x.xxx.xxxxx.xxxxxxxxxxxx
UOWID   : 5                    ACTID: 1
AUTHID  : ADMIN                HOSTNAME: ip-xx-xx-x-xx
EDUID   : 147                  EDUNAME: db2lmr 0
FUNCTION: DB2 UDB, oper system services, sqloS3Client_GetObjectInfo, probe:219
MESSAGE : ZRC=0x870F01B6=-2029059658=SQLO_FAILED
          "An unexpected error is encountered"
DATA #1 : String, 29 bytes
S3:HeadObject request failed.
DATA #2 : signed integer, 4 bytes
99
DATA #3 : String, 0 bytes
Object not dumped: Address: 0x00007EFC08A9AE38 Size: 0 Reason: Zero-length data
DATA #4 : String, 33 bytes
curlCode: 28, Timeout was reached
```

此文件 I/O 错误可能是由多种不同的情况造成的。例如，与用于创建 RDS For Db2 数据库实例的安全组关联的 VPC 可能缺少 Amazon S3 网关端点。要让 RDS for Db2 访问 Amazon S3，此端点至关重要。如果您的 RDS for Db2 数据库实例位于私有子网中，则需要 Amazon S3 网关端点。可以通过配置 Amazon RDS 子网组，来指定您的数据库实例是使用私有子网还是公有子网。有关更多信息，请参阅 [使用数据库子网组](USER_VPC.WorkingWithRDSInstanceinaVPC.md#USER_VPC.Subnets)。

**Topics**
+ [步骤 1：为 Amazon S3 创建 VPC 网关端点](#db2-creating-endpoint)
+ [步骤 2：确认适用于 Amazon S3 的 VPC 网关端点存在](#db2-confirming-endpoint)

### 步骤 1：为 Amazon S3 创建 VPC 网关端点
<a name="db2-creating-endpoint"></a>

要让 RDS for Db2 数据库实例与 Amazon S3 交互，需创建一个 VPC，然后创建一个 Amazon S3 网关端点，供私有子网使用。

**为 S3 创建 VPC 网关端点**

1. 创建 VPC。有关更多信息，请参阅《Amazon Virtual Private Cloud 用户指南》**中的[创建 VPC](https://docs.aws.amazon.com/vpc/latest/userguide/create-vpc.html)。

1. 创建供私有子网使用的 Amazon S3 网关端点。有关更多信息，请参阅《AWS PrivateLink 指南》中的 [Gateway endpoint](https://docs.aws.amazon.com/vpc/latest/privatelink/gateway-endpoints.html)**。

### 步骤 2：确认适用于 Amazon S3 的 VPC 网关端点存在
<a name="db2-confirming-endpoint"></a>

确认您已通过 AWS 管理控制台或 AWS CLI 成功创建 Amazon S3 网关端点。

#### 控制台
<a name="db2-confirming-endpoing-console"></a>

**确认 Amazon S3 网关端点**

1. 登录 AWS 管理控制台并打开 Amazon VPC 控制台（网址为 [https://console.aws.amazon.com/vpc](https://console.aws.amazon.com/vpc)）。

1.  在控制台的右上角，选择您的 VPC 所在的 AWS 区域。

1. 选择您所创建的 VPC。

1. 在**资源映射**选项卡的**网络连接**下，确认已列出一个 Amazon S3 网关端点。

#### AWS CLI
<a name="db2-confirming-endpoint-cli"></a>

要确认 Amazon S3 网关端点，请运行 [https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-vpc-endpoints.html](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-vpc-endpoints.html) 命令。在以下示例中，将 *vpc\$1id* 替换为 VPC ID，将 *region* 替换为您所在的 AWS 区域，将 *profile* 替换为您的配置文件名称。

对于 Linux、macOS 或 Unix：

```
aws ec2 describe-vpc-endpoints \
    --filters "Name=vpc-id,Values=$vpc_id" \
    "Name=service-name,\
    Values=com.amazonaws.${region}.s3" \
    --region $region --profile=$profile \
    --query "VpcEndpoints[*].VpcEndpointId" --output text
```

对于：Windows

```
aws ec2 describe-vpc-endpoints ^
    --filters "Name=vpc-id,Values=$vpc_id" ^
    "Name=service-name,^
    Values=com.amazonaws.${region}.s3" ^
    --region $region --profile=$profile ^
    --query "VpcEndpoints[*].VpcEndpointId" --output text
```

如果存在 Amazon S3 网关端点，此命令将生成类似于以下示例的输出。

```
[
    "vpce-0ea810434ff0b97e4"
]
```

如果 Amazon S3 网关端点不存在，此命令将生成类似于以下示例的输出。

```
[]
```

如果您看不到列出的 Amazon S3 网关端点，请执行[步骤 1：为 Amazon S3 创建 VPC 网关端点](#db2-creating-endpoint)。

## 存储过程错误
<a name="db2-troubleshooting-stored-procedures"></a>

本节介绍在调用存储过程时返回的各种错误以及如何解决这些错误。


| 类别 | 存储过程错误 | 
| --- | --- | 
|  数据库  |  [rdsadmin.activate\$1database 错误](#db2-troubleshooting-activate-database-sp-errors)  | 
|  数据库  |  [rdsadmin.backup\$1database 错误](#db2-troubleshooting-backup-database-sp-errors)  | 
|  数据库  |  [rdsadmin.create\$1database 错误](#db2-troubleshooting-create-database-sp-errors)  | 
|  数据库  |  [rdsadmin.deactivate\$1database 错误](#db2-troubleshooting-deactivate-database-sp-errors)  | 
|  数据库  |  [rdsadmin.drop\$1database 错误](#db2-troubleshooting-drop-database-sp-errors)  | 
|  数据库  |  [rdsadmin.reactivate\$1database 错误](#db2-troubleshooting-reactivate-database-sp-errors)  | 
|  数据库  |  [rdsadmin.restore\$1database 错误](#db2-troubleshooting-restore-database-sp-errors)  | 
|  数据库  |  [rdsadmin.update\$1db\$1param 错误](#db2-troubleshooting-update-db-param-sp-errors)  | 
|  表空间  |  [rdsadmin.alter\$1tablespace 错误](#db2-troubleshooting-alter-tablespace-sp-errors)  | 

### rdsadmin.activate\$1database 错误
<a name="db2-troubleshooting-activate-database-sp-errors"></a>

调用 [rdsadmin.activate\$1database](db2-sp-managing-databases.md#db2-sp-activate-database) 存储过程时可能会出现以下错误。


| 错误 | 错误消息 | 
| --- | --- | 
|  [Failed to allocate shared memory](#activate-database-sp-failed-to-allocate-shared-memory)  |  `SQL1643C The database manager failed to allocate shared memory because the database manager instance memory limit has been reached.`  | 
|  [Unable to activate because of running processes](#activate-database-sp-unable-to-activate-processes)  |  `The database can’t be activated because it's in the process of being created or restored.`  | 

**无法分配共享内存**

以下错误消息表明存储过程未能激活数据库，因为数据库实例没有足够的内存。

```
SQL1643C The database manager failed to allocate shared memory because the database manager instance memory limit has been reached.
```

增加数据库实例的内存，然后再次调用 `rdsadmin.activate_database` 存储过程。有关内存使用情况和数据库建议的信息，请参阅[Amazon RDS for Db2 数据库实例上的多个数据库](db2-multiple-databases.md)。

**由于进程正在运行，无法激活**

以下错误消息表明存储过程无法激活数据库，因为 `rdsadmin.create_database` 或 `rdsadmin.restore_database` 存储过程正在运行。

```
The database can’t be activated because it's in the process of being created or restored.
```

等待几分钟，然后再次调用 `rdsadmin.activate_database` 存储过程。

### rdsadmin.alter\$1tablespace 错误
<a name="db2-troubleshooting-alter-tablespace-sp-errors"></a>

调用 [rdsadmin.alter\$1tablespace](db2-sp-managing-tablespaces.md#db2-sp-alter-tablespace) 存储过程时可能会出现以下错误。


| 错误 | 错误消息 | 
| --- | --- | 
|  [Statement not valid](#alter-tablespace-sp-statement-not-valid)  |  `DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: ` `SQL1763N Invalid ALTER TABLESPACE statement for table space "TBSP_TEST" due to reason "12"`  | 
|  [tablespace_prefetch_size value not valid](#alter-tablespace-sp-prefetch-value-not-valid)  |  `Invalid tablespace_prefetch_size. Set value to AUTOMATIC or to a non-zero positive numerical value.`  | 
|  [tablespace_prefetch_size numerical value not valid](#alter-tablespace-sp-prefetch-numerical-value-not-valid)  |  `Invalid tablespace_prefetch_size. The number of pages can't be greater than 32767.`  | 
|  [Parameter can't be used with tablespace_prefetch_size](#alter-tablespace-sp-prefetch-incompatible-parameter)  |  `You can't use tablespace_prefetch_size with {parameter}.`  | 
|  [Tablespace change failed](#alter-tablespace-sp-tablespace-change-failed)  |  `The change to tablespace {tablespace_name} failed because you can only alter LARGE or REGULAR tablespaces.`  | 

**语句无效**

以下错误消息表明存储过程将互斥的可选参数与其他可选参数组合使用。对于 `rdsadmin.alter_tablespace` 存储过程，可选参数 `reduce_max, reduce_stop`、`reduce_value`、`lower_high_water`、`lower_high_water_stop` 和 `switch_online` 是互斥的。不能将它们与 `rdsadmin.alter_tablespace` 存储过程中的任何其他可选参数（如 `buffer_pool_name`）组合使用。如果将它们组合使用，则当您调用 `rdsadmin.get_task_status` 用户定义的函数时，Db2 将返回此错误消息。

```
DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: 
SQL1763N Invalid ALTER TABLESPACE statement for table space "TBSP_TEST" due to reason "12"
```

再次调用 `rdsadmin.alter_tablespace` 存储过程，不要将互斥的可选参数与其他可选参数组合使用。然后调用 `rdsadmin.get_task_status` 用户定义的函数。有关更多信息，请参阅 [rdsadmin.alter\$1tablespace](db2-sp-managing-tablespaces.md#db2-sp-alter-tablespace) 和 [rdsadmin.get\$1task\$1status](db2-user-defined-functions.md#db2-udf-get-task-status)。

**tablespace\$1prefetch\$1size 值无效**

以下错误消息表明您未将 `tablespace_prefetch_size` 设置为 `AUTOMATIC` 或为非正数值。例如，您尝试将其设置为 `testinput`。

```
Invalid tablespace_prefetch_size. Set value to AUTOMATIC or to a non-zero positive numerical value.
```

再次调用 `rdsadmin.alter_tablespace` 存储过程，并将 `tablespace_prefetch_size` 设置为 `AUTOMATIC` 或非正数值。

**tablespace\$1prefetch\$1size 数值无效**

以下错误消息表明您将 `tablespace_prefetch_size` 设置为大于 32767 的数值。

```
Invalid tablespace_prefetch_size. The number of pages can't be greater than 32767.
```

再次调用 `rdsadmin.alter_tablespace` 存储过程，并将 `tablespace_prefetch_size` 设置为小于等于 32767 的非零整数值。

**参数不能与 tablespace\$1prefetch\$1size 一起使用**

以下错误消息表明您尝试将 `tablespace_prefetch_size` 与不兼容参数一起使用。

```
You can't use tablespace_prefetch_size with {parameter}.
```

再次调用 `rdsadmin.alter_tablespace` 存储过程，并且仅将 `tablespace_prefetch_size` 与兼容的参数一起使用。有关可以与 `tablespace_prefetch_size` 一起使用的其他参数的信息，请参阅 [rdsadmin.alter\$1tablespace](db2-sp-managing-tablespaces.md#db2-sp-alter-tablespace)。

**表空间更改失败**

以下错误消息表明您尝试更改表空间。

```
The change to tablespace {tablespace_name} failed because you can only alter LARGE or REGULAR tablespaces.
```

### rdsadmin.backup\$1database 错误
<a name="db2-troubleshooting-backup-database-sp-errors"></a>

调用 [rdsadmin.backup\$1database](db2-sp-managing-databases.md#db2-sp-backup-database) 存储过程时可能会出现以下错误。


| 错误 | 错误消息 | 
| --- | --- | 
|  [Insufficient disk space](#backup-database-sp-insufficient-disk-space)  |  `Aborting task. Reason Backing up your database failed because of insufficient disk space. Increase the storage for your DB instance and rerun the rdsadmin.backup_database stored procedure.`  | 
|  [Internal error](#backup-database-sp-internal-error)  |  `Caught exception during executing task id 104, Aborting task. Reason Internal Error`  | 

**磁盘空间不足**

以下错误消息表明数据库实例没有足够的磁盘空间，无法备份数据库：

```
Aborting task. Reason Backing up your database failed because of insufficient disk space. Increase the storage for your DB instance and rerun the rdsadmin.backup_database stored procedure.
```

将数据库备份到远程存储时，请确保有足够的可用磁盘空间用于备份会话和工作文件。每个备份会话最多可处理 5 GB 的数据，但需要额外的空间来存储事务日志、临时文件和正在进行的数据库操作。

根据数据库大小，我们建议您有以下可用磁盘空间用于备份：
+ 对于 5 GB 以下的数据库：数据库大小 \$1 3 GB 缓冲区
+ 对于 5 GB 及更大的数据库：至少 10 GB 的可用空间

此可用磁盘空间量用于备份会话处理、备份期间的事务日志积累、临时工作文件以及并行备份流（如果已配置）。有关更多信息，请参阅 [增加数据库实例存储容量](USER_PIOPS.ModifyingExisting.md)。

增加磁盘空间，然后再次调用 [rdsadmin.backup\$1database](db2-sp-managing-databases.md#db2-sp-backup-database) 存储过程。要确认数据库已正确备份，请使用 [rdsadmin.get\$1task\$1status](db2-user-defined-functions.md#db2-udf-get-task-status) 检查任务状态。您还可以验证备份文件是否存在于 Amazon S3 存储桶中的 *s3\$1prefix/dbi\$1resource\$1id/db\$1name* 下。

**内部错误**

以下错误消息表明存储过程遇到了内部错误：

```
Caught exception during executing task id 104, Aborting task. Reason Internal Error
```

请联系 [AWS Support](https://aws.amazon.com/premiumsupport/)。

### rdsadmin.create\$1database 错误
<a name="db2-troubleshooting-create-database-sp-errors"></a>

调用 [rdsadmin.create\$1database](db2-sp-managing-databases.md#db2-sp-create-database) 存储过程时可能出现以下错误。


| 错误 | 错误消息 | 
| --- | --- | 
|  [Failed to allocate shared memory](#create-database-sp-failed-to-allocate-shared-memory)  |  `SQL1643C The database manager failed to allocate shared memory because the database manager instance memory limit has been reached.`  | 

**无法分配共享内存**

以下错误消息表明存储过程无法创建数据库，因为数据库实例没有足够的内存。

```
SQL1643C The database manager failed to allocate shared memory because the database manager instance memory limit has been reached.
```

增加数据库实例的内存，然后再次调用 `rdsadmin.create_database` 存储过程。有关内存使用情况和数据库建议的信息，请参阅[Amazon RDS for Db2 数据库实例上的多个数据库](db2-multiple-databases.md)。

要确认数据库已创建，可调用 [rdsadmin.list\$1databases](db2-user-defined-functions.md#db2-udf-list-databases) 用户定义的函数并检查新数据库是否已列出。

### rdsadmin.deactivate\$1database 错误
<a name="db2-troubleshooting-deactivate-database-sp-errors"></a>

调用 [rdsadmin.deactivate\$1database](db2-sp-managing-databases.md#db2-sp-deactivate-database) 存储过程时可能出现以下错误。


| 错误 | 错误消息 | 
| --- | --- | 
|  [Unable to deactivate because of running processes](#deactivate-database-sp-unable-to-deactivate-processes)  |  `The database can’t be deactivated because it's in the process of being created or restored.`  | 

**由于进程正在运行，无法停用**

以下错误消息表明存储过程无法停用数据库，因为 `rdsadmin.create_database` 或 `rdsadmin.restore_database` 存储过程正在运行。

```
The database can’t be deactivated because it's in the process of being created or restored.
```

等待几分钟，然后再次调用 `rdsadmin.deactivate_database` 存储过程。

### rdsadmin.drop\$1database 错误
<a name="db2-troubleshooting-drop-database-sp-errors"></a>

调用 [rdsadmin.drop\$1database](db2-sp-managing-databases.md#db2-sp-drop-database) 存储过程时可能会出现以下错误。


| 错误 | 错误消息 | 
| --- | --- | 
|  [Database name doesn't exist](#drop-database-sp-database-name-not-exist)  |  `SQL0438N Application raised error or warning with diagnostic text: "Cannot drop database. Database with provided name does not exist". SQLSTATE=99993`  | 
|  [Return status = 0](#drop-database-sp-return-status-zero)  |  `Return Status = 0`  | 
|  [Dropping database not allowed](#drop-database-sp-not-allowed)  |  `1 ERROR DROP_DATABASE RDSDB 2023-10-10-16.33.03.744122 2023-10-10-16.33.30.143797 - 2023-10-10-16.33.30.098857 Task execution has started. 2023-10-10-16.33.30.143797 Caught exception during executing task id 1, Aborting task. Reason Dropping database created via rds CreateDBInstance api is not allowed. Only database created using rdsadmin.create_database can be dropped`  | 

**数据库名称不存在**

以下错误消息表明您在 `rdsadmin.drop_database` 存储过程中传递的数据库名称不正确。

```
SQL0438N Application raised error or warning with diagnostic text: "Cannot
drop database. Database with provided name does not exist". SQLSTATE=99993
```

使用正确的数据库名称再次调用 `rdsadmin.drop_database` 存储过程。要确认数据库已删除，可调用 [rdsadmin.list\$1databases](db2-user-defined-functions.md#db2-udf-list-databases) 用户定义的函数并检查已删除的数据库是否未列出。

**返回状态 = 0**

以下错误消息表明无法完成存储过程。

```
Return Status = 0
```

收到 `Return Status = 0` 后，调用 [rdsadmin.get\$1task\$1status](db2-user-defined-functions.md#db2-udf-get-task-status) 用户定义的函数。

**不允许删除数据库**

以下错误消息表明您通过 Amazon RDS 控制台或 AWS CLI 创建了数据库。只有通过调用 [rdsadmin.create\$1database](db2-sp-managing-databases.md#db2-sp-create-database) 存储过程创建数据库时，才能使用 `rdsadmin.drop_database` 存储过程。

```
1 ERROR DROP_DATABASE RDSDB 2023-10-10-16.33.03.744122 2023-10-10-16.33.30.143797 - 2023-10-10-16.33.30.098857 Task execution has started.
2023-10-10-16.33.30.143797 Caught exception during executing task id 1, Aborting task. 
Reason Dropping database created via rds CreateDBInstance api is not allowed. 
Only database created using rdsadmin.create_database can be dropped
```

要删除您通过 Amazon RDS 控制台或 AWS CLI 创建的数据库，请使用客户端连接到该数据库，然后运行相应的命令。

### rdsadmin.reactivate\$1database 错误
<a name="db2-troubleshooting-reactivate-database-sp-errors"></a>

调用 [rdsadmin.reactivate\$1database](db2-sp-managing-databases.md#db2-sp-reactivate-database) 存储过程时可能出现以下错误。


| 错误 | 错误消息 | 
| --- | --- | 
|  [Failed to allocate shared memory](#reactivate-database-sp-failed-to-allocate-shared-memory)  |  `SQL1643C The database manager failed to allocate shared memory because the database manager instance memory limit has been reached.`  | 
|  [Unable to reactivate because of running processes](#reactivate-database-sp-unable-to-reactivate-processes)  |  `The database can’t be reactivated because it's in the process of being created or restored.`  | 

**无法分配共享内存**

以下错误消息表明存储过程未能激活数据库，因为数据库实例没有足够的内存。

```
SQL1643C The database manager failed to allocate shared memory because the database manager instance memory limit has been reached.
```

增加数据库实例的内存，然后再次调用 `rdsadmin.activate_database` 存储过程。有关内存使用情况和数据库建议的信息，请参阅[Amazon RDS for Db2 数据库实例上的多个数据库](db2-multiple-databases.md)。

**由于进程正在运行，无法重新激活**

以下错误消息表明存储过程无法重新激活数据库，因为 `rdsadmin.create_database` 或 `rdsadmin.restore_database` 存储过程正在运行。

```
The database can’t be reactivated because it's in the process of being created or restored.
```

等待几分钟，然后再次调用 `rdsadmin.reactivate_database` 存储过程。

### rdsadmin.restore\$1database 错误
<a name="db2-troubleshooting-restore-database-sp-errors"></a>

调用 [rdsadmin.restore\$1database](db2-sp-managing-databases.md#db2-sp-restore-database) 存储过程时可能出现以下错误：


| 错误 | 错误消息 | 
| --- | --- | 
|  [Insufficient disk space](#restore-database-sp-insufficient-disk-space)  |  `Aborting task. Reason Restoring your database failed because of insufficient disk space. Increase the storage for your DB instance and rerun the rdsadmin.restore_database stored procedure.`  | 
|  [Internal error](#restore-database-sp-internal-error)  |  `Caught exception during executing task id 104, Aborting task. Reason Internal Error`  | 
|  [Non-fenced routines not allowed](#restore-database-sp-non-fenced-routines)  |  `Caught exception during executing task id 2, Aborting task. Reason Non fenced routines are not allowed. Please delete the routines and retry the restore.`  | 
| [Tablespaces not restored](#restore-database-sp-tablespaces-not-restored) |  `Reason SQL0970N The system attempted to write to a read-only file. Reason SQL2563W The Restore process has completed successfully. However one or more table spaces from the backup were not restored.`  | 

**磁盘空间不足**

以下错误消息表明数据库实例没有足够的磁盘空间，无法还原数据库：

```
Aborting task. Reason Restoring your database failed because of insufficient disk space. Increase the storage for your DB instance and rerun the rdsadmin.restore_database stored procedure.
```

数据库实例上的可用空间必须是备份映像大小的两倍以上。如果备份映像已压缩，则数据库实例上的可用空间必须是备份映像大小的三倍以上。有关更多信息，请参阅 [增加数据库实例存储容量](USER_PIOPS.ModifyingExisting.md)。

增加磁盘空间，然后再次调用 `rdsadmin.restore_database` 存储过程。要确认数据库已还原，可调用 [rdsadmin.list\$1databases](db2-user-defined-functions.md#db2-udf-list-databases) 用户定义的函数并检查已还原的数据库是否已列出。

**内部错误**

以下错误消息表明存储过程遇到了内部错误：

```
Caught exception during executing task id 104, Aborting task. Reason Internal Error
```

请联系 [AWS Support](https://aws.amazon.com/premiumsupport/)。

**不支持非防护例程**

以下错误消息表明您的数据库包含非防护例程：

```
Caught exception during executing task id 2, Aborting task. Reason Non fenced routines are not allowed. Please delete the routines and retry the restore.
```

RDS for Db2 不支持非防护例程。从源数据库中移除非防护例程，然后再次调用 `rdsadmin.restore_database`。要确认数据库已还原，可调用 [rdsadmin.list\$1databases](db2-user-defined-functions.md#db2-udf-list-databases) 用户定义的函数并检查已还原的数据库是否已列出。有关更多信息，请参阅 [非防护例程](db2-known-issues-limitations.md#db2-known-issues-limitations-non-fenced-routines)。

**未还原表空间**

以下错误消息表明 RDS for Db2 已成功还原数据库，但无法还原一个或多个表空间：

```
Reason SQL0970N The system attempted to write to a read-only file.
Reason SQL2563W The Restore process has completed successfully. However one or more table spaces from the backup were not restored.
```

RDS for Db2 不支持非自动存储。将非自动存储转换为自动存储，然后再次调用 `rdsadmin.restore_database`。有关更多信息，请参阅 IBM Db2 文档中的 [Converting a nonautomatic storage database to use automatic storage](https://www.ibm.com/docs/en/db2/11.5?topic=databases-converting-nonautomatic-storage-database-use-automatic-storage)。

具有非自动 SMS 存储的数据库需要手动还原。如果数据库具有非自动 SMS 存储空间，请联系 [AWS Support](https://aws.amazon.com/premiumsupport/)。

有关非自动存储和一次性迁移的信息，请参阅[迁移期间的非自动存储表空间](db2-known-issues-limitations.md#db2-known-issues-limitations-non-automatic-storage-tablespaces)。

### rdsadmin.update\$1db\$1param 错误
<a name="db2-troubleshooting-update-db-param-sp-errors"></a>

调用 [rdsadmin.update\$1db\$1param](db2-sp-managing-databases.md#db2-sp-update-db-param) 存储过程时可能出现以下错误。


| 错误 | 错误消息 | 
| --- | --- | 
|  [Parameter not supported or modifiable](#update-db-param-sp-parameter-not-supported-modifiable)  | SQL0438N Application raised error or warning with diagnostic text: "Parameter is either not supported or not modifiable to customers". SQLSTATE=99993 | 

**参数不受支持或不可修改**

以下错误消息表明您尝试修改的数据库配置参数不受支持或不可修改。

```
SQL0438N Application raised error or warning with diagnostic text: "Parameter
is either not supported or not modifiable to customers". SQLSTATE=99993
```

您可以通过查看参数组来查看哪些参数可修改。有关更多信息，请参阅 [在 Amazon RDS 中查看数据库参数组的参数值](USER_WorkingWithParamGroups.Viewing.md)。