

 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/)을 참조하세요.

# SYS 모니터링 뷰
<a name="serverless_views-monitoring"></a>

*모니터링 뷰*는 프로비저닝된 클러스터 및 서버리스 작업 그룹의 쿼리 및 워크로드 리소스 사용량을 모니터링하는 데 사용되는 Amazon Redshift Serverless의 시스템 뷰입니다. 이러한 보기는 `pg_catalog` 스키마에 있습니다. 이러한 보기에서 제공하는 정보를 표시하려면 SQL SELECT 문을 실행합니다.

달리 명시되지 않는 한, 이러한 보기는 Amazon Redshift 클러스터 및 Amazon Redshift Serverless 작업 그룹에서 사용할 수 있습니다.

*SYS\$1SERVERLESS\$1USAGE*는 Amazon Redshift Serverless의 사용량 데이터만 수집합니다.

**Topics**
+ [SYS\$1ANALYZE\$1COMPRESSION\$1HISTORY](r_SYS_ANALYZE_COMPRESSION_HISTORY.md)
+ [SYS\$1ANALYZE\$1HISTORY](SYS_ANALYZE_HISTORY.md)
+ [SYS\$1APPLIED\$1MASKING\$1POLICY\$1LOG](SYS_APPLIED_MASKING_POLICY_LOG.md)
+ [SYS\$1AUTOMATIC\$1OPTIMIZATION](SYS_AUTOMATIC_OPTIMIZATION.md)
+ [SYS\$1AUTO\$1TABLE\$1OPTIMIZATION](r_SYS_AUTO_TABLE_OPTIMIZATION.md)
+ [SYS\$1CHILD\$1QUERY\$1TEXT](SYS_CHILD_QUERY_TEXT.md)
+ [SYS\$1CONNECTION\$1LOG](SYS_CONNECTION_LOG.md)
+ [SYS\$1COPY\$1JOB](SYS_COPY_JOB.md)
+ [SYS\$1COPY\$1JOB\$1DETAIL](SYS_COPY_JOB_DETAIL.md)
+ [SYS\$1COPY\$1JOB\$1INFO](SYS_COPY_JOB_INFO.md)
+ [SYS\$1COPY\$1REPLACEMENTS](SYS_COPY_REPLACEMENTS.md)
+ [SYS\$1DATASHARE\$1CHANGE\$1LOG](SYS_DATASHARE_CHANGE_LOG.md)
+ [SYS\$1DATASHARE\$1CROSS\$1REGION\$1USAGE](r_SYS_DATASHARE_CROSS_REGION_USAGE.md)
+ [SYS\$1DATASHARE\$1USAGE\$1CONSUMER](SYS_DATASHARE_USAGE_CONSUMER.md)
+ [SYS\$1DATASHARE\$1USAGE\$1PRODUCER](SYS_DATASHARE_USAGE_PRODUCER.md)
+ [SYS\$1EXTERNAL\$1QUERY\$1DETAIL](SYS_EXTERNAL_QUERY_DETAIL.md)
+ [SYS\$1EXTERNAL\$1QUERY\$1ERROR](SYS_EXTERNAL_QUERY_ERROR.md)
+ [SYS\$1EXTRA\$1COMPUTE\$1FOR\$1AUTOMATIC\$1OPTIMIZATION](SYS_EXTRA_COMPUTE_FOR_AUTOMATIC_OPTIMIZATION.md)
+ [SYS\$1INTEGRATION\$1ACTIVITY](r_SYS_INTEGRATION_ACTIVITY.md)
+ [SYS\$1INTEGRATION\$1TABLE\$1ACTIVITY](r_SYS_INTEGRATION_TABLE_ACTIVITY.md)
+ [SYS\$1INTEGRATION\$1TABLE\$1STATE\$1CHANGE](r_SYS_INTEGRATION_TABLE_STATE_CHANGE.md)
+ [SYS\$1LOAD\$1DETAIL](SYS_LOAD_DETAIL.md)
+ [SYS\$1LUDF\$1DETAIL](SYS_LUDF_DETAIL.md)
+ [SYS\$1LOAD\$1ERROR\$1DETAIL](SYS_LOAD_ERROR_DETAIL.md)
+ [SYS\$1LOAD\$1HISTORY](SYS_LOAD_HISTORY.md)
+ [SYS\$1MV\$1REFRESH\$1HISTORY](SYS_MV_REFRESH_HISTORY.md)
+ [SYS\$1MV\$1STATE](SYS_MV_STATE.md)
+ [SYS\$1PROCEDURE\$1CALL](SYS_PROCEDURE_CALL.md)
+ [SYS\$1PROCEDURE\$1MESSAGES](SYS_PROCEDURE_MESSAGES.md)
+ [SYS\$1QUERY\$1DETAIL](SYS_QUERY_DETAIL.md)
+ [SYS\$1QUERY\$1EXPLAIN](SYS_QUERY_EXPLAIN.md)
+ [SYS\$1QUERY\$1HISTORY](SYS_QUERY_HISTORY.md)
+ [SYS\$1QUERY\$1TEXT](SYS_QUERY_TEXT.md)
+ [SYS\$1REDSHIFT\$1TEMPLATE](SYS_REDSHIFT_TEMPLATE.md)
+ [SYS\$1RESTORE\$1LOG](SYS_RESTORE_LOG.md)
+ [SYS\$1RESTORE\$1STATE](SYS_RESTORE_STATE.md)
+ [SYS\$1SCHEMA\$1QUOTA\$1VIOLATIONS](r_SYS_SCHEMA_QUOTA_VIOLATIONS.md)
+ [SYS\$1SERVERLESS\$1USAGE](SYS_SERVERLESS_USAGE.md)
+ [SYS\$1SESSION\$1HISTORY](SYS_SESSION_HISTORY.md)
+ [SYS\$1SPATIAL\$1SIMPLIFY](SYS_SPATIAL_SIMPLIFY.md)
+ [SYS\$1STREAM\$1SCAN\$1ERRORS](r_SYS_STREAM_SCAN_ERRORS.md)
+ [SYS\$1STREAM\$1SCAN\$1STATES](r_SYS_STREAM_SCAN_STATES.md)
+ [SYS\$1TRANSACTION\$1HISTORY](SYS_TRANSACTION_HISTORY.md)
+ [SYS\$1UDF\$1LOG](SYS_UDF_LOG.md)
+ [SYS\$1UNLOAD\$1DETAIL](SYS_UNLOAD_DETAIL.md)
+ [SYS\$1UNLOAD\$1HISTORY](SYS_UNLOAD_HISTORY.md)
+ [SYS\$1USERLOG](SYS_USERLOG.md)
+ [SYS\$1VACUUM\$1HISTORY](SYS_VACUUM_HISTORY.md)

# SYS\$1ANALYZE\$1COMPRESSION\$1HISTORY
<a name="r_SYS_ANALYZE_COMPRESSION_HISTORY"></a>

COPY 또는 ANALYZE COMPRESSION 명령을 수행하는 동안 압축 분석 작업에 대한 세부 정보를 기록합니다.

SYS\$1ANALYZE\$1COMPRESSION\$1HISTORY는 모든 사용자에게 표시됩니다. 수퍼유저는 모든 행을 볼 수 있지만 일반 사용자는 자체 데이터만 볼 수 있습니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="r_SYS_ANALYZE_COMPRESSION_HISTORY-table-columns2"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/r_SYS_ANALYZE_COMPRESSION_HISTORY.html)

## 샘플 쿼리
<a name="r_SYS_ANALYZE_COMPRESSION_HISTORY-sample-queries2"></a>

다음 예에서는 동일한 세션에서 실행된 마지막 COPY 명령으로 `lineitem` 테이블에 대한 압축 분석의 세부 정보를 검사합니다.

```
select transaction_id, table_id, btrim(table_name) as table_name, column_position, old_encoding, new_encoding, mode 
from sys_analyze_compression_history
where transaction_id = (select transaction_id from sys_query_history where query_id = pg_last_copy_id()) order by column_position;
                
 transaction_id  |  table_id   | table_name | column_position |  old_encoding   |  new_encoding   |      mode
-----------------+-------------+------------+-----------------+-----------------+-----------------+-------------
      8196       |   248126    | lineitem   |        0        | mostly32        | mostly32        | ON
      8196       |   248126    | lineitem   |        1        | mostly32        | lzo             | ON
      8196       |   248126    | lineitem   |        2        | lzo             | delta32k        | ON
      8196       |   248126    | lineitem   |        3        | delta           | delta           | ON
      8196       |   248126    | lineitem   |        4        | bytedict        | bytedict        | ON
      8196       |   248126    | lineitem   |        5        | mostly32        | mostly32        | ON
      8196       |   248126    | lineitem   |        6        | delta           | delta           | ON
      8196       |   248126    | lineitem   |        7        | delta           | delta           | ON
      8196       |   248126    | lineitem   |        8        | lzo             | zstd            | ON
      8196       |   248126    | lineitem   |        9        | runlength       | zstd            | ON
      8196       |   248126    | lineitem   |       10        | delta           | lzo             | ON
      8196       |   248126    | lineitem   |       11        | delta           | delta           | ON
      8196       |   248126    | lineitem   |       12        | delta           | delta           | ON
      8196       |   248126    | lineitem   |       13        | bytedict        | zstd            | ON
      8196       |   248126    | lineitem   |       14        | bytedict        | zstd            | ON
      8196       |   248126    | lineitem   |       15        | text255         | zstd            | ON
(16 rows)
```

# SYS\$1ANALYZE\$1HISTORY
<a name="SYS_ANALYZE_HISTORY"></a>

[ANALYZE](https://docs.aws.amazon.com/redshift/latest/dg/r_ANALYZE.html) 작업에 대한 세부 정보를 로깅합니다.

SYS\$1ANALYZE\$1HISTORY는 수퍼유저에게만 표시됩니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_ANALYZE_HISTORY-table-rows"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_ANALYZE_HISTORY.html)

## 샘플 쿼리
<a name="SYS_ANALYZE_HISTORY-sample-queries"></a>

```
 user_id | transaction_id | database_name | schema_name |      table_name     | table_id | is_automatic | Status |         start_time         |          end_time          | rows | modified_rows | analyze_threshold_percent |  last_analyze_time  
---------+----------------+---------------+-------------+---------------------+----------+--------------+--------+----------------------------+----------+-----------------+------+---------------+---------------------------+---------------------
     101 |           8006 |           dev |      public | test_table_562bf8dc |   110427 |            f |   Full | 2023-09-21 18:33:08.504646 | 2023-09-21 18:33:24.296498 |    5 |             5 |                         0 | 2000-01-01 00:00:00
```

# SYS\$1APPLIED\$1MASKING\$1POLICY\$1LOG
<a name="SYS_APPLIED_MASKING_POLICY_LOG"></a>

SYS\$1APPLIED\$1MASKING\$1POLICY\$1LOG를 사용하여 DDM으로 보호되는 관계를 참조하는 쿼리에서 동적 데이터 마스킹 정책의 적용을 추적합니다.

SYS\$1APPLIED\$1MASKING\$1POLICY\$1LOG는 다음 사용자에게 표시됩니다.
+  슈퍼 사용자 
+  `sys:operator` 역할이 있는 사용자 
+  ACCESS SYSTEM TABLE 권한이 있는 사용자 

일반 사용자에게는 0개의 행이 표시됩니다.

참고로 SYS\$1APPLIED\$1MASKING\$1POLICY\$1LOG는 `sys:secadmin` 역할을 가진 사용자에게는 표시되지 않습니다.

동적 데이터 마스킹에 대한 자세한 내용은 [동적 데이터 마스킹](t_ddm.md) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_APPLIED_MASKING_POLICY_LOG-table-rows"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_APPLIED_MASKING_POLICY_LOG.html)

## 샘플 쿼리
<a name="SYS_APPLIED_MASKING_POLICY_LOG-sample-queries"></a>

다음 예에서는 `mask_credit_card_full` 마스킹 정책이 `credit_db.public.credit_cards` 테이블에 연결된 것을 보여줍니다.

```
select policy_name, database_name, relation_name, schema_name, relation_kind 
from sys_applied_masking_policy_log;

policy_name           | database_name | relation_name | schema_name | relation_kind
----------------------+---------------+---------------+-------------+---------------
mask_credit_card_full | credit_db     | credit_cards  | public      | table

(1 row)
```

# SYS\$1AUTOMATIC\$1OPTIMIZATION
<a name="SYS_AUTOMATIC_OPTIMIZATION"></a>

SYS\$1AUTOMATIC\$1OPTIMIZATION을 사용하여 Autonomics라고도 하는 자동 최적화를 위해 Amazon Redshift가 실행하는 작업에 대한 세부 정보를 볼 수 있습니다. 자동 최적화에 대한 자세한 내용은 [자동 데이터베이스 최적화](c_autonomics.md) 섹션을 참조하세요.

SYS\$1AUTO\$1TABLE\$1OPTIMIZATION은 슈퍼유저에게만 표시됩니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_AUTOMATIC_OPTIMIZATION-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_AUTOMATIC_OPTIMIZATION.html)

## 사용 노트
<a name="SYS_AUTOMATIC_OPTIMIZATION-usage-notes"></a>

primary 또는 primary-scale의 컴퓨팅 리소스를 구분하지 않으므로 서버리스 클러스터의 경우 compute\$1type 열이 비어 있습니다. 서버리스 클러스터 컴퓨팅 리소스는 Redshift 처리 장치(RPU) 사용량으로 측정됩니다. 자세한 내용은 [Amazon Redshift Serverless의 컴퓨팅 용량](https://docs.aws.amazon.com/redshift/latest/mgmt/serverless-capacity.html)을 참조하세요.

## 예제
<a name="SYS_AUTOMATIC_OPTIMIZATION-examples"></a>

다음 쿼리는 테이블 155259에서 수행된 자동 최적화를 표시합니다.

```
SELECT pid, trim(task_type) as task_type,
  trim(database) as database,
  trim(status) as status,
  trim(event) as event,
  event_time
from SYS_AUTOMATIC_OPTIMIZATION
WHERE object_ids like '%155259%'
AND status = 'Task completed successfully';

 task_type  |    database    |           status            |   event   |         event_time
------------+----------------+-----------------------------+-----------+----------------------------
 VacuumSort | tpcds_100g_oob | Task completed successfully | Completed | 2025-12-22 07:27:15.943018
```

다음 쿼리는 실행된 모든 자동 "VacuumSort" 최적화를 보여줍니다. "VacuumSort"에 대한 자세한 내용은 [자동 테이블 정렬](t_Reclaiming_storage_space202.md#automatic-table-sort) 섹션을 참조하세요.

```
SELECT trim(task_type) as task_type,
  trim(database) as database,
  trim(object_type) as object_type,
  trim(object_ids) as object_ids,
  trim(status) as status,
  trim(event) as event,
  event_time
from SYS_AUTOMATIC_OPTIMIZATION
WHERE task_type like '%VacuumSort%'
AND status = 'Task completed successfully';

task_type  |    database    | object_type | object_ids |           status            |   event   |         event_time
------------+----------------+-------------+------------+-----------------------------+-----------+----------------------------
 VacuumSort | tpcds_100g_oob | table       | 155301     | Task completed successfully | Completed | 2025-12-22 07:14:00.065391
 VacuumSort | tpcds_100g_oob | table       | 155303     | Task completed successfully | Completed | 2025-12-22 07:14:09.158251
 VacuumSort | tpcds_100g_oob | table       | 155291     | Task completed successfully | Completed | 2025-12-22 07:17:06.61164
 VacuumSort | tpcds_100g_oob | table       | 155293     | Task completed successfully | Completed | 2025-12-22 07:17:37.015069
 VacuumSort | tpcds_100g_oob | table       | 155281     | Task completed successfully | Completed | 2025-12-22 07:18:54.903935
 VacuumSort | tpcds_100g_oob | table       | 155279     | Task completed successfully | Completed | 2025-12-22 07:20:13.960002
 VacuumSort | tpcds_100g_oob | table       | 155271     | Task completed successfully | Completed | 2025-12-22 07:21:26.095549
 VacuumSort | tpcds_100g_oob | table       | 155267     | Task completed successfully | Completed | 2025-12-22 07:22:48.119249
 VacuumSort | tpcds_100g_oob | table       | 155269     | Task completed successfully | Completed | 2025-12-22 07:24:12.010424
 VacuumSort | tpcds_100g_oob | table       | 155263     | Task completed successfully | Completed | 2025-12-22 07:25:35.958388
 VacuumSort | tpcds_100g_oob | table       | 155265     | Task completed successfully | Completed | 2025-12-22 07:26:40.580395
 VacuumSort | tpcds_100g_oob | table       | 155259     | Task completed successfully | Completed | 2025-12-22 07:27:15.943018
(12 rows)
```

# SYS\$1AUTO\$1TABLE\$1OPTIMIZATION
<a name="r_SYS_AUTO_TABLE_OPTIMIZATION"></a>

자동 최적화를 위해 정의된 테이블에 Amazon Redshift에서 수행한 자동화된 작업을 기록합니다.

SYS\$1AUTO\$1TABLE\$1OPTIMIZATION은 슈퍼유저에게만 표시됩니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="r_SYS_AUTO_TABLE_OPTIMIZATION-table-rows"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/r_SYS_AUTO_TABLE_OPTIMIZATION.html)

## 샘플 쿼리
<a name="r_SYS_AUTO_TABLE_OPTIMIZATION-sample-queries"></a>

다음 예에서 결과의 행은 Amazon Redshift에서 수행한 작업을 보여줍니다.

```
SELECT table_id, alter_table_type, status, event_time, alter_from
FROM SYS_AUTO_TABLE_OPTIMIZATION;
                
 table_id |  alter_table_type   |                        status                        |         event_time          |  alter_from
----------+---------------------+------------------------------------------------------+-----------------------------+-----------------
   118082 | sortkey             | Start                                                | 2020-08-22 19:42:20.727049  | 
   118078 | sortkey             | Start                                                | 2020-08-22 19:43:54.728819  | 
   118082 | sortkey             | Start                                                | 2020-08-22 19:42:52.690264  | 
   118072 | sortkey             | Start                                                | 2020-08-22 19:44:14.793572  | 
   118082 | sortkey             | Failed                                               | 2020-08-22 19:42:20.728917  | 
   118078 | sortkey             | Complete                                             | 2020-08-22 19:43:54.792705  |  SORTKEY: None;
   118086 | sortkey             | Complete                                             | 2020-08-22 19:42:00.72635   |  SORTKEY: None;
   118082 | sortkey             | Complete                                             | 2020-08-22 19:43:34.728144  |  SORTKEY: None;
   118072 | sortkey             | Skipped:Retry exceeds the maximum limit for a table. | 2020-08-22 19:44:46.706155  | 
   118086 | sortkey             | Start                                                | 2020-08-22 19:42:00.685255  | 
   118082 | sortkey             | Start                                                | 2020-08-22 19:43:34.69531   | 
   118072 | sortkey             | Start                                                | 2020-08-22 19:44:46.703331  | 
   118082 | sortkey             | Checkpoint: progress 14.755079%                      | 2020-08-22 19:42:52.692828  | 
   118072 | sortkey             | Failed                                               | 2020-08-22 19:44:14.796071  |   
   116723 | sortkey             | Abort:This table is not AUTO.                        | 2020-10-28 05:12:58.479233  | 
   110203 | distkey             | Abort:This table is not AUTO.                        | 2020-10-28 05:45:54.67259   |
```

# SYS\$1CHILD\$1QUERY\$1TEXT
<a name="SYS_CHILD_QUERY_TEXT"></a>

하위 쿼리의 SQL 텍스트를 반환합니다.

## 테이블 열
<a name="r_SYS_CHILD_QUERYTEXT-table-rows"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_CHILD_QUERY_TEXT.html)

