Oracle¶
The Oracle assets are repo-native: they predate the multi-engine restructure and
are the original content of this repository. Unlike the other engines, they are not
generated by tools/sync-upstream.sh, so you edit them directly.
Oracle 자산은 리포 고유 자산입니다. 다중 엔진 재구성보다 앞서 존재한 이 저장소의
원본 콘텐츠입니다. 다른 엔진과 달리 tools/sync-upstream.sh 가 생성하지 않으므로
직접 수정합니다.
Files / 파일¶
| Path | Contents / 내용 |
|---|---|
engines/oracle/ddl/schema.sql |
25 tables with inline primary keys / 인라인 기본키를 가진 25개 테이블 |
engines/oracle/load/ctl/*.ctl |
24 SQL*Loader control files, one per table / 테이블별 SQL*Loader 컨트롤 파일 24개 |
engines/oracle/load/load.sh |
renders the templates, runs sqlldr / 템플릿을 렌더링하고 sqlldr 실행 |
engines/oracle/queries/*.sql |
103 queries, Oracle dialect / Oracle 방언 103개 쿼리 |
engines/oracle/tuning/indexes.sql |
optional foreign-key indexes / 선택적 외래키 인덱스 |
engines/oracle/tuning/stats.sql |
DBMS_STATS — not optional / 필수 |
There are 24 control files rather than 25 because dbgen_version is created by the
schema but never loaded.
컨트롤 파일이 25개가 아니라 24개인 이유는 dbgen_version 이 스키마에서 생성되지만
적재되지 않기 때문입니다.
Dialect notes / 방언 특징¶
The queries were adapted for Oracle before this restructure, in two consistent ways:
이 재구성 전에 두 가지 방식으로 Oracle 에 맞게 변환되었습니다.
- Row limiting. 86 of the 103 files wrap the query and filter with
where rownum <= 100instead ofLIMIT 100—rownummust be applied outside theORDER BY, hence the wrapper. 행 제한. 103개 중 86개가LIMIT 100대신 쿼리를 감싸고where rownum <= 100으로 필터합니다.rownum은ORDER BY밖에서 적용해야 하므로 래퍼가 필요합니다. - Date arithmetic.
to_date('1998-04-06','YYYY-MM-DD') + 30rather thanINTERVAL. No file usesINTERVAL. 날짜 연산.INTERVAL대신to_date('1998-04-06','YYYY-MM-DD') + 30을 사용합니다.INTERVAL을 쓰는 파일은 없습니다.
Warning / 주의
Substitution parameters differ from the other engines. The Oracle set uses
different qualification values — query01 filters s_state = 'SD' and aggregates
SR_FEE, where the standard text uses 'TN' and SR_RETURN_AMT. Oracle results
are therefore not row-for-row comparable with the other four engines, even at the
same scale factor.
치환 파라미터가 다른 엔진과 다릅니다. Oracle 세트는 다른 qualification 값을
사용합니다. query01 은 s_state = 'SD' 로 필터하고 SR_FEE 를 집계하는데, 표준
원문은 'TN' 과 SR_RETURN_AMT 를 사용합니다. 따라서 동일 스케일 팩터에서도
Oracle 결과는 나머지 네 엔진과 행 단위로 비교할 수 없습니다.
If you want cross-engine comparable output, align the Oracle queries with the standard values first.
엔진 간 비교 가능한 결과가 필요하면 Oracle 쿼리를 표준 값에 먼저 맞추십시오.
No Docker profile / Docker 프로필 없음¶
docker/docker-compose.yml has no Oracle service. Oracle Database images are not
redistributable under a licence this repository can assume;
container-registry.oracle.com requires accepting the licence and authenticating.
docker/docker-compose.yml 에는 Oracle 서비스가 없습니다. Oracle Database 이미지는
이 저장소가 전제할 수 있는 라이선스로 재배포되지 않으며,
container-registry.oracle.com 은 라이선스 동의와 인증을 요구합니다.
Oracle Database Free is the practical option for local work:
로컬 작업에는 Oracle Database Free 가 현실적인 선택입니다.
docker run -d --name tpcds-oracle \
-p 1521:1521 \
-e ORACLE_PWD=tpcds \
container-registry.oracle.com/database/free:latest
Setup / 설정¶
Oracle has no CREATE DATABASE step here — create the user and grant quota first:
여기서는 Oracle 에 CREATE DATABASE 단계가 없습니다. 먼저 사용자를 만들고 쿼터를
부여하십시오.
CREATE USER tpcds IDENTIFIED BY tpcds;
GRANT CONNECT, RESOURCE, CREATE VIEW TO tpcds;
ALTER USER tpcds QUOTA UNLIMITED ON USERS;
Then:
cp config/oracle.env.example config/oracle.env
# set ORACLE_CONNECT, e.g. 'tpcds/tpcds@//localhost:1521/FREEPDB1'
bin/ddl.sh --engine oracle
bin/load.sh --engine oracle --data-dir ~/tpcds/sf1
bin/ddl.sh --engine oracle --tuning # DBMS_STATS — do not skip / 생략 금지
bin/run.sh --engine oracle --sf 1
Requirements / 요구 사항¶
Both sqlplus and sqlldr must be on PATH. They come from different Oracle
Instant Client packages: sqlplus from Basic + SQL*Plus, sqlldr from Tools.
Installing only the SQL*Plus package is a common reason bin/load.sh fails while
bin/run.sh works.
sqlplus 와 sqlldr 이 모두 PATH 에 있어야 합니다. 둘은 서로 다른 Oracle Instant
Client 패키지에 속합니다. sqlplus 는 Basic + SQL*Plus, sqlldr 은 Tools 입니다.
SQL*Plus 패키지만 설치하면 bin/run.sh 는 되지만 bin/load.sh 가 실패하는 흔한
원인입니다.
Loading / 적재¶
The .ctl files hold @DATA_DIR@ and @LOG_DIR@ placeholders because SQL*Loader
does not expand environment variables. load.sh renders them into a temporary
directory per run, leaving the versioned templates untouched.
SQL*Loader 는 환경변수를 전개하지 않으므로 .ctl 파일은 @DATA_DIR@ 와
@LOG_DIR@ 자리표시자를 사용합니다. load.sh 가 실행마다 임시 디렉터리에
렌더링하며 버전 관리되는 템플릿은 수정하지 않습니다.
Default loader options, overridable via ORACLE_SQLLDR_OPTS:
기본 로더 옵션이며 ORACLE_SQLLDR_OPTS 로 변경할 수 있습니다.
direct=true bypasses the buffer cache and is much faster, but it is skipped
silently if the target table has enabled constraints or triggers. Drop
direct=true if you added enforced foreign keys.
direct=true 는 버퍼 캐시를 우회해 훨씬 빠르지만, 대상 테이블에 활성 제약이나
트리거가 있으면 조용히 무시됩니다. 강제 외래키를 추가했다면 direct=true 를
제거하십시오.
sqlldr returns exit code 2 for a warning-level completion, such as discarded rows.
load.sh treats that as a warning rather than a failure when the log shows rows were
loaded — check $LOG_DIR/<table>.log and the .bad / .dsc files.
sqlldr 은 일부 행 discard 같은 경고 수준 완료에 종료 코드 2 를 반환합니다. 로그에
적재된 행이 있으면 load.sh 는 이를 실패가 아닌 경고로 처리합니다.
$LOG_DIR/<table>.log 와 .bad / .dsc 파일을 확인하십시오.
Statistics / 통계¶
tuning/stats.sql is not optional. Without statistics the optimiser has no
cardinality estimates for the fact tables and chooses nested loops where hash joins
are required, which makes several queries effectively non-terminating.
tuning/stats.sql 은 선택이 아닙니다. 통계가 없으면 옵티마이저가 팩트 테이블
카디널리티를 추정할 수 없어 해시 조인이 필요한 곳에 중첩 루프를 선택하며, 일부
쿼리는 사실상 종료되지 않습니다.
tuning/indexes.sql is optional, and for TPC-DS often unhelpful: most queries
scan a large fraction of each fact table, where a full scan beats an index range
scan. See Methodology.
tuning/indexes.sql 은 선택 사항이며 TPC-DS 에서는 도움이 되지 않는 경우가 많습니다.
대부분의 쿼리가 팩트 테이블의 큰 비중을 스캔하므로 인덱스 범위 스캔보다 전체 스캔이
유리합니다. 방법론 참고.