

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

# Amazon Keyspaces 中的系統金鑰空間
<a name="working-with-keyspaces"></a>

Amazon Keyspaces 中的系統金鑰空間和系統資料表 （適用於 Apache Cassandra) 是唯讀資源，可存放 Amazon Keyspaces 資源的中繼資料。系統金鑰空間存在於每個 中 AWS 帳戶，無論您是否已建立任何金鑰空間或資料表。它們是 Apache Cassandra 的相容性功能，而且免費提供。

您無法修改或刪除系統金鑰空間。Amazon Keyspaces 主控台只會顯示使用者建立的金鑰空間。系統金鑰空間可透過 CQL 以程式設計方式存取，並出現在 AWS CloudFormation 和 等服務中 AWS Config。

Amazon Keyspaces 使用四個系統金鑰空間：
+ `system`
+ `system_schema`
+ `system_schema_mcs`
+ `system_multiregion_info`

下列各節提供 Amazon Keyspaces 中支援之系統金鑰空間和系統資料表的詳細資訊。

## `system`
<a name="keyspace_system_list"></a>

這是 Cassandra 金鑰空間。Amazon Keyspaces 使用以下資料表。


| 資料表名稱 | 欄位名稱 | 說明 | 
| --- | --- | --- | 
|  `local`  |  `key, bootstrapped, broadcast_address, cluster_name, cql_version, data_center, gossip_generation, host_id, listen_address, native_protocol_version, partitioner, rack, release_version, rpc_address, schema_version, thrift_version, tokens, truncated_at`  |  本機金鑰空間的相關資訊。  | 
|  `peers`  |  `peer, data_center, host_id, preferred_ip, rack, release_version, rpc_address, schema_version, tokens`  |  查詢此表格以查看可用的端點。例如，如果您透過公有端點連線，您會看到九個可用 IP 地址的清單。如果您是透過 FIPS 端點連線，您會看到三個 IP 地址的清單。如果您是透過 AWS PrivateLink VPC 端點連線，您會看到已設定的 IP 地址清單。如需詳細資訊，請參閱[使用界面 VPC 端點資訊填入`system.peers`資料表項目](vpc-endpoints.md#system_peers)。  | 
|  `size_estimates`  |  `keyspace_name, table_name, range_start, range_end, mean_partition_size, partitions_count`  | 此資料表定義每個資料表的每個字符範圍的總大小和分割區數量。Apache Cassandra Spark Connector 需要此操作，這會使用預估的分割區大小來分配工作。 | 
|  `prepared_statements`  |  `prepared_id, logged_keyspace, query_string`  |  此資料表包含已儲存查詢的相關資訊。  | 

## `system_schema`
<a name="keyspace_system_schema"></a>

這是 Cassandra 金鑰空間。Amazon Keyspaces 使用以下資料表。


| 資料表名稱 | 欄位名稱 | 說明 | 
| --- | --- | --- | 
|  `keyspaces`  |  `keyspace_name, durable_writes, replication`  |  特定金鑰空間的相關資訊。  | 
|  `tables`  |  `keyspace_name, table_name, bloom_filter_fp_chance, caching, comment, compaction, compression, crc_check_chance, dclocal_read_repair_chance, default_time_to_live, extensions, flags, gc_grace_seconds, id, max_index_interval, memtable_flush_period_in_ms, min_index_interval, read_repair_chance, speculative_retry`  |  特定資料表的相關資訊。  | 
|  `types`  |  `keyspace_name, type_name, field_names, field_types`  |  特定使用者定義類型 (UDT) 的相關資訊。  | 
|  `columns`  |  `keyspace_name, table_name, column_name, clustering_order, column_name_bytes, kind, position, type`  |  特定資料欄的相關資訊。  | 

## `system_schema_mcs`
<a name="keyspace_system_schema_mcs"></a>

這是存放 AWS 或 Amazon Keyspaces 特定設定相關資訊的 Amazon Keyspaces 金鑰空間。


| 資料表名稱 | 欄位名稱 | 說明 | 
| --- | --- | --- | 
|  `keyspaces`  |  `keyspace_name, durable_writes, replication`  |  查詢此表格，以程式設計方式找出是否已建立金鑰空間。如需詳細資訊，請參閱[檢查 Amazon Keyspaces 中的金鑰空間建立狀態](keyspaces-create.md)。  | 
|  `tables`  |  `keyspace_name, creation_time, speculative_retry, cdc, gc_grace_seconds, crc_check_chance, min_index_interval, bloom_filter_fp_chance, flags, custom_properties, dclocal_read_repair_chance, table_name, caching, default_time_to_live, read_repair_chance, max_index_interval, extensions, compaction, comment, id, compression, memtable_flush_period_in_ms, cdc_specification, latest_stream_arn status`  |  查詢此資料表以了解特定資料表的狀態。如需詳細資訊，請參閱[在 Amazon Keyspaces 中檢查資料表建立狀態](tables-create.md)。 您也可以查詢此表格，列出 Amazon Keyspaces 特定的設定，並儲存為 `custom_properties`。例如： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/keyspaces/latest/devguide/working-with-keyspaces.html)  | 
|  `tables_history`  |  `keyspace_name, table_name, event_time, creation_time, custom_properties, event`  |  查詢此表格以了解特定資料表的結構描述變更。  | 
|  `columns`  |  `keyspace_name, table_name, column_name, clustering_order, column_name_bytes, kind, position, type`  |  此資料表與 `system_schema` 金鑰空間中的 Cassandra 資料表相同。  | 
|  `tags`  |  `resource_id, keyspace_name, resource_name, resource_type, tags`  |  查詢此表格以了解金鑰空間是否有標籤。如需詳細資訊，請參閱[檢視資料表的標籤](Tagging.Operations.view.table.md)。  | 
|  `types`  |  `keyspace_name, type_name, field_names, field_types, max_nesting_depth, last_modified_timestamp, status, direct_referring_tables, direct_parent_types`  |  查詢此表格以了解使用者定義類型 (UDTs的相關資訊。例如，您可以查詢此資料表，列出指定金鑰空間的所有 UDTs。如需詳細資訊，請參閱[Amazon Keyspaces 中使用者定義的類型 (UDT)](udts.md)。  | 
|  `autoscaling`  |  `keyspace_name, table_name, provisioned_read_capacity_autoscaling_update, provisioned_write_capacity_autoscaling_update`  |  查詢此資料表以取得佈建資料表的自動擴展設定。請注意，在資料表處於作用中狀態之前，這些設定將無法使用。若要查詢此資料表，您必須在 `WHERE`子句`table_name`中指定 `keyspace_name`和 。如需詳細資訊，請參閱[檢視資料表的 Amazon Keyspaces 自動擴展組態](autoscaling.viewPolicy.md)。  | 

## `system_multiregion_info`
<a name="keyspace_system_multiregion_info"></a>

這是存放多區域複寫相關資訊的 Amazon Keyspaces 金鑰空間。


| 資料表名稱 | 欄位名稱 | 說明 | 
| --- | --- | --- | 
|  `tables`  |  `keyspace_name, table_name, region, status`   |  此資料表包含多區域資料表的相關資訊，例如，複寫資料表 AWS 區域 所在的 和資料表的狀態。您也可以查詢此表格，列出存放為 之 Amazon Keyspaces 特有的設定`custom_properties`。例如： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/keyspaces/latest/devguide/working-with-keyspaces.html) 若要查詢此資料表，您必須在 `WHERE`子句`table_name`中指定 `keyspace_name`和 。如需詳細資訊，請參閱[在 Amazon Keyspaces 中建立多區域金鑰空間](keyspaces-mrr-create.md)。  | 
|  `keyspaces`  |  `keyspace_name, region, status, tables_replication_progress`   |  此資料表包含 `ALTER KEYSPACE`操作的進度資訊，該操作會將複本新增至金鑰空間，例如，在新區域中已建立多少個資料表，以及仍在進行多少個資料表。如需範例，請參閱 [將新區域新增至金鑰空間時，請檢查複寫進度](keyspaces-multi-region-replica-status.md)。  | 
|  `autoscaling`  |  `keyspace_name, table_name, provisioned_read_capacity_autoscaling_update, provisioned_write_capacity_autoscaling_update, region`  |  查詢此資料表以取得多區域佈建資料表的自動擴展設定。請注意，在資料表處於作用中狀態之前，這些設定將無法使用。若要查詢此資料表，您必須在 `WHERE`子句`table_name`中指定 `keyspace_name`和 。如需詳細資訊，請參閱[更新 Amazon Keyspaces 中多區域資料表的佈建容量和自動擴展設定](tables-mrr-autoscaling.md)。  | 
|  `types`  |  `keyspace_name, type_name, field_names, field_types, max_nesting_depth, last_modified_timestamp, status, direct_referring_tables, direct_parent_types, region`  |  查詢此表格，以了解多區域金鑰空間中使用者定義類型 (UDTs) 的相關資訊。例如，您可以查詢此資料表以列出所有資料表複本，以及其對指定金鑰空間使用 UDTs個別 AWS 區域。如需詳細資訊，請參閱[Amazon Keyspaces 中使用者定義的類型 (UDT)](udts.md)。  | 