CHECK DISK_USAGE
alter_system_check_disk_stmt:
Code Block |
---|
alter_system_check_disk_stmt ::= 'ALTER SYSTEM CHECK DISK_USAGE' |
Disk usage may be inaccurate when process failures or power failures occur. This command reads the correct value from the file system. However, it should be avoided because it can put a considerable load on the file system.
INSTALL LICENSE
alter_system_install_license_stmt:
Code Block |
---|
alter_system_install_license_stmt ::= 'ALTER SYSTEM INSTALL LICENSE' |
라이선스 파일의 기본위치Installs the license file in the default location of the license file ($MACHBASE_HOME/conf/license.dat)에 라이선스 파일을 설치한다.해당 라이선스가 설치에 적합한지 판별 후 설치된다.
It is installed after determining whether the license is suitable for installation.
INSTALL LICENSE (PATH)
alter_system_install_license_path_stmt:
Code Block |
---|
alter_system_install_license_path_stmt: ::= 'ALTER SYSTEM INSTALL LICENSE' '=' "'" path "'" |
특정 위치에 있는 라이선스 파일을 설치한다.
해당 위치에 존재하지 않거나 올바르지 않은 라이선스 파일을 입력했을 시에는 에러가 발생한다. 경로는 반드시 절대경로로 입력해야 한다. 해당 라이선스가 설치에 적합한지 판별 후 설치된다.
SET
Info |
---|
5.6 이후 버전 부터 지원되는 기능입니다. |
Installs the license file in a specific location.
An error occurs when you enter a license file that does not exist at that location or is incorrect. The path must be an absolute path. It is installed after determining whether the license is suitable for installation.
SET
alter_system_set_stmt:
Code Block |
---|
alter_system_set_stmt ::= 'ALTER SYSTEM SET' prop_name '=' value |
System 의 Property 를 수정할 수 있다. 수정 가능한 Property 는 다음과 같다.The list of properties that can be modified is as follows.
- QUERY_PARALLEL_FACTOR
- DEFAULT_DATE_FORMAT
- TRACE_LOG_LEVEL
- PAGE_CACHE_MAX_SIZE
- MAX_SESSION_COUNT
- SESSION_IDLE_TIMEOUT_SEC
ALTER SESSION
세션 단위의 자원을 관리하거나 설정을 변경하는 구문이다This is the syntax for managing resources or changing settings on a per-session basis.
SET SQL_LOGGING
alter_session_sql_logging_stmt:
Code Block |
---|
alter_session_sql_logging_stmt ::= 'ALTER SESSION SET SQL_LOGGING' '=' flag |
해당 세션의 Trace Log에 메시지를 남길지 여부를 결정한다.
이 메시지를 Bit Flag 로서 다음의 값을 사용하면 된다.Determines whether to leave a message in the Trace Log of the session.
You can use this message as a Bit Flag with the following values:
- 0x1: Parsing, Validation, Optimization 단계에서 발생하는 에러를 남긴다.
- 0x2: DDL을 수행한 결과를 남긴다.
즉, 해당 플래그의 값이 2일 경우에는 DDL만 로깅하고, 3일 경우에는 에러 및 DDL을 함께 로깅하는 것이다.
아래는 해당 세션의 로깅 플래그를 변경하고, 에러 로깅을 남기는 예제이다- It leaves the result of performing DDL.
That is, when the value of the corresponding flag is 2, only the DDL is logged, and when the flag is 3, the error and DDL are logged together.
Below is an example of changing the logging flag of the session and leaving error logging.
Code Block |
---|
Mach> alter session set SQL_LOGGING=1; Altered successfully. Mach> exit |
SET DEFAULT_DATE_FORMAT
alter_session_set_defalut_dateformat_stmt:
Code Block |
---|
alter_session_set_defalut_dateformat_stmt ::= 'ALTER SESSION SET DEFAULT_DATE_FORMAT' '=' date_format |
해당 세션의 Datetime 자료형의 기본 포맷을 설정한다.
서버가 구동되면, Property 인 Sets the default format for Datetime data types for this session.
When the server is started, the property DEFAULT_DATE_FORMAT 의 값이 세션 속성으로 설정이 된다.
Property 의 속성이 바뀌지 않았다면, 세션의 값 또한 is set to the session attribute.
If the property of the property has not changed, the value of the session will also be "YYYY-MM-DD HH24: MI: SS mmm: uuu: nnn"이 될 것이다.
시스템과 무관하게, 특정 사용자에 한해 Datetime 자료형의 기본 포맷을 수정할 경우에 이 명령어를 사용한다.v$session 에 해당 세션마다 설정된 Default Date Format 이 있고 확인도 할 수 있다. 아래는 해당 세션의 값을 확인 및 변경하는 예제이다
Use this command to modify the default format of a datetime datatype for a specific user, regardless of the system.
V$session has a default date format set for each session and can be checked. Below is an example of checking and changing the value of the session.
Code Block |
---|
Mach> CREATE TABLE time_table (time datetime); Created successfully. Mach> SELECT DEFAULT_DATE_FORMAT from v$session; default_date_format ----------------------------------------------- YYYY-MM-DD HH24:MI:SS mmm:uuu:nnn [1] row(s) selected. Mach> INSERT INTO time_table VALUES(TO_DATE('2016-11-11')); [ERR-00300 : Invalid date format or input string.([2016-11-11]:[%Y-%m-%d %H:%M:%S %0:%1:%2])] Mach> ALTER SESSION SET DEFAULT_DATE_FORMAT='YYYY-MM-DD'; Altered successfully. Mach> SELECT DEFAULT_DATE_FORMAT from v$session; default_date_format ---------------------------------------------- YYYY-MM-DD [1] row(s) selected. Mach> INSERT INTO time_table VALUES(TO_DATE('2016-11-11')); 1 row(s) inserted. Mach> SELECT * FROM time_table; TIME ---------------------------------- 2016-11-11 [1] row(s) selected. |
SET SHOW_HIDDEN_COLS
alter_session_set_hidden_column_stmt:
Code Block |
---|
alter_session_set_hidden_column_stmt ::= 'ALTER SESSION SET SHOW_HIDDEN_COLS' '=' ( '0' | '1' ) |
해당 세션의 select 수행시 *로 표현된 컬럼에서 숨은 컬럼 Decides whether to output the hidden column (_arrival_time) 을 출력할 것인지를 결정한다.
서버가 구동되면, 전역 프로퍼티인 SHOW_HIDDEN_COLS의 값이 세션 속성으로 0이 설정된다.
만일 사용자가 자기 세션의 기본 동작을 변경하고자 할 경우에는 이 값을 1로 설정하면 된다.
v$session에 해당 세션마다 설정된 SHOW_HIDDEN_COLS 값이 있으며, 확인할 수 있다in the column represented by * when executing the select of the session.
When the server is started, the value of the global property SHOW_HIDDEN_COLS is set to 0 for the session attribute.
If you want to change the default behavior of your session, you can set this value to 1.
V$session has a SHOW_HIDDEN_COLS value set for each session.
Code Block |
---|
Mach> SELECT * FROM v$session; ID CLOSED USER_ID LOGIN_TIME SQL_LOGGING SHOW_HIDDEN_COLS ----------------------------------------------------------------------------------------------------------------- DEFAULT_DATE_FORMAT HASH_BUCKET_SIZE ------------------------------------------------------------------------------------------------------ 1 0 1 2015-04-29 17:23:56 248:263:000 3 0 YYYY-MM-DD HH24:MI:SS mmm:uuu:nnn 20011 [1] row(s) selected. Mach> ALTER SESSION SET SHOW_HIDDEN_COLS=1; Altered successfully. Mach> SELECT * FROM v$session; _ARRIVAL_TIME ID CLOSED USER_ID LOGIN_TIME SQL_LOGGING -------------------------------------------------------------------------------------------------------------------------------- SHOW_HIDDEN_COLS DEFAULT_DATE_FORMAT HASH_BUCKET_SIZE ------------------------------------------------------------------------------------------------------------------------ 1970-01-01 09:00:00 000:000:000 1 0 1 2015-04-29 17:23:56 248:263:000 3 1 YYYY-MM-DD HH24:MI:SS mmm:uuu:nnn 20011 [1] row(s) selected. |
SET FEEDBACK_APPEND_ERROR
alter_session_set_feedback_append_err_stmt:
Code Block |
---|
alter_session_set_feedback_append_err_stmt ::= 'ALTER SESSION SET FEEDBACK_APPEND_ERROR' '=' ( '0' | '1' ) |
해당 세션의 Append 에러 메시지를 Client program으로 보낼 것인지를 설정한다.
에러 메시지는 다음의 값을 사용하면 된다.
- 0 = 에러 메시지를 보내지 않는다.
- 1 = 에러 메시지를 보낸다.
아래는 사용 예제이다Sets whether to send the session's Append error message to the client program.
Use the following values for the error message.
- 0 = Do not send an error message.
- 1 = Send an error message.
Below is an example of use.
Code Block |
---|
mach> ALTER SESSION SET FEEDBACK_APPEND_ERROR=0; Altered successfully. |
SET MAX_QPX_MEM
alter_session_set_max_qpx_mem_stmt:
Code Block |
---|
alter_session_set_max_qpx_mem_stmt ::= 'ALTER SESSION SET MAX_QPX_MEM' '=' value |
해당 세션의 하나의 SQL Statement가 Specifies the maximum amount of memory that a single SQL statement in the session will use when performing GROUP BY, DISTINCT, ORDER BY 연산을 수행할때 사용하는 최대 메모리의 크기를 지정한다.만약 최대 메모리 이상의 메모리 할당을 시도하면, 시스템은 그 SQL문의 수행을 취소하고 오류로 처리한다.
오류 발생 시 machbase.trc에 해당 질의문을 포함한 에러 코드 및 에러 메시지를 기록한다operations.
If you try to allocate more memory than the maximum memory, the system cancels the execution of the SQL statement and treats it as an error.
In case of error, record the error code and error message in machbase.trc including the query.
Code Block |
---|
Mach> ALTER SESSION SET MAX_QPX_MEM=1073741824; Altered successfully. Mach> SELECT * FROM v$session; ID CLOSED USER_ID LOGIN_TIME CLIENT_TYPE --------------------------------------------------------------------------------------------------------------------------------------------------------------------- USER_NAME USER_IP SQL_LOGGING SHOW_HIDDEN_COLS ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ FEEDBACK_APPEND_ERROR DEFAULT_DATE_FORMAT HASH_BUCKET_SIZE MAX_QPX_MEM RS_CACHE_ENABLE RS_CACHE_TIME_BOUND_MSEC --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- RS_CACHE_MAX_MEMORY_PER_QUERY RS_CACHE_MAX_RECORD_PER_QUERY RS_CACHE_APPROXIMATE_RESULT_ENABLE IDLE_TIMEOUT QUERY_TIMEOUT ----------------------------------------------------------------------------------------------------------------------------------------------- 14 0 1 2021-03-08 16:33:01 503:181:809 CLI NULL 192.168.0.194 11 0 1 YYYY-MM-DD HH24:MI:SS mmm:uuu:nnn 20011 1073741824 1 1000 16777216 50000 0 0 0 [1] row(s) selected. Elapsed time: 0.001 |
- 최대 메모리 크기 이상을 SQL문에서 사용했을 때, trc 에러trc error when using more than the maximum memory size in an SQL statement
Code Block |
---|
[2021-03-08 16:36:32 P-69000 T-140515328653056][INFO] DML FAILURE (2E10000084:Memory allocation error (alloc'd: 1048595, max: 1048576).) |
- 최대 메모리 크기 이상을 SQL문에서 사용했을 때, machsql 에러 메세지machsql error message when using more than the maximum memory size in an SQL statement
Code Block |
---|
Mach> select * from tag order by value DESC, time ASC; NAME TIME VALUE -------------------------------------------------------------------------------------- [ERR-00132: Memory allocation error (alloc'd: 1048595, max: 1048576).] [0] row(s) selected. Elapsed time: 0.447 |
( * 위의 trc 메세지를 출력하기 위해서, 임의로 최대 메모리 크기를 1MB로 변경한 후 에러를 확인하였다. )
SET SESSION_IDLE_TIMEOUT_SEC
alter_session_set_session_idle_timeout_sec_stmt:
Code Block |
---|
alter_session_set_session_idle_timeout_sec_stmt ::= 'ALTER SESSION SET SESSION_IDLE_TIMEOUT_SEC' '=' value |
해당 세션이 유휴 상태일 때의 연결 유지 시간을 지정한다.
초단위로 지정하며 유휴 상태로 설정된 시간이 지나게 되면 세션이 종료된다.
v$session 에서 세션에 설정된 idle timeout 시간을 조회할 수 있다.
Code Block |
---|
Mach> ALTER SESSION SET SESSION_IDLE_TIMEOUT_SEC=200;
Altered successfully.
Mach> SELECT IDLE_TIMEOUT FROM V$SESSION;
IDLE_TIMEOUT
-----------------------
200
[1] row(s) selected.
|
SET QUERY_TIMEOUT
alter_session_set_query_timeout_stmt:
Code Block |
---|
alter_session_set_query_timeout_stmt ::= 'ALTER SESSION SET QUERY_TIMEOUT' '=' value |
세션에서 Query를 수행 시 서버의 응답을 대기하는 시간이다.
초단위로 지정하며 Query 수행 후 서버에서의 응답이 지정된 시간을 초과하면 Query가 종료된다.
v$session에서 세션에 설정된 Query timeout 시간을 조회할 수 있다.
Specifies the duration of the connection when the session is idle.
It is specified in seconds, and the session is terminated when the set time in the idle state elapses.
You can inquire the idle timeout time set in the session in v$session.
Code Block |
---|
Mach> ALTER SESSION SET SESSION_IDLE_TIMEOUT_SEC=200;
Altered successfully.
Mach> SELECT IDLE_TIMEOUT FROM V$SESSION;
IDLE_TIMEOUT
-----------------------
200
[1] row(s) selected.
|
SET QUERY_TIMEOUT
alter_session_set_query_timeout_stmt:
Code Block |
---|
alter_session_set_query_timeout_stmt ::= 'ALTER SESSION SET QUERY_TIMEOUT' '=' value |
This is the time to wait for a response from the server when performing query in the session.
It is specified in seconds, and when the response from the server exceeds the specified time after executing the query, the query is terminated.
You can inquire the QUERY_TIME in the session in v$session
Code Block |
---|
Mach> ALTER SESSION SET QUERY_TIMEOUT=200;
Altered successfully.
Mach> SELECT QUERY_TIMEOUT FROM V$SESSION;
QUERY_TIMEOUT
-----------------------
200
[1] row(s) selected.
|