はじめに
システムテーブルを使うと、Verticaのクラスタの状態や、テーブル、プロジェクション、ユーザ等の詳細な情報を確認することができます。用途の異なる複数のシステムテーブルが用意されていますので、システムテーブルの一覧を確認する方法をご紹介します。
システムテーブル一覧の確認方法
システムテーブルの一覧はSYSTEM_TABLESシステムテーブルで確認できます。
SYSTEM_TABLES
列名 | 内容 |
|---|---|
TABLE_SCHEMA_ID | カタログから割り当てられたスキーマを一意に識別する整数値 |
TABLE_SCHEMA | システムテーブルが存在するスキーマ名。次のいずれかです。 |
TABLE_NAME | システムテーブルの名前。 |
TABLE_ID | カタログから割り当てられたテーブルを一意に識別する整数値。 |
TABLE_DESCRIPTION | システムテーブルの目的の説明。 |
IS_SUPERUSER_ONLY | スーパーユーザーのみがテーブルにアクセスできるかどうかを指定します。 |
IS_MONITORABLE | SYSMONITORロールが有効になっているユーザーがテーブルにアクセスできるかどうかを指定します。 |
IS_ACCESSIBLE_DURING_LOCKDOWN | RESTRICT_SYSTEM_TABLES_ACCESSが呼び出された後、このシステムテーブルへの非スーパーユーザーアクセスを制限するかどうかを指定します。 |
以下に実行結果をご紹介します。
#システムテーブルの種類数を確認
dbadmin=> SELECT COUNT(*) FROM SYSTEM_TABLES;
count
-------
217
(1 row)
#システムテーブルの一覧を確認
dbadmin=> SELECT * FROM SYSTEM_TABLES;
-[ RECORD 1 ]-----------------+-------------------------------------------------
table_schema_id | 8301
table_schema | v_catalog
table_id | 95400
table_name | access_policy
table_description | Access Policy information
is_superuser_only | t
is_monitorable | t
is_accessible_during_lockdown | f
-[ RECORD 2 ]-----------------+-------------------------------------------------
table_schema_id | 8302
table_schema | v_monitor
table_id | 24000
table_name | active_events
table_description | Displays all of the active events in the cluster
is_superuser_only | t
is_monitorable | t
is_accessible_during_lockdown | f
-[ RECORD 3 ]-----------------+-------------------------------------------------
table_schema_id | 8301
table_schema | v_catalog
table_id | 117200
table_name | branches_status
table_description | Current status of existing branches
is_superuser_only | t
is_monitorable | t
is_accessible_during_lockdown | f
-[ RECORD 4 ]-----------------+-------------------------------------------------
table_schema_id | 8301
table_schema | v_catalog
table_id | 136200
table_name | ca_bundles
table_description | X509 CA Certificate Bundles
is_superuser_only | f
is_monitorable | t
is_accessible_during_lockdown | t
-[ RECORD 5 ]-----------------+-------------------------------------------------
table_schema_id | 8301
table_schema | v_catalog
table_id | 134400
table_name | certificates
table_description | Cryptographic Certificate Information
is_superuser_only | f
is_monitorable | t
is_accessible_during_lockdown | t
-[ RECORD 6 ]-----------------+-------------------------------------------------
table_schema_id | 8301
table_schema | v_catalog
table_id | 94400
table_name | client_auth
table_description | Client Authentication Detailed information
is_superuser_only | f
is_monitorable | t
is_accessible_during_lockdown | t
-[ RECORD 7 ]-----------------+-------------------------------------------------
table_schema_id | 8301
table_schema | v_catalog
table_id | 94600
table_name | client_auth_params
table_description | Client Authentication Parameters
is_superuser_only | t
is_monitorable | t
is_accessible_during_lockdown | f
-[ RECORD 8 ]-----------------+-------------------------------------------------
:補足情報
よく使用されるシステムテーブルを以下に記載します。各システムテーブルの詳細は、参考情報もあわせてご覧ください。
システムテーブル | 内容 | 参考情報 |
|---|---|---|
system | システム全体の情報 | |
nodes | ノードの情報 | 異なるクラスタのテーブルにデータをコピーする方法(EXPORT TO VERTICA) |
configuration_parameters | パラメータの情報 | |
disk_storage | ディスクの使用状況の情報 | データサイズの確認方法 |
projections | プロジェクションの情報 | セグメンテーションとレプリケーションの概要 |
projection_storage | プロジェクションごとのストレージの使用状況 | データサイズの確認方法 |
sessions | セッションごとの情報 | |
current_session | カレントセッションの情報 | |
query_requests | ユーザが発行したクエリの履歴情報 | SQL実行中のセッションを強制的に終了する方法 |
load_streams | ノードごとのデータロードの進捗状況 | |
locks | 現在発生しているロックの情報 | |
delete_vectors | デリートベクタの情報 | |
storage_containers | コンテナの情報 | データファイルの保存先を追加する方法(STORAGE LOCATION) |
参考情報
システムテーブルのカラム一覧を出力する方法
https://www.ashisuto.co.jp/cm/analytics-database/system_table_schema.html
システムテーブルの保存条件について
https://www.ashisuto.co.jp/cm/analytics-database/datacollector.html
Vertica System Tables
https://www.vertica.com/docs/10.1.x/HTML/Content/Authoring/SQLReferenceManual/SystemTables/VerticaSystemTables.htm
SYSTEM_TABLES
https://www.vertica.com/docs/10.1.x/HTML/Content/Authoring/SQLReferenceManual/SystemTables/CATALOG/SYSTEM_TABLES.htm
検証バージョンについて
この記事の内容はVertica 10.1で確認しています。
更新履歴
2021/05/21 本記事を公開