SHOW PARAMETERS¶
設定可能なすべてのアカウント、セッション、およびオブジェクトのパラメーターと、各パラメーターの現在値およびデフォルト値をリストします。
アカウントパラメーターは、アカウントレベルでのみ設定できます。
セッションパラメーターは、アカウント、ユーザー、およびセッションレベルで設定できます。
オブジェクトパラメーターは、アカウントおよびオブジェクトレベルで設定できます。
パラメーターが明示的に設定されている場合、このコマンドの出力には、パラメーターが設定されているレベルも表示されます。
さまざまなパラメータータイプの説明、および各パラメーターの詳細な説明については、 パラメーター をご参照ください。
構文¶
SHOW PARAMETERS
[ LIKE '<pattern>' ]
[ { IN | FOR } {
{ SESSION | ACCOUNT }
| { USER | WAREHOUSE | DATABASE | SCHEMA | TASK } [ <name> ]
| TABLE [ <table_or_view_name> ]
} ]
パラメーター¶
LIKE 'pattern'オプションで、オブジェクト名でコマンド出力をフィルタリングします。フィルターは、 SQL ワイルドカード文字(
%および_)をサポートする、 大文字と小文字を区別しない パターンマッチングを使用します。たとえば、次のパターンは 同じ 結果を返します。
... LIKE '%testing%' ...... LIKE '%TESTING%' .... デフォルト: 値なし(フィルタリングは出力に非適用)。
IN | FORIN ...またはFOR ...は、返されるパラメーターを決定するコマンドのスコープを指定します。SESSION現在のセッションのすべてのセッションパラメーターとその設定を返します。ユーザーは、 ALTER SESSION を使用してセッションのこれらのパラメーターを変更できます。
ACCOUNTアカウントレベルで設定できるアカウント、セッション、およびオブジェクトパラメーターのリストを返します。ACCOUNTADMIN ロールを持つユーザー(アカウント管理者)は、 ALTER ACCOUNT を介してこれらのパラメーターを変更できます。詳細については、 パラメーター管理 をご参照ください。
USER [ name ]ユーザーがログインするたびに、指定されたユーザー(または現在のユーザー)に設定されている、セッションパラメーターのデフォルトのリストを返します。
ユーザーが指定されていない場合、コマンドは現在のユーザーの結果を返します。
適切なユーザー権限を持つ管理者は、 ALTER USER を使用してユーザーのセッションパラメーターのデフォルトを変更できます。
個々のユーザーは、 ALTER USER を使用してセッションパラメーターのデフォルトを変更することもできます。
WAREHOUSE | DATABASE | SCHEMA | TASK [ name ]現在/指定されたオブジェクトに設定できるオブジェクトパラメーターを返します。適切な権限を持つユーザーは、対応する ALTER <オブジェクト> コマンドを使用してこれらのパラメーターを変更できます。
TABLE [ table_or_view_name ]指定したテーブルまたはビューに設定できるオブジェクトパラメーターを返します。適切な権限を持つユーザーは、 ALTER TABLE コマンドを使用してこれらのパラメーターを変更できます。
テーブル、ビュー、マテリアライズドビューなど、すべてのテーブル類似オブジェクトのドメインとして
TABLEを使用します。
デフォルト:
SESSION
使用上の注意¶
このコマンドの実行には、稼働中のウェアハウスは必要ありません。
このコマンドは、現在のユーザーの現在のロールに少なくとも1つのアクセス権限が付与されているオブジェクトのみを返します。
MANAGE GRANTS アクセス権限により、所有者はアカウント内のすべてのオブジェクトを暗黙的に参照できます。デフォルトでは、アカウント管理者( ACCOUNTADMIN ロールを持つユーザー)とセキュリティ管理者( SECURITYADMIN ロールを持つユーザー)のみが MANAGE GRANTS 権限を持っています。
このコマンドの出力を後処理するには、 パイプ演算子 (
->>)または RESULT_SCAN 関数。どちらのコンストラクトも、出力を クエリできる結果セットとして扱います。For example, you can use the pipe operator or RESULT_SCAN function to select specific columns from the SHOW command output or filter the rows.
When you refer to the output columns, use double-quoted identifiers for the column names. For example, to select the output column
type, specifySELECT "type".You must use double-quoted identifiers because the output column names for SHOW commands are in lowercase. The double quotes ensure that the column names in the SELECT list or WHERE clause match the column names in the SHOW command output that was scanned.
例¶
現在のセッションに設定できるすべてのセッションパラメーターを表示します。
SHOW PARAMETERS; +-------------------------------------+----------------------------------+----------------------------------+---------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | key | value | default | level | description | |-------------------------------------+----------------------------------+----------------------------------+---------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ABORT_DETACHED_QUERY | false | false | SESSION | If true, Snowflake will automatically abort queries when it detects that the client has disappeared. | | AUTOCOMMIT | true | true | SESSION | The autocommit property determines whether is statement should to be implicitly | | | | | | wrapped within a transaction or not. If autocommit is set to true, then a | | | | | | statement that requires a transaction is executed within a transaction | | | | | | implicitly. If autocommit is off then an explicit commit or rollback is required | | | | | | to close a transaction. The default autocommit value is true. | | AUTOCOMMIT_API_SUPPORTED | true | true | | Whether autocommit feature is enabled for this client. This parameter is for | | | | | | Snowflake use only. | | BINARY_INPUT_FORMAT | HEX | HEX | | input format for binary | | BINARY_OUTPUT_FORMAT | HEX | HEX | | display format for binary | | CLIENT_SESSION_KEEP_ALIVE | false | false | | If true, client session will not expire automatically | | DATE_INPUT_FORMAT | AUTO | AUTO | | input format for date | | DATE_OUTPUT_FORMAT | YYYY-MM-DD | YYYY-MM-DD | | display format for date | | ERROR_ON_NONDETERMINISTIC_MERGE | true | true | | raise an error when attempting to merge-update a row that joins many rows | | ERROR_ON_NONDETERMINISTIC_UPDATE | false | false | | raise an error when attempting to update a row that joins many rows | | LOCK_TIMEOUT | 43200 | 43200 | | Number of seconds to wait while trying to lock a resource, before timing out | | | | | | and aborting the statement. A value of 0 turns off lock waiting i.e. the | | | | | | statement must acquire the lock immediately or abort. If multiple resources | | | | | | need to be locked by the statement, the timeout applies separately to each | | | | | | lock attempt. | | QUERY_TAG | | | | String (up to 2000 characters) used to tag statements executed by the session | | QUOTED_IDENTIFIERS_IGNORE_CASE | false | false | | If true, the case of quoted identifiers is ignored | | ROWS_PER_RESULTSET | 0 | 0 | | maxium number of rows in a result set | | STATEMENT_QUEUED_TIMEOUT_IN_SECONDS | 0 | 0 | | Timeout in seconds for queued statements: statements will automatically be canceled if they are queued on a warehouse for longer than this amount of time; disabled if set to zero. | | STATEMENT_TIMEOUT_IN_SECONDS | 0 | 0 | | Timeout in seconds for statements: statements will automatically be canceled if they run for longer than this amount of time; disabled if set to zero. | | TIMESTAMP_DAY_IS_ALWAYS_24H | false | true | SYSTEM | If set, arithmetic on days always uses 24 hours per day, | | | | | | possibly not preserving the time (due to DST changes) | | TIMESTAMP_INPUT_FORMAT | AUTO | AUTO | | input format for timestamp | | TIMESTAMP_LTZ_OUTPUT_FORMAT | | | | Display format for TIMESTAMP_LTZ values. If empty, TIMESTAMP_OUTPUT_FORMAT is used. | | TIMESTAMP_NTZ_OUTPUT_FORMAT | YYYY-MM-DD HH24:MI:SS.FF3 | YYYY-MM-DD HH24:MI:SS.FF3 | SYSTEM | Display format for TIMESTAMP_NTZ values. If empty, TIMESTAMP_OUTPUT_FORMAT is used. | | TIMESTAMP_OUTPUT_FORMAT | YYYY-MM-DD HH24:MI:SS.FF3 TZHTZM | YYYY-MM-DD HH24:MI:SS.FF3 TZHTZM | SYSTEM | Default display format for all timestamp types. | | TIMESTAMP_TYPE_MAPPING | TIMESTAMP_NTZ | TIMESTAMP_NTZ | SYSTEM | If TIMESTAMP type is used, what specific TIMESTAMP* type it should map to: | | | | | | TIMESTAMP_LTZ (default), TIMESTAMP_NTZ or TIMESTAMP_TZ | | TIMESTAMP_TZ_OUTPUT_FORMAT | | | | Display format for TIMESTAMP_TZ values. If empty, TIMESTAMP_OUTPUT_FORMAT is used. | | TIMEZONE | America/Los_Angeles | America/Los_Angeles | | time zone | | TIME_INPUT_FORMAT | AUTO | AUTO | | input format for time | | TIME_OUTPUT_FORMAT | HH24:MI:SS | HH24:MI:SS | | display format for time | | TRANSACTION_ABORT_ON_ERROR | false | false | | If this parameter is true, and a statement issued within a non-autocommit | | | | | | transaction returns with an error, then the non-autocommit transaction is | | | | | | aborted. All statements issued inside that transaction will fail until an | | | | | | commit or rollback statement is executed to close that transaction. | | TRANSACTION_DEFAULT_ISOLATION_LEVEL | READ COMMITTED | READ COMMITTED | | The default isolation level when starting a starting a transaction, when no | | | | | | isolation level was specified | | TWO_DIGIT_CENTURY_START | 1970 | 1970 | | For 2-digit dates, defines a century-start year. | | | | | | For example, when set to 1980: | | | | | | - parsing a string '79' will produce 2079 | | | | | | - parsing a string '80' will produce 1980 | | UNSUPPORTED_DDL_ACTION | ignore | ignore | | The action to take upon encountering an unsupported ddl statement | | USE_CACHED_RESULT | true | true | | If enabled, query results can be reused between successive invocations of the same query as long as the original result has not expired | +-------------------------------------+----------------------------------+----------------------------------+---------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+この例の出力には、セッションレベルで設定できないため、アカウントパラメーターまたはオブジェクトパラメーターが含まれていないことに注意してください。
アカウントパラメーターの詳細、およびアカウントレベルでのパラメーターの設定については、 パラメーター管理 をご参照ください。
指定されたウェアハウス(testwh)に設定できるすべてのオブジェクトパラメーターを表示します。
SHOW PARAMETERS IN WAREHOUSE testwh; +-------------------------------------+--------+---------+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | key | value | default | level | description | |-------------------------------------+--------+---------+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | MAX_CONCURRENCY_LEVEL | 8 | 8 | | Concurrency level for SQL statements (i.e. queries and DML) executed by a warehouse cluster (used to determine when statements are queued or additional clusters are started). Small SQL statements count as a fraction of 1. | | STATEMENT_QUEUED_TIMEOUT_IN_SECONDS | 0 | 0 | | Timeout in seconds for queued statements: statements will automatically be canceled if they are queued on a warehouse for longer than this amount of time; disabled if set to zero. | | STATEMENT_TIMEOUT_IN_SECONDS | 172800 | 172800 | | Timeout in seconds for statements: statements are automatically canceled if they run for longer; if set to zero, max value (604800) is enforced. | +-------------------------------------+--------+---------+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
現在のデータベース(testdb)に設定できるすべてのオブジェクトパラメーターを表示します。
USE DATABASE testdb; SHOW PARAMETERS IN DATABASE; +-----------------------------+-------+---------+-------+------------------------------------------------------------------+ | key | value | default | level | description | |-----------------------------+-------+---------+-------+------------------------------------------------------------------| | DATA_RETENTION_TIME_IN_DAYS | 1 | 1 | | number of days to retain the old version of deleted/updated data | +-----------------------------+-------+---------+-------+------------------------------------------------------------------+