## 샘플 쿼리
<a name="r_SYS_CHILD_QUERYTEXT-sample-queries"></a>

다음 예에서 결과의 행은 Amazon Redshift에서 수행한 작업을 보여줍니다.

```
SELECT * from sys_child_query_text where query_id = '34487366' order by child_query_sequence asc, sequence asc;
                
user_id | query_id | child_query_sequence | sequence | text
--------|----------|----------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
100     | 34899339 |   1                  |    0     |  /* RQEV2-aY6ZZ1ZpQK */\nwith venue as (\n    select venueid,\n            venuename,\n            venuestate\n    from venue\n), event as (\n    select eventid,\n            venueid,\n            date    
100     | 34899339 |   1                  |    1     |  id,\n            eventname\n    from event\n    where eventname like '3 Doors Down'\n), users as (\n    select userid\n    from users\n), sales as (\n    select salesid,\n            pricepaid,           
100     | 34899339 |   1                  |    2     |  \n            eventid,\n            buyerid\n    from sales\n)\nselect e.eventname,\n        v.venuename,\n        count(distinct(u.userid)) as unique_customers,\n        sum(s.pricepaid) as total_sal    
100     | 34899339 |   1                  |    3     |  es\nfrom venue as v inner join event e on v.venueid = e.venueid\ninner join sales s on e.eventid = s.eventid inner join users u on s.buyerid = u.userid\ngroup by 1,2\norder by 4 desc limit 100
```

# SYS\$1CONNECTION\$1LOG
<a name="SYS_CONNECTION_LOG"></a>

인증 시도 횟수와 연결 및 차단 정보를 기록합니다.

SYS\$1CONNECTION\$1LOG는 슈퍼 사용자에게만 표시됩니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_CONNECTION_LOG-table-columns2"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_CONNECTION_LOG.html)

## 샘플 쿼리
<a name="SYS_CONNECTION_LOG-sample-queries2"></a>

열려있는 연결 세부 정보를 보려면 다음과 같이 쿼리를 실행합니다.

```
select record_time, user_name, database_name, remote_host, remote_port
from sys_connection_log
where event = 'initiating session'
and session_id not in 
(select session_id from sys_connection_log
where event = 'disconnecting session')
order by 1 desc;

record_time         | user_name   | database_name   | remote_host   | remote_port                      
--------------------+-------------+-----------------+---------------+---------------------------------
2014-11-06 20:30:06 | rdsdb       | dev             | [local]       |                            
2014-11-06 20:29:37 | test001     | test            | 10.49.42.138  | 11111                           
2014-11-05 20:30:29 | rdsdb       | dev             | 10.49.42.138  | 33333                                                 
2014-11-05 20:28:35 | rdsdb       | dev             | [local]       |  
(4 rows)
```

다음은 실패한 인증 시도와 성공한 연결 및 차단을 나타낸 예입니다.

```
select event, record_time, remote_host, user_name
from sys_connection_log order by record_time;            

            event      |         record_time        |  remote_host  | user_name                      
-----------------------+----------------------------+---------------+---------
authentication failure | 2012-10-25 14:41:56.96391  | 10.49.42.138  | john                                              
authenticated          | 2012-10-25 14:42:10.87613  | 10.49.42.138  | john                                              
initiating session     | 2012-10-25 14:42:10.87638  | 10.49.42.138  | john                                              
disconnecting session  | 2012-10-25 14:42:19.95992  | 10.49.42.138  | john                                              
(4 rows)
```

다음 예에서는 ODBC 드라이버의 버전, 클라이언트 시스템의 운영 체제 및 Amazon Redshift 클러스터에 연결하는 데 사용되는 플러그인을 보여줍니다. 이 예에서 사용되는 플러그인은 로그인 이름과 암호를 사용하는 표준 ODBC 드라이버 인증을 위한 것입니다.

```
select driver_version, os_version, plugin_name from sys_connection_log;
                
driver_version                          |  os_version                       | plugin_name
----------------------------------------+-----------------------------------+--------------------
Amazon Redshift ODBC Driver 1.4.15.0001 | Darwin 18.7.0 x86_64              | none
Amazon Redshift ODBC Driver 1.4.15.0001 | Linux 4.15.0-101-generic x86_64   | none
```

다음 예에서는 클라이언트 시스템의 운영 체제 버전, 드라이버 버전 및 프로토콜 버전을 보여줍니다.

```
select os_version, driver_version, protocol_version from sys_connection_log;
                
os_version                      |  driver_version              | protocol_version
--------------------------------+------------------------------+--------------------
Linux 4.15.0-101-generic x86_64 | Redshift JDBC Driver 2.0.0.0 | 2
Linux 4.15.0-101-generic x86_64 | Redshift JDBC Driver 2.0.0.0 | 2 
Linux 4.15.0-101-generic x86_64 | Redshift JDBC Driver 2.0.0.0 | 2
```

# SYS\$1COPY\$1JOB
<a name="SYS_COPY_JOB"></a>

SYS\$1COPY\$1JOB을 사용하여 COPY JOB 명령의 세부 정보를 봅니다.

이 보기에는 생성된 COPY JOB 명령이 포함되어 있습니다.

SYS\$1COPY\$1JOB은 모든 사용자에게 표시됩니다. 수퍼유저는 모든 행을 볼 수 있지만 일반 사용자는 자체 데이터만 볼 수 있습니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_COPY_JOB-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_COPY_JOB.html)

# SYS\$1COPY\$1JOB\$1DETAIL
<a name="SYS_COPY_JOB_DETAIL"></a>

SYS\$1COPY\$1JOB\$1DETAIL을 사용하여 COPY JOB 명령의 세부 정보를 봅니다.

이 보기에는 생성된 COPY JOB 명령이 포함되어 있습니다. COPY JOB이 파일을 로드하려고 하는데 로드하지 못하면 향후 자동 COPY JOB 시도에서 해당 파일을 건너뜁니다.

SYS\$1COPY\$1JOB\$1DETAIL은 모든 사용자에게 표시됩니다. 수퍼유저는 모든 행을 볼 수 있지만 일반 사용자는 자체 데이터만 볼 수 있습니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_COPY_JOB_DETAIL-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_COPY_JOB_DETAIL.html)

다음 예시에서는 수집된 항목에 대해 행 하나를 반환합니다.

```
SELECT * FROM SYS_COPY_JOB_DETAIL WHERE status ilike '%ingested%' limit 1;


user_id | 100
database_name | dev
job_name | many_job_4_3
job_id | 110702
file_location | saral-sqs-system4623202051-0
file_name | frenzy-9/4623202051/file_0_107
file_size | 11302
file_etag | 51b2d78ac5b5aecf4ee6f8374815ad19
modification_time | 2024-07-15 20:43:14
enqueue_time | 2024-07-15 20:44:24
status | Ingested
```

# SYS\$1COPY\$1JOB\$1INFO
<a name="SYS_COPY_JOB_INFO"></a>

SYS\$1COPY\$1JOB\$1INFO를 사용하여 COPY JOB에 대해 로깅된 메시지를 봅니다.

이 뷰에는 실행된 COPY JOB의 오류에 대한 정보가 포함되어 있습니다.

SYS\$1COPY\$1JOB\$1INFO는 모든 사용자에게 표시됩니다. 수퍼유저는 모든 행을 볼 수 있지만 일반 사용자는 자체 데이터만 볼 수 있습니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_COPY_JOB_INFO-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_COPY_JOB_INFO.html)

# SYS\$1COPY\$1REPLACEMENTS
<a name="SYS_COPY_REPLACEMENTS"></a>

ACCEPTINVCHARS 옵션과 함께 [COPY](r_COPY.md) 명령을 실행하여 잘못된 UTF-8 문자를 대체했을 때 기록되는 로그를 표시합니다. 적어도 1개 이상 대체가 필요했던 각 노드 조각에서 첫 번째 100개 행마다 로그 항목이 SYS\$1COPY\$1REPLACEMENTS에 추가됩니다.

이 뷰를 사용하여 서버리스 작업 그룹 및 프로비저닝된 클러스터에 대한 정보를 볼 수 있습니다.

SYS\$1COPY\$1REPLACEMENTS는 모든 사용자에게 표시됩니다. 수퍼유저는 모든 행을 볼 수 있지만 일반 사용자는 자체 데이터만 볼 수 있습니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_COPY_REPLACEMENTS-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_COPY_REPLACEMENTS.html)

## 샘플 쿼리
<a name="SYS_COPY_REPLACEMENTS-sample-queries"></a>

다음은 가장 최근 COPY 작업에서 대체된 파일을 반환하는 예입니다.

```
select query_idp, table_id, file_name, line_number, colname
from sys_copy_replacements
where query = pg_last_copy_id();


 query_id | table_id |   file_name                                           | line_number | column_name
 ---------+----------+-------------------------------------------------------+-------------+--------
    96    |    26    | s3://DOC-EXAMPLE-BUCKET/allusers_pipe.txt             |         123 | city
    96    |    26    | s3://DOC-EXAMPLE-BUCKET/allusers_pipe.txt             |         456 | city
    96    |    26    | s3://DOC-EXAMPLE-BUCKET/allusers_pipe.txt             |         789 | city
    96    |    26    | s3://DOC-EXAMPLE-BUCKET/allusers_pipe.txt             |         012 | city
    96    |    26    | s3://DOC-EXAMPLE-BUCKET/allusers_pipe.txt             |         119 | city
...
```

# SYS\$1DATASHARE\$1CHANGE\$1LOG
<a name="SYS_DATASHARE_CHANGE_LOG"></a>

생산자 클러스터와 소비자 클러스터 모두에서 datashare의 변경 내용을 추적하기 위한 통합 뷰를 기록합니다.

SYS\$1DATASHARE\$1CHANGE\$1LOG는 모든 사용자에게 표시됩니다. 수퍼유저는 모든 행을 볼 수 있지만 일반 사용자는 자체 데이터만 볼 수 있습니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_DATASHARE_CHANGE_LOG-table-rows"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_DATASHARE_CHANGE_LOG.html)

## 샘플 쿼리
<a name="SYS_DATASHARE_CHANGE_LOG-sample-queries"></a>

다음 예에서는 SYS\$1DATASHARE\$1CHANGE\$1LOG 뷰를 보여줍니다.

```
SELECT DISTINCT action
FROM sys_datashare_change_log
WHERE share_object_name LIKE 'tickit%';

         action
 -----------------------
  "ALTER DATASHARE ADD"
```

# SYS\$1DATASHARE\$1CROSS\$1REGION\$1USAGE
<a name="r_SYS_DATASHARE_CROSS_REGION_USAGE"></a>

SYS\$1DATASHARE\$1CROSS\$1REGION\$1USAGE 뷰를 사용하면 교차 리전 데이터 공유 쿼리로 인해 발생한 교차 리전 데이터 전송 사용량을 요약하여 확인할 수 있습니다. SYS\$1DATASHARE\$1CROSS\$1REGION\$1USAGE는 세그먼트 수준에서 세부 정보를 집계합니다.

SYS\$1DATASHARE\$1CROSS\$1REGION\$1USAGE는 수퍼유저에게만 표시됩니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="r_SYS_DATASHARE_CROSS_REGION_USAGE-table-rows"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/r_SYS_DATASHARE_CROSS_REGION_USAGE.html)

## 샘플 쿼리
<a name="r_SYS_DATASHARE_CROSS_REGION_USAGE-sample-queries"></a>

다음 예에서는 SYS\$1DATASHARE\$1CROSS\$1REGION\$1USAGE 뷰를 보여줍니다.

```
SELECT query_id, segment_id, transferred_data, source_region
from sys_datashare_cross_region_usage
where query_id = pg_last_query_id()
order by query_id, segment_id;

  query_id | segment_id | transferred_data | source_region 
-----------+------------+------------------+---------------
    200048 |          2 |          4194304 |    us-west-1  
    200048 |          2 |          4194304 |    us-east-2
```

# SYS\$1DATASHARE\$1USAGE\$1CONSUMER
<a name="SYS_DATASHARE_USAGE_CONSUMER"></a>

datashare의 활동과 사용량을 기록합니다. 이 뷰는 소비자 클러스터에만 관련이 있습니다.

SYS\$1DATASHARE\$1USAGE\$1CONSUMER는 모든 사용자에게 표시됩니다. 수퍼유저는 모든 행을 볼 수 있지만 일반 사용자는 자체 데이터만 볼 수 있습니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_DATASHARE_USAGE_CONSUMER-table-rows"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_DATASHARE_USAGE_CONSUMER.html)

## 샘플 쿼리
<a name="SYS_DATASHARE_USAGE_CONSUMER-sample-queries"></a>

다음 예에서는 SYS\$1DATASHARE\$1USAGE\$1CONSUMER 뷰를 보여줍니다.

```
SELECT request_type, status, trim(error) AS error
FROM sys_datashare_usage_consumer

  request_type  | status | error_message
----------------+--------+---------------
 "GET RELATION" |   0    |
```

# SYS\$1DATASHARE\$1USAGE\$1PRODUCER
<a name="SYS_DATASHARE_USAGE_PRODUCER"></a>

datashare의 활동과 사용량을 기록합니다. 이 뷰는 생산자 클러스터에만 관련이 있습니다.

SYS\$1DATASHARE\$1USAGE\$1PRODUCER는 모든 사용자에게 표시됩니다. 수퍼유저는 모든 행을 볼 수 있지만 일반 사용자는 자체 데이터만 볼 수 있습니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_DATASHARE_USAGE_PRODUCER-table-rows"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_DATASHARE_USAGE_PRODUCER.html)

