

 Amazon Redshift は、パッチ 198 以降、新しい Python UDF の作成をサポートしなくなります。既存の Python UDF は、2026 年 6 月 30 日まで引き続き機能します。詳細については、[ブログ記事](https://aws.amazon.com/blogs/big-data/amazon-redshift-python-user-defined-functions-will-reach-end-of-support-after-june-30-2026/)を参照してください。

# SVL\_MV\_REFRESH\_STATUS
<a name="r_SVL_MV_REFRESH_STATUS"></a>

SVL\_MV\_REFRESH\_STATUS ビューには、マテリアライズドビューの更新作業用の行が含まれています。

マテリアライズドビューの詳細については、「[Amazon Redshift でのマテリアライズドビュー](materialized-view-overview.md)」を参照してください。

SVL\_MV\_REFRESH\_STATUS はすべてのユーザーに表示されます。スーパーユーザーはすべての行を表示できますが、通常のユーザーは自分のデータのみを表示できます。詳細については、「[システムテーブルとビューのデータの可視性](cm_chap_system-tables.md#c_visibility-of-data)」を参照してください。

このテーブルの一部またはすべてのデータは、SYS モニタリングビュー [SYS\_MV\_REFRESH\_HISTORY](SYS_MV_REFRESH_HISTORY.md) でも確認できます。SYS モニタリングビューのデータは、使いやすく理解しやすいようにフォーマットされます。クエリには、SYS モニタリングビューを使用することをお勧めします。

## テーブルの列
<a name="r_SVL_MV_REFRESH_STATUS-table-columns"></a>


| 列名  | データ型  | 説明  | 
| --- | --- | --- | 
| db\_name  | char(128)  | マテリアライズドビューを含むデータベース。 | 
| userid  | bigint  | 更新を実行したユーザーの ID。 | 
| schema\_name  | char(128)  | マテリアライズドビューのスキーマ。 | 
| mv\_name  | char(128)  | マテリアライズドビューの名前。 | 
| xid  | bigint  | 更新トランザクションの ID。 | 
| starttime  | timestamp  | 更新の開始時間。 | 
| endtime  | timestamp  | 更新の終了時間。 | 
| status  | text  | 更新のステータス。値の例は次のとおりです。[See the AWS documentation website for more details](http://docs.aws.amazon.com/ja_jp/redshift/latest/dg/r_SVL_MV_REFRESH_STATUS.html) | 
| refresh\_type | char(32) | 更新タイプの定義。値の例には、[Manual] (手動) および [Auto] (自動) が含まれます。 | 
| consumer\_account | char(12) | 更新を開始したコンシューマークラスターの AWS アカウント ID。このフィールドは、データ共有設定でコンシューマークラスターから更新が開始されるときに入力されます。 | 
| consumer\_region | char(32) | 更新を開始したコンシューマークラスターの AWS リージョン。このフィールドは、データ共有設定でコンシューマークラスターから更新が開始されるときに入力されます。 | 
| consumer\_namespace | char(36) | 更新を開始したコンシューマークラスターの名前空間の識別子。このフィールドは、データ共有設定でコンシューマークラスターから更新が開始されるときに入力されます。 | 

## サンプルクエリ
<a name="r_SVL_MV_REFRESH-sample-query"></a>

マテリアライズドビューの更新ステータスを表示するには、次のクエリを実行します。

```
select * from svl_mv_refresh_status;
```

このクエリは、次のサンプル出力を返します。

```
 db_name | userid |  schema   |  name   |  xid  |         starttime          |          endtime           |                        status                                                       |  refresh_type | consumer_account | consumer_region | consumer_namespace
---------+--------+-----------+---------+-------+----------------------------+----------------------------+-------------------------------------------------------------------------------------+---------------+------------------+-----------------+------------------------------------
 dev     |    169 | mv_schema | mv_test |  6640 | 2020-02-14 02:26:53.497935 | 2020-02-14 02:26:53.556156 | Refresh successfully recomputed MV from scratch                                     |  Manual       |                  |                 |
 dev     |    166 | mv_schema | mv_test |  6517 | 2020-02-14 02:26:39.287438 | 2020-02-14 02:26:39.349539 | Refresh successfully updated MV incrementally                                       |  Auto         |                  |                 |
 ext_db  |    162 | producer_schema | producer_mv |  6388 | 2020-02-14 02:26:27.863426 | 2020-02-14 02:26:27.918307 | Refresh successfully updated MV incrementally                                     |  Manual       | 0123456789       | us-east-1       | 623d8ff2-4391-4381-83d7-177caa6767af
 dev     |    161 | mv_schema | mv_test |  6323 | 2020-02-14 02:26:20.020717 | 2020-02-14 02:26:20.080002 | Refresh successfully updated MV incrementally                                       |  Auto         |                  |                 |
 dev     |    161 | mv_schema | mv_test |  6301 | 2020-02-14 02:26:05.796146 | 2020-02-14 02:26:07.853986 | Refresh successfully recomputed MV from scratch                                     |  Manual       |                  |                 |
 dev     |    153 | mv_schema | mv_test |  6024 | 2020-02-14 02:25:18.762335 | 2020-02-14 02:25:20.043462 | MV was already updated                                                              |  Manual       |                  |                 |
 dev     |    143 | mv_schema | mv_test |  5557 | 2020-02-14 02:24:23.100601 | 2020-02-14 02:24:23.100633 | MV was already updated                                                              |  Manual
 dev     |    141 | mv_schema | mv_test |  5447 | 2020-02-14 02:23:54.102837 | 2020-02-14 02:24:00.310166 | Refresh successfully updated MV incrementally                                       |  Auto
 dev     |      1 | mv_schema | mv_test |  5329 | 2020-02-14 02:22:26.328481 | 2020-02-14 02:22:28.369217 | Refresh successfully recomputed MV from scratch                                     |  Auto
 dev     |    138 | mv_schema | mv_test |  5290 | 2020-02-14 02:21:56.885093 | 2020-02-14 02:21:56.885098 | Refresh failed. MV was not found                                                    |  Manual
 dev     |    138 | mv_schema | mv_test |  5100 | 2020-02-14 02:20:33.123445 | 2020-02-14 02:20:33.123445 | Cascade refresh failed because materialized view mv_schema.child was not refreshed. |  Manual
 dev     |    138 | mv_schema | child   |  5100 | 2020-02-14 02:20:33.123445 | 2020-02-14 02:20:33.123445 | Refresh failed due to an internal error.                                            |  Manual
 dev     |    138 | mv_schema | mv_test |  5099 | 2020-02-14 02:10:23.492344 | 2020-02-14 02:10:23.492344 | Cascade refresh skipped because materialized view mv_schema.child was not refreshed.|  Manual
 dev     |    138 | mv_schema | child   |  5099 | 2020-02-14 02:10:23.492344 | 2020-02-14 02:10:23.492344 | Refresh failed due to an internal error.                                            |  Manual
```