

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 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>

您可能會因為不同的原因而遇到檔案 I/O 錯誤，例如當您使用 `LOAD` 命令或呼叫 `rdsadmin.restore_database` 預存程序時。

在此範例中，您要執行下列 `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 虛擬私有雲使用者指南》**中的[建立 VPC](https://docs.aws.amazon.com/vpc/latest/userguide/create-vpc.html)。

1. 為要使用的私有子網路建立 Amazon S3 閘道端點。如需詳細資訊，請參閱《AWS PrivateLink 指南》**中的[閘道端點](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、將*區域*取代為 AWS 區域，並將*設定檔*取代為設定檔名稱。

針對 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>

本節說明呼叫預存程序時傳回的各種錯誤，以及如何解決這些錯誤。


| Category | 預存程序錯誤 | 
| --- | --- | 
|  資料庫  |  [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) 預存程序時，可能會發生下列錯誤。


| 錯誤 | 錯誤訊息 | 
| --- | --- | 
|    |  `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)。您也可以驗證備份檔案存在於 *s3\$1prefix/dbi\$1resource\$1id/db\$1name* 下的 Amazon S3 儲存貯體中。

**內部錯誤**

下列錯誤訊息表示預存程序發生內部錯誤：

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

聯絡 [AWS 支援](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.drop_database` 預存程序建立資料庫時，才能使用 [rdsadmin.create\$1database](db2-sp-managing-databases.md#db2-sp-create-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) 預存程序時，可能會發生下列錯誤：


| 錯誤 | 錯誤訊息 | 
| --- | --- | 
|    |  `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 支援](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 文件中的[將非自動儲存資料庫轉換為使用自動儲存](https://www.ibm.com/docs/en/db2/11.5?topic=databases-converting-nonautomatic-storage-database-use-automatic-storage)。

具有非自動 SMS 儲存的資料庫需要手動還原。如果您的資料庫具有非自動 SMS 儲存，請聯絡 [AWS 支援](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)。