## 샘플 쿼리
<a name="SYS_DATASHARE_USAGE_PRODUCER-sample-queries"></a>

다음 예에서는 SYS\$1DATASHARE\$1USAGE\$1PRODUCER 뷰를 보여줍니다.

```
SELECT DISTINCT 
FROM sys_datashare_usage_producer 
WHERE object_name LIKE 'tickit%';
   
   request_type
 ------------------   
   "GET RELATION"
```

# SYS\$1EXTERNAL\$1QUERY\$1DETAIL
<a name="SYS_EXTERNAL_QUERY_DETAIL"></a>

SYS\$1EXTERNAL\$1QUERY\$1DETAIL로 세그먼트 수준에서 쿼리에 대한 세부 정보를 봅니다. 각 행은 처리된 행 수, 처리된 바이트 수, Amazon S3에 있는 외부 테이블의 파티션 정보와 같은 세부 정보가 포함된 특정 WLM 쿼리의 세그먼트를 나타냅니다. 이 보기의 각 행은 SYS\$1QUERY\$1DETAIL 보기에도 해당 항목이 있습니다. 단, 이 보기에는 외부 쿼리 처리와 관련된 세부 정보가 있습니다.

SYS\$1EXTERNAL\$1QUERY\$1DETAIL은 모든 사용자에게 표시됩니다. 수퍼유저는 모든 행을 볼 수 있지만 일반 사용자는 자체 데이터만 볼 수 있습니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_EXTERNAL_QUERY_DETAIL-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_EXTERNAL_QUERY_DETAIL.html)

## 샘플 쿼리
<a name="SYS_EXTERNAL_QUERY_DETAIL-sample-queries"></a>

다음 쿼리는 외부 쿼리 세부 정보를 보여줍니다.

```
SELECT query_id,
       segment_id,
       start_time,
       end_time,
       total_partitions,
       qualified_partitions,
       scanned_files,
       returned_rows,
       returned_bytes,
       trim(external_query_text) query_text,
       trim(file_location) file_location
FROM sys_external_query_detail
ORDER BY query_id, start_time DESC
LIMIT 2;
```

샘플 출력은 다음과 같습니다.

```
 query_id | segment_id |         start_time         |          end_time          | total_partitions | qualified_partitions | scanned_files | returned_rows | returned_bytes | query_text | file_location
----------+------------+----------------------------+----------------------------+------------------+----------------------+---------------+---------------+----------------+------------+---------------
   763251 |          0 | 2022-02-15 22:32:23.312448 | 2022-02-15 22:32:24.036023 |                3 |                    3 |             3 |         38203 |        2683414 |            |
   763254 |          0 | 2022-02-15 22:32:40.17103  | 2022-02-15 22:32:40.839313 |                3 |                    3 |             3 |         38203 |        2683414 |            |
```

# SYS\$1EXTERNAL\$1QUERY\$1ERROR
<a name="SYS_EXTERNAL_QUERY_ERROR"></a>

시스템 뷰 SYS\$1EXTERNAL\$1QUERY\$1ERROR를 쿼리하여 적색편이 스펙트럼 스캔 오류에 대한 정보를 얻을 수 있습니다. SYS\$1EXTERNAL\$1QUERY\$1ERROR는 기록된 오류의 샘플을 표시합니다. 기본값은 쿼리당 10개 항목입니다.

SYS\$1EXTERNAL\$1QUERY\$1ERROR는 모든 사용자가 볼 수 있습니다. 수퍼유저는 모든 행을 볼 수 있지만 일반 사용자는 자체 데이터만 볼 수 있습니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_EXTERNAL_QUERY_ERROR-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_EXTERNAL_QUERY_ERROR.html)

## 샘플 쿼리
<a name="SYS_EXTERNAL_QUERY_ERROR-sample-query"></a>

다음 쿼리에서는 데이터 처리 작업이 수행된 행의 목록을 반환합니다.

```
SELECT * FROM sys_external_query_error;
```

쿼리는 다음과 비슷한 결과를 반환합니다.

```
   user_id   query_id  file_location                                rowid    column_name           original_value             modified_value       trigger          action               action_value                 error_code
     100     1574007   s3://spectrum-uddh/league/spi_global_rankings.0:0     league_name           Barclays Premier League    Barclays Premier Lea UNSPECIFIED      TRUNCATE                                          156
     100     1574007   s3://spectrum-uddh/league/spi_global_rankings.0:0     league_nspi           34595                      32767                UNSPECIFIED      OVERFLOW_VALUE                                    199
     100     1574007   s3://spectrum-uddh/league/spi_global_rankings.0:1     league_nspi           34151                      32767                UNSPECIFIED      OVERFLOW_VALUE                                    199
     100     1574007   s3://spectrum-uddh/league/spi_global_rankings.0:2     league_name           Barclays Premier League    Barclays Premier Lea UNSPECIFIED      TRUNCATE                                          156
     100     1574007   s3://spectrum-uddh/league/spi_global_rankings.0:2     league_nspi           33223                      32767                UNSPECIFIED      OVERFLOW_VALUE                                    199
     100     1574007   s3://spectrum-uddh/league/spi_global_rankings.0:3     league_name           Barclays Premier League    Barclays Premier Lea UNSPECIFIED      TRUNCATE                                          156
     100     1574007   s3://spectrum-uddh/league/spi_global_rankings.0:3     league_nspi           32808                      32767                UNSPECIFIED      OVERFLOW_VALUE                                    199
     100     1574007   s3://spectrum-uddh/league/spi_global_rankings.0:4     league_nspi           32790                      32767                UNSPECIFIED      OVERFLOW_VALUE                                    199
     100     1574007   s3://spectrum-uddh/league/spi_global_rankings.0:5     league_name           Spanish Primera Division   Spanish Primera Divi UNSPECIFIED      TRUNCATE                                          156
     100     1574007   s3://spectrum-uddh/league/spi_global_rankings.0:6     league_name           Spanish Primera Division   Spanish Primera Divi UNSPECIFIED      TRUNCATE                                          156
```

# SYS\$1EXTRA\$1COMPUTE\$1FOR\$1AUTOMATIC\$1OPTIMIZATION
<a name="SYS_EXTRA_COMPUTE_FOR_AUTOMATIC_OPTIMIZATION"></a>

SYS\$1EXTRA\$1COMPUTE\$1FOR\$1AUTOMATIC\$1OPTIMIZATION을 사용하여 Amazon Redshift가 추가 컴퓨팅 리소스를 사용하여 자동 최적화 작업을 실행한 사용 기간을 확인합니다. 자동 최적화에 대한 자세한 내용은 [자동 데이터베이스 최적화](c_autonomics.md) 섹션을 참조하세요. 추가 컴퓨팅 리소스를 사용하여 실행되는 자동 최적화에 대한 자세한 내용은 [자동 데이터베이스 최적화를 위한 추가 컴퓨팅 리소스 할당](t_extra-compute-autonomics.md) 섹션을 참조하세요.

SYS\$1EXTRA\$1COMPUTE\$1FOR\$1AUTOMATIC\$1OPTIMIZATION은 프로비저닝된 클러스터에만 사용할 수 있습니다.

SYS\$1EXTRA\$1COMPUTE\$1FOR\$1AUTOMATIC\$1OPTIMIZATION은 슈퍼유저에게만 표시됩니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_EXTRA_COMPUTE_FOR_AUTOMATIC_OPTIMIZATION-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_EXTRA_COMPUTE_FOR_AUTOMATIC_OPTIMIZATION.html)

## 예제
<a name="SYS_EXTRA_COMPUTE_FOR_AUTOMATIC_OPTIMIZATION-examples"></a>

다음은 2025년 9월 16일에 수행된 자동 최적화를 찾는 쿼리의 예입니다.

```
SELECT *
FROM sys_extra_compute_for_automatic_optimization
WHERE start_time BETWEEN '2025-09-16 00:00:00' AND '2025-09-16 23:59:59';

start_time           | end_time            | query_count | compute_seconds
---------------------+---------------------+-------------+-----------------
 2025-09-16 00:00:00  | 2025-09-16 00:00:59 | 1           | 59
 2025-09-16 00:01:05  | 2025-09-16 00:01:58 | 2           | 53
```

# SYS\$1INTEGRATION\$1ACTIVITY
<a name="r_SYS_INTEGRATION_ACTIVITY"></a>

SYS\$1INTEGRATION\$1ACTIVITY는 완료된 통합 실행에 대한 세부 정보를 표시합니다.

SYS\$1INTEGRATION\$1ACTIVITY는 슈퍼 사용자에게만 표시됩니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

제로 ETL 통합에 대한 자세한 내용은 Amazon Redshift 관리 안내서의 [제로 ETL 통합 작업](https://docs.aws.amazon.com//redshift/latest/mgmt/zero-etl-using.html)을 참조하세요.

## 테이블 열
<a name="r_SYS_INTEGRATION_ACTIVITY-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/r_SYS_INTEGRATION_ACTIVITY.html)

## 샘플 쿼리
<a name="r_SYS_INTEGRATION_ACTIVITY-sample-queries"></a>

다음 SQL 명령은 통합 로그를 표시합니다.

```
select * from sys_integration_activity;

          integration_id              | target_database | source |            checkpoint_name                  | checkpoint_type  | checkpoint_bytes | last_commit_timestamp   | modified_tables |   integration_start_time   |    integration_end_time
--------------------------------------+-----------------+--------+---------------------------------------------+------------------+------------------+-------------------------+-----------------+----------------------------+----------------------------
 76b15917-afae-4447-b7fd-08e2a5acce7b |   demo1         | MySQL  | checkpoints/checkpoint_3_241_3_510.json     |        cdc       |        762       | 2023-05-10 23:00:14.201 |         1       | 2023-05-10 23:00:45.054265 | 2023-05-10 23:00:46.339826
 76b15917-afae-4447-b7fd-08e2a5acce7b |   demo1         | MySQL  | checkpoints/checkpoint_3_16329_3_17839.json |        cdc       |       13488      | 2023-05-11 01:33:57.411 |         2       | 2023-05-11 02:19:09.440121 | 2023-05-11 02:19:16.090492
 76b15917-afae-4447-b7fd-08e2a5acce7b |   demo1         | MySQL  | checkpoints/checkpoint_3_5103_3_5532.json   |        cdc       |        1657      | 2023-05-10 23:13:14.205 |         2       | 2023-05-10 23:13:23.545487 | 2023-05-10 23:13:25.652144
```

# SYS\$1INTEGRATION\$1TABLE\$1ACTIVITY
<a name="r_SYS_INTEGRATION_TABLE_ACTIVITY"></a>

SYS\$1INTEGRATION\$1TABLE\$1ACTIVITY는 제로 ETL 통합의 삽입, 삭제 및 업데이트 활동에 대한 세부 정보를 표시합니다. 완료된 수집마다 행이 하나씩 추가됩니다.

슈퍼 사용자는 이 테이블의 모든 행을 볼 수 있습니다.

자세한 내용은 [제로 ETL 통합](https://docs.aws.amazon.com//redshift/latest/mgmt/zero-etl-using.html)을 참조하세요.

## 테이블 열
<a name="r_SYS_INTEGRATION_TABLE_ACTIVITY-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/r_SYS_INTEGRATION_TABLE_ACTIVITY.html)

## 샘플 쿼리
<a name="r_SYS_INTEGRATION_TABLE_ACTIVITY-sample-queries"></a>

다음 SQL 명령은 통합의 활동을 표시합니다.

```
select * from sys_integration_table_activity;

          integration_id              | checkpoint_name | target_database | schema_name |     table_name    | table_id     | record_time                | transaction_id  | inserted_rows  | deleted_rows | updated_rows | bytes_ingested 
--------------------------------------+-----------------+-----------------+-------------+-------------------+--------------+----------------------------+-----------------+----------------+--------------+--------------+---------------
 4798e675-8f9f-4686-b05f-92c538e19629 |                 | sample_test2    |    sample   | SampleTestChannel |  111276      | 2023-05-12 12:40:30.656625 | 7736            |  2             | 0            | 0            | 125
```

# SYS\$1INTEGRATION\$1TABLE\$1STATE\$1CHANGE
<a name="r_SYS_INTEGRATION_TABLE_STATE_CHANGE"></a>

SYS\$1INTEGRATION\$1TABLE\$1STATE\$1CHANGE는 통합에 대한 테이블 상태 변경 로그를 자세히 표시합니다.

슈퍼 사용자는 이 테이블의 모든 행을 볼 수 있습니다.

자세한 내용은 [제로 ETL 통합 작업](https://docs.aws.amazon.com//redshift/latest/mgmt/zero-etl-using.html)을 참조하세요.

## 테이블 열
<a name="r_SYS_INTEGRATION_TABLE_STATE_CHANGE-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/r_SYS_INTEGRATION_TABLE_STATE_CHANGE.html)

## 샘플 쿼리
<a name="r_SYS_INTEGRATION_TABLE_STATE_CHANGE-sample-queries"></a>

다음 SQL 명령은 통합 로그를 표시합니다.

```
select * from sys_integration_table_state_change;
                
            integration_id            | database_name | schema_name | table_name | new_state |  table_last_replicated_checkpoint   | state_change_reason |        record_time
--------------------------------------+---------------+-------------+------------+-----------+-------------------------------------+---------------------+----------------------------
 99108e72-1cfd-414f-8cc0-0216acefac77 | perfdb        | sbtest80t3s | sbtest79   | Synced    | {"txn_seq":9834,"txn_id":126597515} |                     | 2023-09-20 19:39:50.087868
 99108e72-1cfd-414f-8cc0-0216acefac77 | perfdb        | sbtest80t3s | sbtest56   | Synced    | {"txn_seq":9834,"txn_id":126597515} |                     | 2023-09-20 19:39:45.54005
 99108e72-1cfd-414f-8cc0-0216acefac77 | perfdb        | sbtest80t3s | sbtest50   | Synced    | {"txn_seq":9834,"txn_id":126597515} |                     | 2023-09-20 19:40:20.362504
 99108e72-1cfd-414f-8cc0-0216acefac77 | perfdb        | sbtest80t3s | sbtest18   | Synced    | {"txn_seq":9834,"txn_id":126597515} |                     | 2023-09-20 19:40:32.544084
 99108e72-1cfd-414f-8cc0-0216acefac77 | perfdb        | sbtest40t3s | sbtest23   | Synced    | {"txn_seq":9834,"txn_id":126597515} |                     | 2023-09-20 15:49:05.186209
```

# SYS\$1LOAD\$1DETAIL
<a name="SYS_LOAD_DETAIL"></a>

데이터 로드를 추적하거나 문제를 해결하기 위한 정보를 반환합니다.

이 뷰는 데이터베이스 테이블에 로드되는 각 데이터 파일의 진행 상황을 기록합니다.

이 뷰는 모든 사용자에게 표시됩니다. 수퍼유저는 모든 행을 볼 수 있지만 일반 사용자는 자체 데이터만 볼 수 있습니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_LOAD_DETAIL-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_LOAD_DETAIL.html)

## 샘플 쿼리
<a name="SYS_LOAD_DETAIL-sample-queries"></a>

다음은 마지막 COPY 작업의 세부 정보를 반환하는 예입니다.

```
select query_id, trim(file_name) as file, record_time
from sys_load_detail
where query_id = pg_last_copy_id();

 query_id |               file               |          record_time        
----------+----------------------------------+----------------------------
 28554    | s3://dw-tickit/category_pipe.txt | 2013-11-01 17:14:52.648486 
(1 row)
```

다음은 TICKIT 데이터베이스에 새로운 테이블 로드 항목을 저장하는 쿼리입니다.

```
select query_id, trim(file_name), record_time
from sys_load_detail
where file_name like '%tickit%' order by query_id;

 query_id |           btrim          |          record_time          
----------+--------------------------+----------------------------
 22475    | tickit/allusers_pipe.txt | 2013-02-08 20:58:23.274186 
 22478    | tickit/venue_pipe.txt    | 2013-02-08 20:58:25.070604  
 22480    | tickit/category_pipe.txt | 2013-02-08 20:58:27.333472 
 22482    | tickit/date2008_pipe.txt | 2013-02-08 20:58:28.608305  
 22485    | tickit/allevents_pipe.txt| 2013-02-08 20:58:29.99489    
 22487    | tickit/listings_pipe.txt | 2013-02-08 20:58:37.632939 
 22593    | tickit/allusers_pipe.txt | 2013-02-08 21:04:08.400491  
 22596    | tickit/venue_pipe.txt    | 2013-02-08 21:04:10.056055  
 22598    | tickit/category_pipe.txt | 2013-02-08 21:04:11.465049  
 22600    | tickit/date2008_pipe.txt | 2013-02-08 21:04:12.461502  
 22603    | tickit/allevents_pipe.txt| 2013-02-08 21:04:14.785124  
 22605    | tickit/listings_pipe.txt | 2013-02-08 21:04:20.170594  

(12 rows)
```

레코드가 이 시스템 뷰의 로그 파일에 작성된다고 해서 저장 트랜잭션(containing transaction)에서 로드가 성공적으로 커밋되었다는 것을 의미하지는 않습니다. 로드 커밋 여부를 확인하려면 STL\$1UTILITYTEXT 뷰에 대한 쿼리를 실행하여 COPY 트랜잭션과 일치하는 COMMIT 레코드를 찾습니다. 예를 들어 다음 쿼리는 STL\$1UTILITYTEXT에 대한 하위 쿼리를 기준으로 SYS\$1LOAD\$1DETAIL 테이블과 STL\$1QUERY 테이블을 조인합니다.

```
select l.query_id,rtrim(l.file_name),q.transaction_id
from sys_load_detail l, sys_query_text q
where l.query_id=q.query_id
and exists
(select xid from stl_utilitytext where xid=q.transaction_id and rtrim("text")='COMMIT');

 query_id |           rtrim           |  transaction_id
----------+---------------------------+-----------------
 22600    | tickit/date2008_pipe.txt  | 68311
 22480    | tickit/category_pipe.txt  | 68066
  7508    | allusers_pipe.txt         | 23365
  7552    | category_pipe.txt         | 23415
  7576    | allevents_pipe.txt        | 23429
  7516    | venue_pipe.txt            | 23390
  7604    | listings_pipe.txt         | 23445
 22596    | tickit/venue_pipe.txt     | 68309
 22605    | tickit/listings_pipe.txt  | 68316
 22593    | tickit/allusers_pipe.txt  | 68305
 22485    | tickit/allevents_pipe.txt | 68071
  7561    | allevents_pipe.txt        | 23429
  7541    | category_pipe.txt         | 23415
  7558    | date2008_pipe.txt         | 23428
 22478    | tickit/venue_pipe.txt     | 68065
   526    | date2008_pipe.txt         |  2572
  7466    | allusers_pipe.txt         | 23365
 22482    | tickit/date2008_pipe.txt  | 68067
 22598    | tickit/category_pipe.txt  | 68310
 22603    | tickit/allevents_pipe.txt | 68315
 22475    | tickit/allusers_pipe.txt  | 68061
   547    | date2008_pipe.txt         |  2572
 22487    | tickit/listings_pipe.txt  | 68072
  7531    | venue_pipe.txt            | 23390
  7583    | listings_pipe.txt         | 23445
(25 rows)
```

# SYS\$1LUDF\$1DETAIL
<a name="SYS_LUDF_DETAIL"></a>

SYS\$1LUDF\$1DETAIL은 특정 쿼리에 사용된 Lambda 사용자 정의 함수(LUDF)에 대한 정보와 지표를 기록합니다.

SYS\$1LUDF\$1DETAIL은 수퍼유저에게만 표시됩니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_LUDF_DETAIL-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_LUDF_DETAIL.html)

## 샘플 쿼리
<a name="SYS_LUDF_DETAIL-sample-queries"></a>

다음 예제에서는 쿼리에서 Lambda UDF를 사용한 다음 SYS\$1LUDF\$1DETAIL 뷰를 쿼리하여 함수 실행 세부 정보를 보는 방법을 보여줍니다.

```
SET SESSION AUTHORIZATION regular_user;

CREATE EXTERNAL FUNCTION exfunc_sum(INT,INT) RETURNS INT STABLE
LAMBDA 'lambda_sum'
IAM_ROLE 'arn:aws:iam::123456789012:role/Redshift-Exfunc-Test';

CREATE TABLE t_sum(c1 int, c2 int);
INSERT INTO t_sum VALUES (4,5), (6,7);
SELECT exfunc_sum(c1,c2) FROM t_sum;

-- Switch to super user in order to inspect records in the LUDF SYS view.
SET SESSION AUTHORIZATION super_user;
select * from sys_ludf_detail;
```

샘플 출력은 다음과 같습니다.

```
 user_id | transaction_id | query_id | function_oid | function_position | stream_id | segment_id | step_id | lambda_function_name |         start_time         |          end_time          | total_duration | invocations | total_rows | input_bytes | output_bytes
---------+----------------+----------+--------------+-------------------+-----------+------------+---------+----------------------+----------------------------+----------------------------+----------------+-------------+------------+-------------+--------------
     100 |           1463 |     1544 |       111055 |                 0 |         0 |          0 |       2 | lambda_sum           | 2026-01-06 17:23:25.165898 | 2026-01-06 17:23:25.165898 |            414 |           1 |          2 |         277 |           18
(1 row)
```

# SYS\$1LOAD\$1ERROR\$1DETAIL
<a name="SYS_LOAD_ERROR_DETAIL"></a>

SYS\$1LOAD\$1ERROR\$1DETAIL을 사용하여 COPY 명령 오류의 세부 정보를 봅니다. 각 행은 COPY 명령을 나타냅니다. 여기에는 실행 중인 COPY 명령과 완료된 COPY 명령이 모두 포함됩니다.

SYS\$1LOAD\$1ERROR\$1DETAIL은 모든 사용자에게 표시됩니다. 수퍼유저는 모든 행을 볼 수 있지만 일반 사용자는 자체 데이터만 볼 수 있습니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_LOAD_ERROR_DETAIL-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_LOAD_ERROR_DETAIL.html)

## 샘플 쿼리
<a name="SYS_LOAD_ERROR_DETAIL-sample-queries"></a>

다음 쿼리는 특정 쿼리에 대한 copy 명령의 로드 오류 세부 정보를 보여줍니다.

```
SELECT query_id,
       table_id,
       start_time,
       trim(file_name) AS file_name, 
       trim(column_name) AS column_name, 
       trim(column_type) AS column_type, 
       trim(error_message) AS error_message 
FROM sys_load_error_detail 
WHERE query_id = 762949 
ORDER BY start_time 
LIMIT 10;
```

샘플 출력은 다음과 같습니다.

```
 query_id | table_id |         start_time         |               file_name                  | column_name | column_type |                 error_message
----------+----------+----------------------------+------------------------------------------+-------------+-------------+------------------------------------------------
   762949 |   137885 | 2022-02-15 22:14:46.759151 | s3://load-test/copyfail/wrong_format_000 | id          | int4        | Invalid digit, Value 'a', Pos 0, Type: Integer
   762949 |   137885 | 2022-02-15 22:14:46.759151 | s3://load-test/copyfail/wrong_format_001 | id          | int4        | Invalid digit, Value 'a', Pos 0, Type: Integer
```

# SYS\$1LOAD\$1HISTORY
<a name="SYS_LOAD_HISTORY"></a>

SYS\$1LOAD\$1HISTORY를 사용하여 COPY 명령의 세부 정보를 봅니다. 각 행은 일부 필드에 대한 누적 통계가 있는 COPY 명령을 나타냅니다. 여기에는 실행 중인 COPY 명령과 완료된 COPY 명령이 모두 포함됩니다.

SYS\$1LOAD\$1HISTORY는 모든 사용자에게 표시됩니다. 수퍼유저는 모든 행을 볼 수 있지만 일반 사용자는 자체 데이터만 볼 수 있습니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_LOAD_HISTORY-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_LOAD_HISTORY.html)

## 샘플 쿼리
<a name="SYS_LOAD_HISTORY-sample-queries"></a>

다음 쿼리는 특정 copy 명령의 로드된 행, 바이트 수, 테이블 및 데이터 소스를 보여줍니다.

```
SELECT query_id,
       table_name,
       data_source,
       loaded_rows,
       loaded_bytes
FROM sys_load_history
WHERE query_id IN (6389,490791,441663,74374,72297)
ORDER BY query_id,
         data_source DESC;
```

샘플 출력은 다음과 같습니다.

```
 query_id |    table_name    |                               data_source                             | loaded_rows | loaded_bytes
----------+------------------+-----------------------------------------------------------------------+-------------+---------------
     6389 | store_returns    | s3://load-test/data-sources/tpcds/2.8.0/textfile/1T/store_returns/    |   287999764 | 1196240296158
    72297 | web_site         | s3://load-test/data-sources/tpcds/2.8.0/textfile/1T/web_site/         |          54 |         43808
    74374 | ship_mode        | s3://load-test/data-sources/tpcds/2.8.0/textfile/1T/ship_mode/        |          20 |          1320
   441663 | income_band      | s3://load-test/data-sources/tpcds/2.8.0/textfile/1T/income_band/      |          20 |          2152
   490791 | customer_address | s3://load-test/data-sources/tpcds/2.8.0/textfile/1T/customer_address/ |     6000000 |     722924305
```

다음 쿼리는 copy 명령의 로드된 행, 바이트 수, 테이블 및 데이터 소스를 보여줍니다.

```
SELECT query_id,
       table_name,
       data_source,
       loaded_rows,
       loaded_bytes
FROM sys_load_history
ORDER BY query_id DESC
LIMIT 10;
```

샘플 출력은 다음과 같습니다.

```
 query_id |       table_name       |                                 data_source                                 | loaded_rows |  loaded_bytes
----------+------------------------+-----------------------------------------------------------------------------+-------------+-----------------
   491058 | web_site               | s3://load-test/data-sources/tpcds/2.8.0/textfile/1T/web_site/               |          54 |           43808
   490947 | web_sales              | s3://load-test/data-sources/tpcds/2.8.0/textfile/1T/web_sales/              |   720000376 |  22971988122819
   490923 | web_returns            | s3://load-test/data-sources/tpcds/2.8.0/textfile/1T/web_returns/            |    71997522 |     96597496325
   490918 | web_page               | s3://load-test/data-sources/tpcds/2.8.0/textfile/1T/web_page/               |        3000 |            1320
   490907 | warehouse              | s3://load-test/data-sources/tpcds/2.8.0/textfile/1T/warehouse/              |          20 |            1320
   490902 | time_dim               | s3://load-test/data-sources/tpcds/2.8.0/textfile/1T/time_dim/               |       86400 |            1320
   490876 | store_sales            | s3://load-test/data-sources/tpcds/2.8.0/textfile/1T/store_sales/            |  2879987999 | 151666241887933
   490870 | store_returns          | s3://load-test/data-sources/tpcds/2.8.0/textfile/1T/store_returns/          |   287999764 |   1196405607941
   490865 | store                  | s3://load-test/data-sources/tpcds/2.8.0/textfile/1T/store/                  |        1002 |          365507
```

 다음 쿼리는 copy 명령의 일별 로드된 행 및 바이트 수를 보여줍니다.

```
SELECT date_trunc('day',start_time) AS exec_day,
       SUM(loaded_rows) AS loaded_rows,
       SUM(loaded_bytes) AS loaded_bytes
FROM sys_load_history
GROUP BY exec_day
ORDER BY exec_day DESC;
```

샘플 출력은 다음과 같습니다.

```
      exec_day       | loaded_rows |   loaded_bytes
---------------------+-------------+------------------
 2022-01-20 00:00:00 |  6347386005 |  258329473070606
 2022-01-19 00:00:00 | 19042158015 |  775198502204572
 2022-01-18 00:00:00 | 38084316030 | 1550294469446883
 2022-01-17 00:00:00 | 25389544020 | 1033271084791724
 2022-01-16 00:00:00 | 19042158015 |  775222736252792
 2022-01-15 00:00:00 | 19834245387 |  798122849155598
 2022-01-14 00:00:00 | 75376544688 | 3077040926571384
```

# SYS\$1MV\$1REFRESH\$1HISTORY
<a name="SYS_MV_REFRESH_HISTORY"></a>

결과에는 모든 구체화된 뷰의 새로 고침 기록에 대한 정보가 포함됩니다. 결과에는 수동 또는 자동과 같은 새로 고침 유형과 가장 최근의 새로 고침 상태가 포함됩니다.

SYS\$1MV\$1REFRESH\$1HISTORY는 모든 사용자에게 표시됩니다. 수퍼유저는 모든 행을 볼 수 있지만 일반 사용자는 자체 데이터만 볼 수 있습니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_MV_REFRESH_HISTORY-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_MV_REFRESH_HISTORY.html)

## 샘플 쿼리
<a name="SYS_MV_REFRESH_HISTORY-sample-queries"></a>

다음 쿼리는 구체화된 뷰에 대한 새로 고침 기록을 보여줍니다.

```
SELECT user_id, 
     session_id, 
     transaction_id, 
     database_name, 
     schema_name, 
     mv_id, 
     mv_name,
     refresh_type,
     status,
     start_time,
     end_time,
     duration,
     consumer_account,
     consumer_region,
     consumer_namespace
     from sys_mv_refresh_history;
```

이 쿼리는 다음과 같은 샘플 출력을 반환합니다.

```
 user_id | session_id | transaction_id | database_name | schema_name                | mv_id  |  mv_name           |  refresh_type  |  status                                                                                              |  start_time                |  end_time                  |  duration | consumer_account | consumer_region | consumer_namespace
---------+------------+----------------+---------------+----------------------------+--------+--------------------+----------------+------------------------------------------------------------------------------------------------------+----------------------------+----------------------------+-----------+------------------+-----------------+------------------------------------
       1 | 1073815659 |          15066 | dev           | test_stl_mv_refresh_schema | 203762 | mv_incremental     | Manual         | MV was already updated                                                                               | 2023-10-26 15:59:20.952179 | 2023-10-26 15:59:20.952866 |      687 |                  |                 |
       1 | 1073815659 |          15068 | dev           | test_stl_mv_refresh_schema | 203771 | mv_nonincremental  | Manual         | MV was already updated                                                                               | 2023-10-26 15:59:21.008049 | 2023-10-26 15:59:21.008658 |      609 |                  |                 |
       1 | 1073815659 |          15070 | ext_db        | producer_schema            | 203779 | producer_mv        | Manual         | Refresh successfully updated MV incrementally                                                        | 2023-10-26 15:59:21.064252 | 2023-10-26 15:59:21.064885 |      633 | 0123456789       | us-east-1       | 623d8ff2-4391-4381-83d7-177caa6767af
       1 | 1073815659 |          15074 | dev           | test_stl_mv_refresh_schema | 203762 | mv_incremental     | Manual         | Refresh successfully updated MV incrementally                                                        | 2023-10-26 15:59:29.693329 | 2023-10-26 15:59:43.482842 | 13789513 |                  |                 |
       1 | 1073815659 |          15076 | dev           | test_stl_mv_refresh_schema | 203771 | mv_nonincremental  | Manual         | Refresh successfully recomputed MV from scratch                                                      | 2023-10-26 15:59:43.550184 | 2023-10-26 15:59:47.880833 |  4330649 |                  |                 |
       1 | 1073815659 |          15078 | dev           | test_stl_mv_refresh_schema | 203779 | mv_refresh_error   | Manual         | Refresh failed due to an internal error                                                              | 2023-10-26 15:59:47.949052 | 2023-10-26 15:59:52.494681 |  4545629 |                  |                 |
       1 | 1073815659 |          15071 | dev           | test_stl_mv_refresh_schema | 203778 | mv_test            | Manual         | Cascade refresh failed because materialized view test_stl_mv_refresh_schema.child was not refreshed. | 2023-10-26 15:30:21.432252 | 2023-10-26 15:30:21.432252 |      532 |                  |                 |
       1 | 1073815659 |          15071 | dev           | test_stl_mv_refresh_schema | 203761 | child              | Manual         | Refresh failed due to an internal error.                                                             | 2023-10-26 15:30:21.432252 | 2023-10-26 15:30:21.432252 |      532 |                  |                 |
       1 | 1073815659 |          15069 | dev           | test_stl_mv_refresh_schema | 203778 | mv_test            | Manual         | Cascade refresh skipped because materialized view test_stl_mv_refresh_schema.child was not refreshed.| 2023-10-26 15:21:43.550369 | 2023-10-26 15:21:43.550369 |      633
       1 | 1073815659 |          15069 | dev           | test_stl_mv_refresh_schema | 203761 | child              | Manual         | Refresh failed due to an internal error.                                                             | 2023-10-26 15:21:43.550369 | 2023-10-26 15:21:43.550369 |      633
(10 rows)
```

# SYS\$1MV\$1STATE
<a name="SYS_MV_STATE"></a>

결과에는 모든 구체화된 뷰의 상태에 대한 정보가 포함됩니다. 여기에는 기본 테이블 정보, 스키마 속성 및 열 삭제와 같은 최근 이벤트에 대한 정보가 포함됩니다.

SYS\$1MV\$1STATE는 모든 사용자에게 표시됩니다. 수퍼유저는 모든 행을 볼 수 있지만 일반 사용자는 자체 데이터만 볼 수 있습니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_MV_STATE-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_MV_STATE.html)

## 샘플 쿼리
<a name="SYS_MV_STATE-sample-queries"></a>

다음 쿼리는 구체화된 뷰 상태를 보여줍니다.

```
select * from sys_mv_state;
```

이 쿼리는 다음과 같은 샘플 출력을 반환합니다.

```
 user_id | transaction_id | database_name | event_desc                  | start_time                 | base_table_database_name | base_table_schema | base_table_name     |  mv_schema  | mv_name                    | state 
---------+----------------+---------------+-----------------------------+----------------------------+--------------------------+-------------------+---------------------+-------------+----------------------------+--------------
 106     | 12720          | tickit_db     | TRUNCATE                    | 2023-07-26 14:59:12.788268 | tickit_db                | mv_schema         | test_table_95d6d861 | mv_schema   | materialized_view_a1f3f862 | Recompute
 106     | 12724          | tickit_db     | ALTER TABLE ALTER DISTSTYLE | 2023-07-26 14:59:51.409014 | tickit_db                | mv_schema         | test_table_58102435 | mv_schema   | materialized_view_ca746631 | Recompute
 106     | 12720          | tickit_db     | Column was renamed          | 2023-07-26 14:59:12.822928 | tickit_db                | mv_schema         | test_table_95d6d861 | mv_schema   | materialized_view_5750a8d4 | Unrefreshable
 106     | 12727          | tickit_db     | Table was renamed           | 2023-07-26 15:00:08.051244 | tickit_db                | mv_schema         | test_table_95d6d861 | mv_schema   | materialized_view_5750a8d4 | Unrefreshable
 106     | 12720          | tickit_db     | Column was renamed          | 2023-07-26 14:59:12.857755 | tickit_db                | mv_schema         | test_table_95d6d861 | mv_schema   | materialized_view_5750a8d4 | Unrefreshable
 106     | 12727          | tickit_db     | Table was renamed           | 2023-07-26 15:00:08.051358 | tickit_db                | mv_schema         | test_table_95d6d861 | mv_schema   | materialized_view_5ef0d754 | Unrefreshable
 106     | 12720          | tickit_db     | TRUNCATE                    | 2023-07-26 14:59:12.788159 | tickit_db                | mv_schema         | test_table_95d6d861 | mv_schema   | materialized_view_5750a8d4 | Recompute
 106     | 12720          | tickit_db     | Column was renamed          | 2023-07-26 14:59:12.857799 | tickit_db                | mv_schema         | test_table_95d6d861 | mv_schema   | materialized_view_a1f3f862 | Unrefreshable
 106     | 12720          | tickit_db     | TRUNCATE                    | 2023-07-26 14:59:12.788327 | tickit_db                | mv_schema         | test_table_95d6d861 | mv_schema   | materialized_view_5ef0d754 | Recompute
 106     | 12727          | tickit_db     | ALTER TABLE ALTER SORTKEY   | 2023-07-26 15:00:08.006235 | tickit_db                | mv_schema         | test_table_58102435 | mv_schema   | materialized_view_ca746631 | Recompute
 106     | 12720          | tickit_db     | Column was renamed          | 2023-07-26 14:59:12.82297  | tickit_db                | mv_schema         | test_table_95d6d861 | mv_schema   | materialized_view_a1f3f862 | Unrefreshable
 106     | 12727          | tickit_db     | Table was renamed           | 2023-07-26 15:00:08.051321 | tickit_db                | mv_schema         | test_table_95d6d861 | mv_schema   | materialized_view_a1f3f862 | Unrefreshable
```

# SYS\$1PROCEDURE\$1CALL
<a name="SYS_PROCEDURE_CALL"></a>

SYS\$1PROCEDURE\$1CALL 뷰를 사용하면 시작 시간, 종료 시간, 저장 프로시저 호출의 상태, 중첩된 저장 프로시저 호출의 호출 계층 구조 등 저장 프로시저 호출에 대한 정보를 가져올 수 있습니다. 각 저장 프로시저 호출은 쿼리 ID를 수신합니다.

SYS\$1PROCEDURE\$1CALL은 모든 사용자에게 표시됩니다. 수퍼유저는 모든 행을 볼 수 있지만 일반 사용자는 자체 데이터만 볼 수 있습니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_PROCEDURE_CALL-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_PROCEDURE_CALL.html)

## 샘플 쿼리
<a name="SYS_PROCEDURE_CALL-sample-queries"></a>

다음 쿼리는 중첩된 저장 프로시저 호출의 계층 구조를 반환합니다.

```
select query_id, datediff(seconds, start_time, end_time) as elapsed_time, status, trim(query_text) as call, caller_procedure_query_id from sys_procedure_call;
```

샘플 출력은 다음과 같습니다.

```
 query_id | elapsed_time | status  |                       call                       | caller_procedure_query_id 
----------+--------------+---------+--------------------------------------------------+---------------------------
     3087 |           18 | success | CALL proc_bd906c98c45443ffa165e9552056902d(1)    |          3085
     3085 |           18 | success | CALL proc_bd906c98c45443ffa165e9552056902d_2(1); |                          
(2 rows)
```

# SYS\$1PROCEDURE\$1MESSAGES
<a name="SYS_PROCEDURE_MESSAGES"></a>

SYS\$1PROCEDURE\$1MESSAGES는 모든 사용자에게 표시됩니다. 수퍼유저는 모든 행을 볼 수 있지만 일반 사용자는 자체 데이터만 볼 수 있습니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_PROCEDURE_MESSAGES-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_PROCEDURE_MESSAGES.html)

## 샘플 쿼리
<a name="SYS_PROCEDURE_MESSAGES-sample-queries"></a>

다음 쿼리는 SYS\$1PROCEDURE\$1MESSAGES의 샘플 출력을 보여줍니다.

```
select transaction_id, query_id, record_time, log_level, trim(message), line_number from sys_procedure_messages;
```

```
transaction_id | query_id |        record_time         | log_level |           btrim           | line_number
---------------+----------+----------------------------+-----------+---------------------------+-------------
     25267     |   80562  | 2023-07-17 14:38:31.910136 |   NOTICE  | test_notice_msg_b9f1e749  |     8
     25267     |   80562  | 2023-07-17 14:38:31.910002 |    LOG    |  test_log_msg_833c7420    |     6
     25267     |   80562  | 2023-07-17 14:38:31.910111 |    INFO   |  test_info_msg_651373d9   |     7
     25267     |   80562  | 2023-07-17 14:38:31.910154 |   WARNING | test_warning_msg_831c5747 |     9
(4 rows)
```

# SYS\$1QUERY\$1DETAIL
<a name="SYS_QUERY_DETAIL"></a>

SYS\$1QUERY\$1DETAIL을 사용하여 다양한 지표 수준에서 쿼리에 대한 세부 정보를 봅니다. 각 행은 지정된 지표 수준에서 특정 WLM 쿼리에 대한 세부 정보를 나타냅니다. 이 보기에는 DDL, DML 및 유틸리티 명령(예: 복사 및 언로드)과 같은 다양한 유형의 쿼리가 포함되어 있습니다. 일부 열은 쿼리 유형에 따라 관련이 없을 수 있습니다. 예를 들어, external\$1scanned\$1bytes는 내부 테이블과 관련이 없습니다.

SYS\$1QUERY\$1DETAIL은 모든 사용자에게 표시됩니다. 수퍼유저는 모든 행을 볼 수 있지만 일반 사용자는 자체 데이터만 볼 수 있습니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

**참고**  
실행된 쿼리가 포함된 트랜잭션이 성공적으로 커밋되었는지 확인하려면 시스템 테이블과 `sys_transaction_history` 테이블 간에 조인 작업을 수행해야 합니다. 예제:  

```
SELECT 
    th.transaction_id,
    qd.query_id,
    th.status AS transaction_status
FROM 
    sys_query_detail qd
LEFT JOIN sys_query_history qh ON qd.query_id = qh.query_id
LEFT JOIN sys_transaction_history th on qh.transaction_id = th.transaction_id;
```

## 테이블 열
<a name="SYS_QUERY_DETAIL-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_QUERY_DETAIL.html)

## 사용 노트
<a name="SYS_QUERY_DETAIL-usage-notes"></a>

SYS\$1QUERY\$1DETAIL에는 단계, 스트림, 세그먼트 및 하위 쿼리 수준의 지표가 포함될 수 있습니다. metrics\$1level 열을 참조하는 것 외에도 다음 표에 따라 step\$1id, segment\$1id 및 stream\$1id 필드를 참조하여 지정된 행에 표시되는 지표 수준을 확인할 수 있습니다.

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_QUERY_DETAIL.html)

## 샘플 쿼리
<a name="SYS_QUERY_DETAIL-sample-queries"></a>

다음 예에서는 SYS\$1QUERY\$1DETAIL의 출력을 반환합니다.

다음 쿼리는 단계 이름, input\$1bytes, output\$1bytes, input\$1rows, output\$1rows 등 단계 수준의 쿼리 메타데이터 세부 정보를 보여줍니다.

```
SELECT query_id,
       child_query_sequence,
       stream_id,
       segment_id,
       step_id,
       trim(step_name) AS step_name,
       duration,
       input_bytes,
       output_bytes,
       input_rows,
       output_rows
FROM sys_query_detail
WHERE query_id IN (193929)
ORDER BY query_id,
         stream_id,
         segment_id,
         step_id DESC;
```

샘플 출력은 다음과 같습니다.

```
 query_id | child_query_sequence | stream_id | segment_id | step_id | step_name  |    duration     | input_bytes | output_bytes | input_rows | output_rows
----------+----------------------+-----------+------------+---------+------------+-----------------+-------------+--------------+------------+-------------
   193929 |                    2 |         0 |          0 |       3 | hash       |           37144 |           0 |      9350272 |          0 |      292196
   193929 |                    5 |         0 |          0 |       3 | hash       |            9492 |           0 |        23360 |          0 |        1460
   193929 |                    1 |         0 |          0 |       3 | hash       |           46809 |           0 |      9350272 |          0 |      292196
   193929 |                    4 |         0 |          0 |       2 | return     |            7685 |           0 |          896 |          0 |         112
   193929 |                    1 |         0 |          0 |       2 | project    |           46809 |           0 |            0 |          0 |      292196
   193929 |                    2 |         0 |          0 |       2 | project    |           37144 |           0 |            0 |          0 |      292196
   193929 |                    5 |         0 |          0 |       2 | project    |            9492 |           0 |            0 |          0 |        1460
   193929 |                    3 |         0 |          0 |       2 | return     |           11033 |           0 |        14336 |          0 |         112
   193929 |                    2 |         0 |          0 |       1 | project    |           37144 |           0 |            0 |          0 |      292196
   193929 |                    1 |         0 |          0 |       1 | project    |           46809 |           0 |            0 |          0 |      292196
   193929 |                    5 |         0 |          0 |       1 | project    |            9492 |           0 |            0 |          0 |        1460
   193929 |                    3 |         0 |          0 |       1 | aggregate  |           11033 |           0 |       201488 |          0 |          14
   193929 |                    4 |         0 |          0 |       1 | aggregate  |            7685 |           0 |        28784 |          0 |          14
   193929 |                    5 |         0 |          0 |       0 | scan       |            9492 |           0 |        23360 |     292196 |        1460
   193929 |                    4 |         0 |          0 |       0 | scan       |            7685 |           0 |         1344 |        112 |         112
   193929 |                    2 |         0 |          0 |       0 | scan       |           37144 |           0 |      7304900 |     292196 |      292196
   193929 |                    3 |         0 |          0 |       0 | scan       |           11033 |           0 |        13440 |        112 |         112
   193929 |                    1 |         0 |          0 |       0 | scan       |           46809 |           0 |      7304900 |     292196 |      292196
   193929 |                    5 |         0 |          0 |      -1 |            |            9492 |       12288 |            0 |          0 |           0
   193929 |                    1 |         0 |          0 |      -1 |            |           46809 |       16384 |            0 |          0 |           0
   193929 |                    2 |         0 |          0 |      -1 |            |           37144 |       16384 |            0 |          0 |           0
   193929 |                    4 |         0 |          0 |      -1 |            |            7685 |       28672 |            0 |          0 |           0
   193929 |                    3 |         0 |          0 |      -1 |            |           11033 |      114688 |            0 |          0 |           0
```

데이터베이스의 테이블을 가장 많이 사용된 것부터 가장 적게 사용된 것까지 순서대로 보려면 다음 예제를 사용하세요. *sample\$1data\$1dev*를 사용자 데이터베이스로 바꿉니다. 이 쿼리는 클러스터가 생성된 시점부터 쿼리를 계산하지만, 데이터 웨어하우스에 공간이 부족한 경우 시스템 뷰 데이터는 저장되지 않습니다.

```
SELECT table_name, COUNT (DISTINCT query_id) 
FROM SYS_QUERY_DETAIL 
WHERE table_name LIKE 'sample_data_dev%'
GROUP BY table_name
ORDER BY COUNT(*) DESC;

+---------------------------------+-------+
|           table_name            | count |
+---------------------------------+-------+
| sample_data_dev.tickit.venue    |     4 |
| sample_data_dev.myunload1.venue |     3 |
| sample_data_dev.tickit.listing  |     1 |
| sample_data_dev.tickit.category |     1 |
| sample_data_dev.tickit.users    |     1 |
| sample_data_dev.tickit.date     |     1 |
| sample_data_dev.tickit.sales    |     1 |
| sample_data_dev.tickit.event    |     1 |
+---------------------------------+-------+
```

 다음 예시에서는 단일 WLM 쿼리에 대한 다양한 지표 수준을 보여줍니다.

```
SELECT query_id, child_query_sequence, stream_id, segment_id, step_id, step_name, start_time, end_time, metrics_level 
FROM sys_query_detail 
WHERE query_id = 1553 AND step_id = -1 
ORDER BY stream_id, segment_id, step_id;

 query_id | child_query_sequence | stream_id | segment_id | step_id | step_name |         start_time         |          end_time          | metrics_level 
----------+----------------------+-----------+------------+---------+-----------+----------------------------+----------------------------+---------------
     1553 |                    1 |        -1 |         -1 |      -1 |           | 2024-10-17 02:28:49.814721 | 2024-10-17 02:28:49.847838 | child query
     1553 |                    1 |         0 |         -1 |      -1 |           | 2024-10-17 02:28:49.814721 | 2024-10-17 02:28:49.835609 | stream
     1553 |                    1 |         0 |          0 |      -1 |           | 2024-10-17 02:28:49.824677 | 2024-10-17 02:28:49.830372 | segment
     1553 |                    1 |         1 |         -1 |      -1 |           | 2024-10-17 02:28:49.835624 | 2024-10-17 02:28:49.845773 | stream
     1553 |                    1 |         1 |          1 |      -1 |           | 2024-10-17 02:28:49.84088  | 2024-10-17 02:28:49.842388 | segment
     1553 |                    1 |         1 |          2 |      -1 |           | 2024-10-17 02:28:49.835926 | 2024-10-17 02:28:49.844396 | segment
     1553 |                    1 |         2 |         -1 |      -1 |           | 2024-10-17 02:28:49.846949 | 2024-10-17 02:28:49.847838 | stream
     1553 |                    1 |         2 |          3 |      -1 |           | 2024-10-17 02:28:49.847013 | 2024-10-17 02:28:49.847485 | segment
(8 rows)
```

# SYS\$1QUERY\$1EXPLAIN
<a name="SYS_QUERY_EXPLAIN"></a>

실행을 목적으로 제출된 쿼리의 EXPLAIN 계획을 표시합니다.

SYS\$1QUERY\$1EXPLAIN은 모든 사용자에게 표시됩니다. 수퍼유저는 모든 행을 볼 수 있지만 일반 사용자는 자체 데이터만 볼 수 있습니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_QUERY_EXPLAIN-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_QUERY_EXPLAIN.html)

## 샘플 쿼리
<a name="SYS_QUERY_EXPLAIN-sample-queries"></a>

다음 예시는 단일 쿼리의 EXPLAIN 계획입니다.

```
SELECT * FROM sys_query_explain WHERE query_id = 612635 ORDER BY plan_node_id;

 userid | query_id | child_query_sequence | plan_node_id | plan_parent_id |                                                                                                                                                                                                    plan_node                                                                                                                                                                                                     |                                                                                                                                                                                                    plan_info                                                                                                                                                                                                     
--------+----------+----------------------+--------------+----------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    100 |   612635 |                    1 |            1 |              0 | XN Limit  (cost=3604047533041.00..3604047533041.25 rows=100 width=20)                                                                                                                                                                                                                                                                                                                                            |                                                                                                                                                                                                                                                                                                                                                                                                                 
    100 |   612635 |                    1 |            2 |              1 |   ->  XN Merge  (cost=3604047533041.00..3604047533148.02 rows=42809 width=20)                                                                                                                                                                                                                                                                                                                                    | Merge Key: sum(b.totalprice)                                                                                                                                                                                                                                                                                                                                                                                    
    100 |   612635 |                    1 |            3 |              2 |         ->  XN Network  (cost=3604047533041.00..3604047533148.02 rows=42809 width=20)                                                                                                                                                                                                                                                                                                                            |   Send to leader                                                                                                                                                                                                                                                                                                                                                                                                
    100 |   612635 |                    1 |            4 |              3 |               ->  XN Sort  (cost=3604047533041.00..3604047533148.02 rows=42809 width=20)                                                                                                                                                                                                                                                                                                                         | Sort Key: sum(b.totalprice)                                                                                                                                                                                                                                                                                                                                                                                     
    100 |   612635 |                    1 |            5 |              4 |                     ->  XN HashAggregate  (cost=2604047529640.76..2604047529747.78 rows=42809 width=20)                                                                                                                                                                                                                                                                                                          |                                                                                                                                                                                                                                                                                                                                                                                                                 
    100 |   612635 |                    1 |            6 |              5 |                           ->  XN Hash Join DS_DIST_NONE  (cost=15104956.16..2602364653507.34 rows=336575226684 width=20)                                                                                                                                                                                                                                                                                         | Hash Cond: (("outer".listid = "inner".listid) AND ("outer".sellerid = "inner".sellerid))                                                                                                                                                                                                                                                                                                                        
    100 |   612635 |                    1 |            7 |              6 |                                 ->  XN Seq Scan on listing b  (cost=0.00..7884677.12 rows=788467712 width=24)                                                                                                                                                                                                                                                                                                    |                                                                                                                                                                                                                                                                                                                                                                                                                 
    100 |   612635 |                    1 |            8 |              6 |                                 ->  XN Hash  (cost=7063797.76..7063797.76 rows=706379776 width=8)                                                                                                                                                                                                                                                                                                                |                                                                                                                                                                                                                                                                                                                                                                                                                 
    100 |   612635 |                    1 |            9 |              8 |                                       ->  XN Seq Scan on sales a  (cost=0.00..7063797.76 rows=706379776 width=8)                                                                                                                                                                                                                                                                                                 |                                                                                                                                                                                                                                                                                                                                                                                                                 
(9 rows)
```

# SYS\$1QUERY\$1HISTORY
<a name="SYS_QUERY_HISTORY"></a>

SYS\$1QUERY\$1HISTORY를 사용하여 사용자 쿼리의 세부 정보를 봅니다. 각 행은 일부 필드에 대한 누적 통계가 있는 사용자 쿼리를 나타냅니다. 이 보기에는 데이터 정의 언어(DDL), 데이터 조작 언어(DML), 복사, 언로드 및 Amazon Redshift Spectrum과 같은 다양한 유형의 쿼리가 포함되어 있습니다. 여기에는 실행 중인 쿼리와 완료된 쿼리가 모두 포함됩니다.

SYS\$1QUERY\$1HISTORY는 모든 사용자에게 표시됩니다. 수퍼유저는 모든 행을 볼 수 있지만 일반 사용자는 자체 데이터만 볼 수 있습니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

**참고**  
실행된 쿼리가 포함된 트랜잭션이 성공적으로 커밋되었는지 확인하려면 시스템 테이블과 `sys_transaction_history` 테이블 간에 조인 작업을 수행해야 합니다. 예제:  

```
SELECT 
    qh.transaction_id,
    qh.query_id,
    qh.status AS query_status,
    qh.query_type,
    TRIM(qh.query_text) AS query_text,
    th.status AS transaction_status
FROM 
    sys_query_history qh
LEFT JOIN 
    sys_transaction_history th ON qh.transaction_id = th.transaction_id;
```

## 테이블 열
<a name="SYS_QUERY_HISTORY-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_QUERY_HISTORY.html)

## 샘플 쿼리
<a name="SYS_QUERY_HISTORY-sample-queries"></a>

다음 쿼리는 실행 중인 쿼리와 대기 중인 쿼리를 반환합니다.

```
SELECT user_id,
       query_id,
       transaction_id,
       session_id,
       status,
       trim(database_name) AS database_name,
       start_time,
       end_time,
       result_cache_hit,
       elapsed_time,
       queue_time,
       execution_time
FROM sys_query_history
WHERE status IN ('running','queued')
ORDER BY start_time;
```

샘플 출력은 다음과 같습니다.

```
 user_id | query_id | transaction_id | session_id | status  | database_name |        start_time         |          end_time          | result_cache_hit | elapsed_time | queue_time | execution_time
---------+----------+----------------+------------+---------+---------------+---------------------------+----------------------------+------------------+--------------+------------+----------------
     101 |   760705 |         852337 | 1073832321 | running | tpcds_1t      | 2022-02-15 19:03:19.67849 | 2022-02-15 19:03:19.739811 | f                |        61321 |          0 |              0
```

다음 쿼리는 특정 쿼리의 쿼리 시작 시간, 종료 시간, 대기열 시간, 경과 시간, 계획 시간 및 기타 메타데이터를 반환합니다.

```
SELECT user_id,
       query_id,
       transaction_id,
       session_id,
       status,
       trim(database_name) AS database_name,
       start_time,
       end_time,
       result_cache_hit,
       elapsed_time,
       queue_time,
       execution_time,
       planning_time,
       trim(query_text) as query_text
FROM sys_query_history
WHERE query_id = 3093;
```

샘플 출력은 다음과 같습니다.

```
user_id | query_id | transaction_id | session_id |   status   | database_name |         start_time         |          end_time          | result_cache_hit | elapsed_time | queue_time | execution_time | planning_time | query_text
--------+----------+----------------+------------+------------+---------------+----------------------------+----------------------------+------------------+--------------+------------+----------------+---------------+-------------------------------------
    106 |     3093 |          11759 | 1073750146 | success    | dev           | 2023-03-16 16:53:17.840214 | 2023-03-16 16:53:18.106588 | f                |       266374 |          0 |         105725 |        136589 | select count(*) from item;
```

다음은 가장 최근 SELECT 쿼리 10개를 나열하는 쿼리입니다.

```
SELECT query_id,
       transaction_id,
       session_id,
       start_time,
       elapsed_time,
       queue_time,
       execution_time,
       returned_rows,
       returned_bytes
FROM sys_query_history
WHERE query_type = 'SELECT'
ORDER BY start_time DESC limit 10;
```

샘플 출력은 다음과 같습니다.

```
 query_id | transaction_id | session_id |         start_time         | elapsed_time | queue_time | execution_time | returned_rows | returned_bytes
----------+----------------+------------+----------------------------+--------------+------------+----------------+---------------+----------------
   526532 |          61093 | 1073840313 | 2022-02-09 04:43:24.149603 |       520571 |          0 |         481293 |             1 |           3794
   526520 |          60850 | 1073840313 | 2022-02-09 04:38:27.24875  |       635957 |          0 |         596601 |             1 |           3679
   526508 |          60803 | 1073840313 | 2022-02-09 04:37:51.118835 |       563882 |          0 |         503135 |             5 |          17216
   526505 |          60763 | 1073840313 | 2022-02-09 04:36:48.636224 |       649337 |          0 |         589823 |             1 |            652
   526478 |          60730 | 1073840313 | 2022-02-09 04:36:11.741471 |     14611321 |          0 |       14544058 |             0 |              0
   526467 |          60636 | 1073840313 | 2022-02-09 04:34:11.91463  |     16711367 |          0 |       16633767 |             1 |            575
   511617 |         617946 | 1074009948 | 2022-01-20 06:21:54.44481  |      9937090 |          0 |        9899271 |           100 |          12500
   511603 |         617941 | 1074259415 | 2022-01-20 06:21:45.71744  |      8065081 |          0 |        7582500 |           100 |           8889
   511595 |         617935 | 1074128320 | 2022-01-20 06:21:44.030876 |      1051270 |          0 |        1014879 |             1 |             72
   511584 |         617931 | 1074030019 | 2022-01-20 06:21:42.764088 |       609033 |          0 |         485887 |           100 |           8438
```

 다음 쿼리는 일별 선택 쿼리 수와 평균 쿼리 경과 시간을 보여줍니다.

```
SELECT date_trunc('day',start_time) AS exec_day,
       status,
       COUNT(*) AS query_cnt,
       AVG(datediff (microsecond,start_time,end_time)) AS elapsed_avg
FROM sys_query_history
WHERE query_type = 'SELECT'
AND start_time >= '2022-01-14'
AND start_time <= '2022-01-18'
GROUP BY exec_day,
         status
ORDER BY exec_day,
         status;
```

샘플 출력은 다음과 같습니다.

```
      exec_day       | status  | query_cnt | elapsed_avg
---------------------+---------+-----------+------------
 2022-01-14 00:00:00 | success |      5253 |  56608048
 2022-01-15 00:00:00 | success |      7004 |  56995017
 2022-01-16 00:00:00 | success |      5253 |  57016363
 2022-01-17 00:00:00 | success |      5309 |  55236784
 2022-01-18 00:00:00 | success |      8092 |  54355124
```

다음 쿼리는 일별 쿼리 경과 시간 성능을 보여줍니다.

```
SELECT distinct date_trunc('day',start_time) AS exec_day,
       query_count.cnt AS query_count,
       Percentile_cont(0.5) within group(ORDER BY elapsed_time) OVER (PARTITION BY exec_day) AS P50_runtime,
       Percentile_cont(0.8) within group(ORDER BY elapsed_time) OVER (PARTITION BY exec_day) AS P80_runtime,
       Percentile_cont(0.9) within group(ORDER BY elapsed_time) OVER (PARTITION BY exec_day) AS P90_runtime,
       Percentile_cont(0.99) within group(ORDER BY elapsed_time) OVER (PARTITION BY exec_day) AS P99_runtime,
       Percentile_cont(1.0) within group(ORDER BY elapsed_time) OVER (PARTITION BY exec_day) AS max_runtime
FROM sys_query_history
LEFT JOIN (SELECT  date_trunc('day',start_time) AS day, count(*) cnt
           FROM sys_query_history
           WHERE query_type = 'SELECT'
           GROUP by 1) query_count
ON date_trunc('day',start_time) = query_count.day
WHERE query_type = 'SELECT'
ORDER BY exec_day;
```

샘플 출력은 다음과 같습니다.

```
      exec_day       | query_count | p50_runtime | p80_runtime | p90_runtime | p99_runtime  | max_runtime
---------------------+-------------+-------------+-------------+-------------+--------------+--------------
 2022-01-14 00:00:00 |        5253 |  16816922.0 |  69525096.0 | 158524917.8 | 486322477.52 | 1582078873.0
 2022-01-15 00:00:00 |        7004 |  15896130.5 |  71058707.0 | 164314568.9 | 500331542.07 | 1696344792.0
 2022-01-16 00:00:00 |        5253 |  15750451.0 |  72037082.2 | 159513733.4 | 480372059.24 | 1594793766.0
 2022-01-17 00:00:00 |        5309 |  15394513.0 |  68881393.2 | 160254700.0 | 493372245.84 | 1521758640.0
 2022-01-18 00:00:00 |        8092 |  15575286.5 |  68485955.4 | 154559572.5 | 463552685.39 | 1542783444.0
 2022-01-19 00:00:00 |        5860 |  16648747.0 |  72470482.6 | 166485138.2 | 492038228.67 | 1693483241.0
 2022-01-20 00:00:00 |        1751 |  15422072.0 |  69686381.0 | 162315385.0 | 497066615.00 | 1439319739.0
 2022-02-09 00:00:00 |          13 |   6382812.0 |  17616161.6 |  21197988.4 |  23021343.84 |   23168439.0
```

다음 쿼리는 쿼리 유형 분포를 보여줍니다.

```
SELECT query_type,
       COUNT(*) AS query_count
FROM sys_query_history
GROUP BY query_type
ORDER BY query_count DESC;
```

샘플 출력은 다음과 같습니다.

```
 query_type | query_count
------------+-------------
 UTILITY    |      134486
 SELECT     |       38537
 DDL        |        4832
 OTHER      |         768
 LOAD       |         768
 CTAS       |         748
 COMMAND    |          92
```

다음 예제에서는 여러 쿼리 간의 쿼리 해시 결과의 차이를 보여 줍니다. 다음 쿼리를 관찰합니다.

```
CREATE TABLE test_table (col1 INT);

INSERT INTO test_table VALUES (1),(2);

SELECT * FROM test_table;

SELECT * FROM test_table;

SELECT col1 FROM test_table;

SELECT * FROM test_table WHERE col1=1;

SELECT * FROM test_table WHERE col1=2;

SELECT query_id, TRIM(user_query_hash) AS user_query_hash, TRIM(generic_query_hash) AS generic_query_hash, TRIM(query_text) AS text FROM sys_query_history ORDER BY start_time
DESC LIMIT 10;
```

다음은 출력 샘플입니다.

```
query_id | user_query_hash | generic_query_hash | text
---------+-----------------+--------------------+----------
24723049 | oPuFtjEPLTs=    | oPuFtjEPLTs=       | select query_id, trim(user_query_hash) as user_query_hash, trim(generic_query_hash) as generic_query_hash, query_hash_version, trim(query_text) as text from sys_query_history order by start_time\r\ndesc limit 20
24723045 | Gw2Kwdd8m2I=    | IwfRu8/XAKI=       | select * from test_table where col1=2 limit 100
24723041 | LNw2vx0GDXo=    | IwfRu8/XAKI=       | select * from test_table where col1=1 limit 100
24723036 | H+qep/c82Y8=    | H+qep/c82Y8=       | select col1 from test_table limit 100
24723033 | H+qep/c82Y8=    | H+qep/c82Y8=       | select * from test_table limit 100
24723029 | H+qep/c82Y8=    | H+qep/c82Y8=       | select * from test_table limit 100
24723023 | 50sirx9E1hU=    | uO36Z1a/QYs=       | insert into test_table values (1),(2)
24723021 | YSVnlivZHeo=    | YSVnlivZHeo=       | create table test_table (col1 int)
```

`SELECT * FROM test_table;` 및 `SELECT col1 FROM test_table;`에는 열이 하나뿐이므로 동일한 user\$1query\$1hash 값이 포함됩니다. `SELECT * FROM test_table WHERE col1=1;` 및 `SELECT * FROM test_table WHERE col1=2;`에는 user\$1query\$1hash 값이 다르지만 두 쿼리가 쿼리 리터럴 1과 2 외부에서 동일하므로 generic\$1query\$1hash 값은 동일합니다.

# SYS\$1QUERY\$1TEXT
<a name="SYS_QUERY_TEXT"></a>

SYS\$1QUERY\$1TEXT를 사용하여 모든 쿼리의 쿼리 텍스트를 볼 수 있습니다. 각 행은 시퀀스 번호 0으로 시작하는 최대 4,000자의 쿼리 텍스트를 나타냅니다. 쿼리 명령문이 4,000자를 초과하는 경우 각 행의 시퀀스 번호를 증가시켜 명령문에 대한 추가 행이 로깅됩니다. 이 뷰는 DDL, 유틸리티, Amazon Redshift 쿼리 및 리더 노드 전용 쿼리와 같은 모든 사용자 쿼리 텍스트를 로깅합니다.

SYS\$1QUERY\$1TEXT는 모든 사용자에게 표시됩니다. 수퍼유저는 모든 행을 볼 수 있지만 일반 사용자는 자체 데이터만 볼 수 있습니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_QUERY_TEXT-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_QUERY_TEXT.html)

## 샘플 쿼리
<a name="SYS_QUERY_TEXT-sample-queries"></a>

다음 쿼리는 실행 중인 쿼리와 대기 중인 쿼리를 반환합니다.

```
SELECT user_id, 
 query_id, 
 transaction_id, 
 session_id, start_time, 
 sequence, trim(text) as text from sys_query_text 
 ORDER BY sequence;
```

샘플 출력은 다음과 같습니다.

```
 user_id | query_id | transaction_id | session_id |        start_time          | sequence |                                                        text
--------+----------+-----------------+------------+----------------------------+----------+----------------------------------------------------------------------------------------------------------------------
   100  |     4    |       1396      | 1073750220 | 2023-04-28 16:44:55.887184 |     0    | SELECT trim(text) as text, sequence FROM sys_query_text WHERE query_id = pg_last_query_id() AND user_id > 1 AND start
_time > '2023-04-28 16:44:55.922705+00:00'::timestamp order by sequence;
```

다음 쿼리는 데이터베이스의 그룹에서 부여되거나 해지된 권한을 반환합니다.

```
SELECT 
    SPLIT_PART(text, ' ', 1) as grantrevoke, 
    SPLIT_PART((SUBSTRING(text, STRPOS(UPPER(text), 'GROUP'))), ' ', 2) as group, 
    SPLIT_PART((SUBSTRING(text, STRPOS(UPPER(text), ' '))), 'ON', 1) as type, 
    SPLIT_PART((SUBSTRING(text, STRPOS(UPPER(text), 'ON'))), ' ', 2) || ' ' || SPLIT_PART((SUBSTRING(text, STRPOS(UPPER(text), 'ON'))), ' ', 3) as entity 
FROM SYS_QUERY_TEXT 
WHERE (text LIKE 'GRANT%' OR text LIKE 'REVOKE%') AND text LIKE '%GROUP%';
         
+-------------+----------+--------+----------+
| grantrevoke |  group   |  type  |  entity  |
+-------------+----------+--------+----------+
| GRANT       | bi_group | SELECT | TABLE t1 |
| GRANT       | bi_group | SELECT | TABLE t1 |
| GRANT       | bi_group | SELECT | TABLE t1 |
| GRANT       | bi_group | USAGE  | TABLE t1 |
| GRANT       | bi_group | SELECT | TABLE t1 |
| GRANT       | bi_group | SELECT | TABLE t1 |
+-------------+----------+--------+----------+
```

# SYS\$1REDSHIFT\$1TEMPLATE
<a name="SYS_REDSHIFT_TEMPLATE"></a>

SYS\$1REDSHIFT\$1TEMPLATE를 사용하여 Redshift TEMPLATES의 세부 정보를 봅니다.

이 뷰에는 생성된 TEMPLATES이 포함되어 있습니다.

SYS\$1REDSHIFT\$1TEMPLATE는 모든 사용자에게 표시됩니다. 수퍼유저는 모든 행을 볼 수 있지만 일반 사용자는 자체 데이터만 볼 수 있습니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_REDSHIFT_TEMPLATE-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_REDSHIFT_TEMPLATE.html)

## 샘플 쿼리
<a name="SYS_REDSHIFT_TEMPLATE-sample-queries"></a>

다음 쿼리는 현재 사용자에게 표시되는 모든 템플릿을 반환합니다.

```
SELECT * FROM SYS_REDSHIFT_TEMPLATE;
```

샘플 출력은 다음과 같습니다.

```
 database_name | schema_name |   template_name    | template_type |        create_time         |     last_modified_time     | owner_id | last_modified_by | template_parameters
---------------+-------------+--------------------+---------------+----------------------------+----------------------------+----------+------------------+---------------------
 dev           | s1          | shapefile_template |             1 | 2025-12-17 22:42:02.079758 | 2025-12-17 22:42:02.079758 |      101 |              101 | {
    "SIMPLIFY_AUTO": 0.000001,
    "SHAPEFILE": 1,
    "COMPRESSION_UPDATE": 0
}
 dev           | s2          | orc_template       |             1 | 2025-12-17 22:42:23.582815 | 2025-12-17 22:42:23.582815 |      101 |              101 | {
    "ORC": "serializetojson_default"
}
 dev           | s1          | csv_template       |             1 | 2025-12-17 22:43:01.822361 | 2025-12-17 22:43:01.822361 |      101 |              101 | {
    "ENCRYPTED": 1,
    "CSV": 1,
    "ENCODING": 1,
    "DELIMITER": ","
}
(3 rows)
```

# SYS\$1RESTORE\$1LOG
<a name="SYS_RESTORE_LOG"></a>

RA3 노드로의 클래식 크기 조정 중에 클러스터 내 각 테이블의 마이그레이션 진행 상황을 모니터링하려면 SYS\$1RESTORE\$1LOG를 사용합니다. 이는 크기 조정 작업 중 데이터 마이그레이션의 과거 처리량을 캡처합니다. RA3 노드로의 클래식 크기 조정에 대한 자세한 내용은 [클래식 크기 조정](https://docs.aws.amazon.com/redshift/latest/mgmt/managing-cluster-operations.html#classic-resize-faster)을 참조하세요.

SYS\$1RESTORE\$1LOG는 슈퍼 사용자에게만 표시됩니다.

## 테이블 열
<a name="SYS_RESTORE_LOG-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_RESTORE_LOG.html)

## 샘플 쿼리
<a name="SYS_RESTORE_LOG-sample-queries"></a>

다음 쿼리는 SYS\$1RESTORE\$1LOG를 사용하여 데이터 처리 처리량을 계산합니다.

```
SELECT
    ROUND(sum(delta_data_processed) / 1024.0, 2) as data_processed_gb,
    ROUND(datediff(sec, min(event_time), max(event_time)) / 3600.0, 2) as duration_hr,
    ROUND(data_processed_gb/duration_hr, 2) as throughput_gb_per_hr
from sys_restore_log;
```

샘플 출력은 다음과 같습니다.

```
 data_processed_gb | duration_hr | throughput_gb_per_hr 
-------------------+-------------+----------------------
              0.91 |        8.37 |                 0.11
(1 row)
```

모든 재배포 유형을 보여주는 다음 쿼리입니다.

```
SELECT * from sys_restore_log ORDER BY event_time;
```

```
 database_name |     schema_name      |      table_name      | table_id |          action             | total_data_processed | delta_data_processed |         event_time         | table_size | message |   redistribution_type    
---------------+----------------------+----------------------+----------+-----------------------------+----------------------+----------------------+----------------------------+------------+---------+--------------------------
 dev           | schemaaaa877096d844d | customer_key         |   106424 | Redistribution started      |                    0 |                      | 2024-01-05 02:18:00.744977 |        325 |         | Restore Distkey Table
 dev           | schemaaaa877096d844d | dp30907_t2_autokey   |   106430 | Redistribution started      |                    0 |                      | 2024-01-05 02:18:02.756675 |         90 |         | Restore Distkey Table
 dev           | schemaaaa877096d844d | dp30907_t2_autokey   |   106430 | Redistribution completed    |                   90 |                   90 | 2024-01-05 02:23:30.643718 |         90 |         | Restore Distkey Table
 dev           | schemaaaa877096d844d | customer_key         |   106424 | Redistribution completed    |                  325 |                  325 | 2024-01-05 02:23:45.998249 |        325 |         | Restore Distkey Table
 dev           | schemaaaa877096d844d | dp30907_t1_even      |   106428 | Redistribution started      |                    0 |                      | 2024-01-05 02:23:46.083849 |         30 |         | Rebalance Disteven Table
 dev           | schemaaaa877096d844d | dp30907_t5_auto_even |   106436 | Redistribution started      |                    0 |                      | 2024-01-05 02:23:46.855728 |         45 |         | Rebalance Disteven Table
 dev           | schemaaaa877096d844d | dp30907_t5_auto_even |   106436 | Redistribution completed    |                   45 |                   45 | 2024-01-05 02:24:16.343029 |         45 |         | Rebalance Disteven Table
 dev           | schemaaaa877096d844d | dp30907_t1_even      |   106428 | Redistribution completed    |                   30 |                   30 | 2024-01-05 02:24:20.584703 |         30 |         | Rebalance Disteven Table
 dev           | schemaefd028a2a48a4c | customer_even        |   130512 | Redistribution started      |                    0 |                      | 2024-01-05 04:54:55.641741 |        190 |         | Restore Disteven Table
 dev           | schemaefd028a2a48a4c | customer_even        |   130512 | Redistribution checkpointed |     29.4342113157737 |     29.4342113157737 | 2024-01-05 04:55:04.770696 |        190 |         | Restore Disteven Table
(8 rows)
```

# SYS\$1RESTORE\$1STATE
<a name="SYS_RESTORE_STATE"></a>

클래식 크기 조정 중에 각 테이블의 마이그레이션 진행 상황을 모니터링하려면 SYS\$1RESTORE\$1STATE를 사용합니다. 이는 구체적으로 대상 노드 유형이 RA3일 때 적용됩니다. RA3 노드로의 클래식 크기 조정에 대한 자세한 내용은 [클래식 크기 조정](https://docs.aws.amazon.com/redshift/latest/mgmt/managing-cluster-operations.html#classic-resize-faster)을 참조하세요.

SYS\$1RESTORE\$1STATE는 수퍼유저만 볼 수 있습니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_RESTORE_STATE-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_RESTORE_STATE.html)

## 샘플 쿼리
<a name="SYS_RESTORE_STATE-sample-queries"></a>

다음 쿼리는 실행 중인 쿼리와 대기 중인 쿼리를 반환합니다.

```
SELECT * FROM sys_restore_state;
```

샘플 출력은 다음과 같습니다.

```
 userid | database_name | schema_id | table_id |   table_name   | redistribution_status | precentage_redistributed |   redistribution_type
--------+---------------+-----------+----------+----------------+-----------------------+--------------------------+-------------------------
    1   |     test1     |   124865  |  124878  | customer_key_4 |         Pending       |      0                   |  Rebalance Disteven Table
    1   |      dev      |   124865  |  124874  | customer_key_3 |         Pending       |      0                   |  Rebalance Disteven Table
    1   |      dev      |   124865  |  124870  | customer_key_2 |        Completed      |     100                  |  Rebalance Disteven Table
    1   |      dev      |   124865  |  124866  | customer_key_1 |       In progress     |     13.52                |  Restore Distkey Table
```

다음은 데이터 처리 상태를 보여줍니다.

```
SELECT
    redistribution_status, ROUND(SUM(block_count) / 1024.0, 2) AS total_size_gb
FROM sys_restore_state sys inner join stv_tbl_perm stv
    on sys.table_id = stv.id
GROUP BY sys.redistribution_status;
```

샘플 출력은 다음과 같습니다.

```
 redistribution_status | total_size_gb 
-----------------------+---------------
 Completed             |          0.07
 Pending               |          0.71
 In progress           |          0.20
(3 rows)
```

# SYS\$1SCHEMA\$1QUOTA\$1VIOLATIONS
<a name="r_SYS_SCHEMA_QUOTA_VIOLATIONS"></a>

스키마 할당량을 초과한 경우 발생, 트랜잭션 ID 및 기타 유용한 정보를 기록합니다. 이 시스템 테이블은 [STL\$1SCHEMA\$1QUOTA\$1VIOLATIONS](r_STL_SCHEMA_QUOTA_VIOLATIONS.md)의 변환입니다.

r\$1SYS\$1SCHEMA\$1QUOTA\$1VIOLATIONS는 모든 사용자에게 표시됩니다. 수퍼유저는 모든 행을 볼 수 있지만 일반 사용자는 자체 데이터만 볼 수 있습니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="r_STL_SCHEMA_QUOTA_VIOLATIONS-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/r_SYS_SCHEMA_QUOTA_VIOLATIONS.html)

## 샘플 쿼리
<a name="r_STL_SCHEMA_QUOTA_VIOLATIONS-sample-queries"></a>

다음은 할당량 위반의 결과를 보여 주는 쿼리입니다.

```
SELECT user_id, TRIM(schema_name) "schema_name", quota, disk_usage, record_time FROM
sys_schema_quota_violations WHERE SCHEMA_NAME = 'sales_schema' ORDER BY timestamp DESC;
```

이 쿼리는 지정된 스키마에 대해 다음 샘플 출력을 반환합니다.

```
user_id| schema_name  | quota | disk_usage | record_time
-------+--------------+-------+------------+----------------------------
104    | sales_schema | 2048  | 2798       | 2020-04-20 20:09:25.494723
(1 row)
```

# SYS\$1SERVERLESS\$1USAGE
<a name="SYS_SERVERLESS_USAGE"></a>

SYS\$1SERVERLESS\$1USAGE를 사용하여 리소스의 Amazon Redshift Serverless 사용에 대한 세부 정보를 봅니다. 이 시스템 보기는 프로비저닝된 Amazon Redshift 클러스터에는 적용되지 않습니다.

이 보기에는 쿼리를 처리하는 데 사용되는 컴퓨팅 용량과 1분 단위로 사용되는 Amazon Redshift 관리형 스토리지의 양을 포함한 서버리스 사용량 요약이 포함되어 있습니다. 컴퓨팅 용량은 Redshift 처리 장치(RPU)로 측정되며 실행하는 워크로드에 대해 초당 RPU(초) 단위로 측정됩니다. RPU는 데이터 웨어하우스에 로드되거나, Amazon S3 데이터 레이크에서 쿼리되거나, 연합 쿼리를 사용하여 운영 데이터베이스에서 액세스되는 데이터에 대한 쿼리를 처리하는 데 사용됩니다. Amazon Redshift Serverless는 7일 동안 SYS\$1SERVERLESS\$1USAGE에 정보를 보관합니다.

컴퓨팅 비용 청구에 대한 예시는 [Amazon Redshift Serverless에 대한 청구](https://docs.aws.amazon.com/redshift/latest/mgmt/serverless-billing.html)를 참조하세요.

SYS\$1SERVERLESS\$1USAGE는 슈퍼 사용자에게만 표시됩니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_SERVERLESS_USAGE-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_SERVERLESS_USAGE.html)

## 사용 노트
<a name="SYS_SERVERLESS_USAGE-usage_notes"></a>
+  compute\$1seconds가 0이지만 charged\$1seconds가 0보다 크거나 그 반대의 경우가 있습니다. 이는 데이터가 시스템 뷰에 기록되는 방식에 따른 정상적인 동작입니다. 서버리스 사용량 세부 정보를 보다 정확하게 표시하려면 데이터를 집계하는 것이 좋습니다.

## 예제
<a name="SYS_SERVERLESS_USAGE-examples"></a>

charge\$1seconds를 쿼리하여 시간 간격에 사용된 RPU 시간에 대한 총 요금을 얻으려면 다음 쿼리를 실행합니다.

```
select trunc(start_time) "Day", 
(sum(charged_seconds)/3600::double precision) * <Price for 1 RPU> as cost_incurred 
from sys_serverless_usage 
group by 1 
order by 1
```

간격 동안 유휴 시간이 있을 수 있습니다. 유휴 시간은 사용된 RPU에 추가되지 않습니다.

# SYS\$1SESSION\$1HISTORY
<a name="SYS_SESSION_HISTORY"></a>

SYS\$1SESSION\$1HISTORY를 사용하여 현재 활성 세션 및 세션 기록에 대한 정보를 볼 수 있습니다.

SYS\$1SESSION\$1HISTORY는 모든 사용자에게 표시됩니다. 수퍼유저는 모든 행을 볼 수 있지만 일반 사용자는 자체 데이터만 볼 수 있습니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_SESSION_HISTORY-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_SESSION_HISTORY.html)

### 예제
<a name="SYS_SESSION_HISTORY-examples"></a>

다음은 SYS\$1SESSION\$1HISTORY의 샘플 출력입니다.

```
select * from sys_session_history;
 user_id | session_id |   database_name  | status | session_timeout |         start_time         |          end_time          
---------+------------+------------------+--------+-----------------+----------------------------+----------------------------
       1 | 1073971370 | dev              | closed |        0        | 2023-07-17 15:50:12.030104 | 2023-07-17 15:50:12.123218
       1 | 1073979694 | dev              | closed |        0        | 2023-07-17 15:50:24.117947 | 2023-07-17 15:50:24.131859
       1 | 1073873049 | dev              | closed |        0        | 2023-07-17 15:49:29.067398 | 2023-07-17 15:49:29.070294
       1 | 1073873086 | database18127a4a | closed |        0        | 2023-07-17 15:49:29.119018 | 2023-07-17 15:49:29.125925
       1 | 1073832112 | dev              | closed |        0        | 2023-07-17 15:49:29.164688 | 2023-07-17 15:49:29.179631
       1 | 1073987697 | dev              | closed |        0        | 2023-07-17 15:49:29.26749  | 2023-07-17 15:49:29.273034
       1 | 1073922429 | dev              | closed |        0        | 2023-07-17 15:49:33.35315  | 2023-07-17 15:49:33.367499
       1 | 1073766783 | dev              | closed |        0        | 2023-07-17 15:49:45.38237  | 2023-07-17 15:49:45.396902
       1 | 1073807506 | dev              | active |        0        | 2023-07-17 15:51:48        |
```

# SYS\$1SPATIAL\$1SIMPLIFY
<a name="SYS_SPATIAL_SIMPLIFY"></a>

COPY 명령을 사용하여 단순화된 공간 지오메트리 객체에 대한 정보를 가져오기 위해 시스템 뷰 SYS\$1SPATIAL\$1SIMPLIFY를 쿼리할 수 있습니다. shapefile에서 COPY를 사용할 때 SIMPLIFY `tolerance`, SIMPLIFY AUTO 및 SIMPLIFY AUTO `max_tolerance` 수집 옵션을 지정할 수 있습니다. 단순화 결과는 SYS\$1SPATIAL\$1SIMPLIFY 시스템 뷰에 요약되어 있습니다.

SIMPLIFY AUTO `max_tolerance`가 설정되면 이 뷰에는 최대 크기를 초과한 각 지오메트리에 대한 행이 포함됩니다. SIMPLIFY `tolerance`가 설정되면 전체 COPY 작업에 대한 하나의 행이 저장됩니다. 이 행은 COPY 쿼리 ID와 지정된 단순화 허용치를 참조합니다.

shapefile 로드에 대한 자세한 내용은 [Amazon Redshift에 shapefile 로드](spatial-copy-shapefile.md)를 참조하세요.

SYS\$1SPATIAL\$1SIMPLIFY는 모든 사용자에게 표시됩니다. 수퍼유저는 모든 행을 볼 수 있지만 일반 사용자는 자체 데이터만 볼 수 있습니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_SPATIAL_SIMPLIFY-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_SPATIAL_SIMPLIFY.html)

## 샘플 쿼리
<a name="SYS_SPATIAL_SIMPLIFY-sample-query"></a>

다음 쿼리는 COPY가 단순화한 레코드 목록을 반환합니다.

```
SELECT * FROM sys_spatial_simplify;
                
             
 query_id | line_number | maximum_tolerance | initial_size | simplified | final_size |   final_tolerance
----------+-------------+-------------------+--------------+------------+------------+----------------------
    20    |     1184704 |                -1 |      1513736 | t          |    1008808 |   1.276386653895e-05
    20    |     1664115 |                -1 |      1233456 | t          |    1023584 | 6.11707814796635e-06
```

# SYS\$1STREAM\$1SCAN\$1ERRORS
<a name="r_SYS_STREAM_SCAN_ERRORS"></a>

스트리밍 수집을 통해 로드된 레코드의 오류를 기록합니다.

SYS\$1STREAM\$1SCAN\$1ERRORS는 모든 사용자에게 표시됩니다. 수퍼유저는 모든 행을 볼 수 있지만 일반 사용자는 자체 데이터만 볼 수 있습니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="r_SYS_STREAM_SCAN_ERRORS-table-rows"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/r_SYS_STREAM_SCAN_ERRORS.html)

# SYS\$1STREAM\$1SCAN\$1STATES
<a name="r_SYS_STREAM_SCAN_STATES"></a>

스트리밍 수집을 통해 로드된 레코드의 스캔 상태를 기록합니다.

SYS\$1STREAM\$1SCAN\$1STATES는 모든 사용자에게 표시됩니다. 수퍼유저는 모든 행을 볼 수 있지만 일반 사용자는 자체 데이터만 볼 수 있습니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="r_SYS_STREAM_SCAN_STATES-table-rows"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/r_SYS_STREAM_SCAN_STATES.html)

다음 쿼리는 특정 쿼리에 대한 스트림 및 주제 데이터를 보여줍니다.

```
select query_id,mv_name::varchar,external_schema_name::varchar,stream_name::varchar,sum(scanned_rows) total_records,
sum(scanned_bytes) total_bytes from sys_stream_scan_states where query in (5401180,8601939) group by 1,2,3,4;

  query_id  |    mv_name     | external_schema_name |   stream_name   | total_records |  total_bytes
------------+----------------+----------------------+-----------------+---------------+----------------
 5401180    | kinesistest    | kinesis              | kinesisstream   |    1493255696 | 3209006490704
 8601939    | msktest        | msk                  | mskstream       |      14677023 |   31056580668
(2 rows)
```

# SYS\$1TRANSACTION\$1HISTORY
<a name="SYS_TRANSACTION_HISTORY"></a>

쿼리를 추적할 때 SYS\$1TRANSACTION\$1HISTORY를 사용하면 트랜잭션의 세부 정보를 볼 수 있습니다.

SYS\$1TRANSACTION\$1HISTORY는 슈퍼 사용자에게만 표시됩니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_TRANSACTION_HISTORY-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_TRANSACTION_HISTORY.html)

## 샘플 쿼리
<a name="SYS_TRANSACTION_HISTORY-sample-queries"></a>

```
select * from sys_transaction_history order by transaction_start_time desc;
                
 user_id | transaction_id | isolation_level |   status   |   transaction_start_time   |     commit_start_time      |      commit_end_time       | blocks_committed | undo_transaction_id 
---------+----------------+-----------------+------------+----------------------------+----------------------------+----------------------------+------------------+---------------------     
     100 |           1310 | Serializable    | committed  | 2023-08-27 21:03:11.822205 | 2023-08-28 21:03:11.825287 | 2023-08-28 21:03:11.854883 |               17 |                  -1
     101 |           1345 | Serializable    | committed  | 2023-08-27 21:03:12.000278 | 2023-08-28 21:03:12.003736 | 2023-08-28 21:03:12.030061 |               17 |                  -1
     102 |           1367 | Serializable    | committed  | 2023-08-27 21:03:12.1532   | 2023-08-28 21:03:12.156124 | 2023-08-28 21:03:12.186468 |               17 |                  -1
     100 |           1370 | Serializable    | committed  | 2023-08-27 21:03:12.199316 | 2023-08-28 21:03:12.204854 | 2023-08-28 21:03:12.238186 |               24 |                  -1
     100 |           1408 | Serializable    | committed  | 2023-08-27 21:03:53.891107 | 2023-08-28 21:03:53.894825 | 2023-08-28 21:03:53.927465 |               17 |                  -1
     100 |           1409 | Serializable    | rolledback | 2023-08-27 21:03:53.936431 | 2000-01-01 00:00:00        | 2023-08-28 21:04:08.712532 |                0 |                1409
     101 |           1415 | Serializable    | committed  | 2023-08-27 21:04:24.283188 | 2023-08-28 21:04:24.289196 | 2023-08-28 21:04:24.374318 |               25 |                  -1
     101 |           1416 | Serializable    | committed  | 2023-08-27 21:04:24.38818  | 2023-08-28 21:04:24.391688 | 2023-08-28 21:04:24.415135 |               17 |                  -1
     100 |           1417 | Serializable    | rolledback | 2023-08-27 21:04:24.424252 | 2000-01-01 00:00:00        | 2023-08-28 21:04:28.354826 |                0 |                1417
     101 |           1418 | Serializable    | rolledback | 2023-08-27 21:04:24.425195 | 2000-01-01 00:00:00        | 2023-08-28 21:04:28.680355 |                0 |                1418
     100 |           1420 | Serializable    | committed  | 2023-08-27 21:04:28.697607 | 2023-08-28 21:04:28.702374 | 2023-08-28 21:04:28.735541 |               23 |                  -1
     101 |           1421 | Serializable    | committed  | 2023-08-27 21:04:28.744854 | 2023-08-28 21:04:28.749344 | 2023-08-28 21:04:28.779029 |               23 |                  -1
     101 |           1423 | Serializable    | committed  | 2023-08-27 21:04:28.78942  | 2023-08-28 21:04:28.791556 | 2023-08-28 21:04:28.817485 |               16 |                  -1
     100 |           1430 | Serializable    | committed  | 2023-08-27 21:04:28.917788 | 2023-08-28 21:04:28.919993 | 2023-08-28 21:04:28.944812 |               16 |                  -1
     102 |           1494 | Serializable    | committed  | 2023-08-27 21:04:37.029058 | 2023-08-28 21:04:37.033137 | 2023-08-28 21:04:37.062001 |               16 |                  -1
```

# SYS\$1UDF\$1LOG
<a name="SYS_UDF_LOG"></a>

사용자 정의 함수(UDF)를 실행하는 중에 생성되는 시스템 정의 오류 및 경고 메시지를 기록합니다.

SYS\$1UDF\$1LOG는 수퍼유저에게만 표시됩니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_UDF_LOG-table-rows"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_UDF_LOG.html)

## 샘플 쿼리
<a name="SYS_UDF_LOG-sample-queries"></a>

다음 예는 UDF가 시스템 정의 오류를 처리하는 방법을 보여 줍니다. 첫 번째 블록은 인수의 역을 반환하는 UDF 함수의 정의를 보여 줍니다. 함수를 실행하고 인수로 0을 제공하면 함수가 오류를 반환합니다. 마지막 문은 SYS\$1UDF\$1LOG에 로깅된 오류 메시지를 반환합니다.

```
-- Create a function to find the inverse of a number.
CREATE OR REPLACE FUNCTION f_udf_inv(a int) 

RETURNS float 

IMMUTABLE AS $$return 1/a 

$$ LANGUAGE plpythonu; 

-- Run the function with 0 to create an error.
Select f_udf_inv(0); 

-- Query SYS_UDF_LOG to view the message.
Select query_id, record_time, message::varchar from sys_udf_log; 


query_id    |    record_time              |                 message
----------+----------------------------+-------------------------------------------------------
2211        | 2023-08-23 15:53:11.360538 |  ZeroDivisionError: integer division or modulo by zero line 2, in f_udf_inv\n return 1/a\n
```

다음 예는 UDF에 로깅 및 경고 메시지를 추가하므로 0으로 나누기 연산은 오류 메시지와 함께 중단되는 대신 경고 메시지를 생성합니다.

```
-- Create a function to find the inverse of a number and log a warning if you input 0.
CREATE OR REPLACE FUNCTION f_udf_inv_log(a int)
  RETURNS float IMMUTABLE
 AS $$ 
  import logging
  logger = logging.getLogger() #get root logger
  if a==0:
    logger.warning('You attempted to divide by zero.\nReturning zero instead of error.\n') 
    return 0
  else:
     return 1/a
$$ LANGUAGE plpythonu;

-- Run the function with 0 to trigger the warning.
Select f_udf_inv_log(0);

-- Query SYS_UDF_LOG to view the message.
Select query_id, record_time, message::varchar from sys_udf_log;

 query_id |        record_time         |                                    message
----------+----------------------------+-------------------------------------------------------------------------------
     0   | 2023-08-23 16:10:48.833503 | WARNING: You attempted to divide by zero.\nReturning zero instead of error.\n
```

# SYS\$1UNLOAD\$1DETAIL
<a name="SYS_UNLOAD_DETAIL"></a>

SYS\$1UNLOAD\$1DETAIL을 사용하여 UNLOAD 작업의 세부 정보를 봅니다. UNLOAD 문에서 생성되는 파일마다 행 1개를 기록합니다. 예를 들어 UNLOAD를 실행하여 파일 12개가 생성된다면 SYS\$1UNLOAD\$1DETAIL에 포함되는 행의 수도 12개입니다.

SYS\$1UNLOAD\$1DETAIL은 모든 사용자에게 표시됩니다. 수퍼유저는 모든 행을 볼 수 있지만 일반 사용자는 자체 데이터만 볼 수 있습니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_UNLOAD_DETAIL-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_UNLOAD_DETAIL.html)

## 샘플 쿼리
<a name="SYS_UNLOAD_DETAIL-sample-queries"></a>

다음 쿼리는 unload 명령의 형식, 행 및 파일 수를 비롯하여 언로드된 쿼리에 대한 세부 정보를 보여줍니다.

```
select query_id, substring(file_name, 0, 50), transfer_size, file_format from sys_unload_detail;
```

샘플 출력은 다음과 같습니다.

```
 
 query_id |                     substring                               | transfer_size | file_format 
----------+-------------------------------------------------------------+---------------+-------------
     9272 | s3://amzn-s3-demo-bucket/my_unload_doc_venue0000_part_00.gz  |        395886 | Text      
     9272 | s3://amzn-s3-demo-bucket/my_unload_doc_venue0001_part_00.gz  |        406444 | Text      
     9272 | s3://amzn-s3-demo-bucket/my_unload_doc_venue0002_part_00.gz  |        409431 | Text      
     9272 | s3://amzn-s3-demo-bucket/my_unload_doc_venue0003_part_00.gz  |        403051 | Text      
     9272 | s3://amzn-s3-demo-bucket/my_unload_doc_venue0004_part_00.gz  |        413592 | Text      
     9272 | s3://amzn-s3-demo-bucket/my_unload_doc_venue0005_part_00.gz  |        395689 | Text      
(6 rows)
```

# SYS\$1UNLOAD\$1HISTORY
<a name="SYS_UNLOAD_HISTORY"></a>

SYS\$1UNLOAD\$1HISTORY를 사용하여 UNLOAD 명령의 세부 정보를 봅니다. 각 행은 일부 필드에 대한 누적 통계가 있는 UNLOAD 명령을 나타냅니다. 여기에는 실행 중인 UNLOAD 명령과 완료된 UNLOAD 명령이 모두 포함됩니다.

SYS\$1UNLOAD\$1HISTORY는 모든 사용자에게 표시됩니다. 수퍼유저는 모든 행을 볼 수 있지만 일반 사용자는 자체 데이터만 볼 수 있습니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_UNLOAD_HISTORY-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_UNLOAD_HISTORY.html)

## 샘플 쿼리
<a name="SYS_UNLOAD_HISTORY-sample-queries"></a>

다음 쿼리는 unload 명령의 형식, 행 및 파일 수를 비롯하여 언로드된 쿼리에 대한 세부 정보를 보여줍니다.

```
SELECT query_id,
       file_format,
       start_time,
       duration,
       unloaded_rows,
       unloaded_files_count
FROM sys_unload_history
ORDER BY query_id,
file_format limit 100;
```

샘플 출력은 다음과 같습니다.

```
 query_id | file_format |         start_time         | duration | unloaded_rows | unloaded_files_count
----------+-------------+----------------------------+----------+---------------+----------------------
   527067 | Text        | 2022-02-09 05:18:35.844452 |  5932478 |            10 |                    1
```

# SYS\$1USERLOG
<a name="SYS_USERLOG"></a>

다음과 같이 데이터베이스 사용자의 변경 사항에 대한 세부 정보를 기록합니다.
+ 사용자 생성
+ 사용자 삭제
+ 사용자 변경(이름 변경)
+ 사용자 변경(속성 변경)

이 뷰를 쿼리하여 서버리스 작업 그룹 및 프로비저닝된 클러스터에 대한 정보를 볼 수 있습니다.

SYS\$1USERLOG는 슈퍼 사용자에게만 표시됩니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_USERLOG-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_USERLOG.html)

## 샘플 쿼리
<a name="SYS_USERLOG-sample-queries"></a>

다음은 사용자 작업 4개를 실행한 후 SYS\$1USERLOG 뷰에 대한 쿼리를 실행하는 예입니다.

```
CREATE USER userlog1 password 'Userlog1';
ALTER USER userlog1 createdb createuser;
ALTER USER userlog1 rename  to userlog2;
DROP user userlog2;

SELECT user_id, user_name, original_user_name, action, has_create_db_privs, is_superuser from SYS_USERLOG order by record_time desc;
```

```
user_id |  user_name | original_user_name |  action | has_create_db_privs | is_superuser
--------+------------+--------------------+---------+---------------------+------------
    108 |  userlog2  |                    | drop    |                   1 |   1
    108 |  userlog2  |     userlog1       | rename  |                   1 |   1
    108 |  userlog1  |                    | alter   |                   1 |   1
    108 |  userlog1  |                    | create  |                   0 |   0
 (4 rows)
```

# SYS\$1VACUUM\$1HISTORY
<a name="SYS_VACUUM_HISTORY"></a>

SYS\$1VACUUM\$1HISTORY를 사용하여 Vacuum 쿼리의 세부 정보를 볼 수 있습니다. 명령에 대한 자세한 내용은 [VACUUM](r_VACUUM_command.md)을 참조하세요.

SYS\$1VACUUM\$1HISTORY는 모든 사용자에게 표시됩니다. 수퍼유저는 모든 행을 볼 수 있지만 일반 사용자는 자체 데이터만 볼 수 있습니다. 자세한 내용은 [시스템 테이블 및 뷰에 있는 데이터의 가시성](cm_chap_system-tables.md#c_visibility-of-data) 섹션을 참조하세요.

## 테이블 열
<a name="SYS_VACUUM_HISTORY-table-columns"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/redshift/latest/dg/SYS_VACUUM_HISTORY.html)