Oracle - Datamart
Applies to
Platform: Oracle
Architecture: Data Mart
Oracle - Datamart generates a Mart layer for an Oracle database from the objects of linked projects, as SQL*Plus scripts with PL/SQL loader packages. Select it in Project Settings, where Generator Configuration shows Oracle DataMart, when your data mart runs on Oracle. This article lists what the configuration supports and where it differs from Microsoft SQL Server - Datamart.
Scope and output
- Platform: Oracle. The configuration is available since Generator 2.0.
- Layers: Mart, and the layers of the imported linked projects. Dataflow Modeling shows the imported objects in the Linked column in Silver and the Mart layer as the Datamart column in Gold. See Understand the Layering concept.
- Output: a SQL*Plus script for the Mart layer, PL/SQL loader packages, the load control scripts and the PowerShell 7 scripts that deploy and load, described in Oracle - Artifacts.
Prerequisites
- One Oracle user for the Mart layer and one for load control (with Native Load Control). The user name is also the schema name of the layer.
- PowerShell 7 and SQL*Plus on the machine that deploys.
- The privileges listed in Oracle - Target environment.
The placeholders for the users, schemas and connections are listed in Oracle - Placeholder values.
Sources and linked projects
The configuration reads only model objects of linked projects, for example of a Data Vault or Data Store project. It has no discovery of its own and does not offer Database Links for Source Systems. Import a linked project before you model the Mart layer. You can also export this project as a linked project.
Create GRANTs for Imported Objects decides whether the deployment grants the imported objects to the Mart user. When it is on, the deployment also connects as the users of the linked layers.
Supported model objects
- Mart Dimension
- Mart Fact
- Mart Composite
- Mart Hierarchy Flatten
- Mart Out, since Generator 2.2
Capabilities and limitations
- Names: generated names are unquoted and in capitals. Characters other than letters, digits,
_,$and#become_, and names are cut to 128 characters. - Keys: primary keys are created with
RELYand a unique index, and business keys get a unique constraint. Foreign Key Mode on Mart Facts offersNone,Create DisabledandCreate Enforced; the default isCreate Disabled. - Indexes: the deployment creates an index on the referencing columns of each relationship, unless the primary key or a unique key has the same columns. On Mart Facts it is a bitmap index, otherwise a B-tree index. Index management offers
B-Tree IndexandBitmap Indexand the option Create as local Index. - Table storage: the partition, compression, tablespace and statistics properties of a model object are described in Partition Clause and table storage (Model Object).
- Wide objects: Hash Group Size splits the row hash of Mart Dimensions into groups.
- Identity values: the surrogate keys of Mart Dimensions and identity columns such as
BG_IDareNUMBER GENERATED BY DEFAULT AS IDENTITY. - Grants: the Mart layer grants
EXECUTEon its loader packages to the load-control user. - Loading: LoadControl Options offers
Native Load ControlandAirflow. - Data types: the platform data types
CHAR(CHAR),CHAR(BYTE),VARCHAR2(CHAR)andVARCHAR2(BYTE)write the length semantics, for exampleVARCHAR2(100 CHAR).CHARandVARCHAR2write none, so the database settingNLS_LENGTH_SEMANTICSapplies.TIMESTAMP WITH TIME ZONEwith precision 3 becomesTIMESTAMP(3) WITH TIME ZONE. - Data type validation: a length, precision or scale that does not fit the Oracle data type gets a warning, see Invalid data type configuration (Business Rule). The generator writes the configured value:
VARCHAR2(5000)fails withORA-00910at deployment on a database withMAX_STRING_SIZE = STANDARD.
Project properties
Project Settings shows these properties of the configuration, with their defaults:
- Hash Algorithm:
SHA1; alsoMD5,SHA256,SHA384andSHA512
With SHA256, SHA384 or SHA512, the hash Default Terms stay RAW(20). Set their data type to the result length of the algorithm, see Hash Algorithm.
- Hash Casing:
None; alsoUpperandLower - Hash Concatenation Separator:
_ - Hash Null Placeholder:
_NULL_ - Hash Trim: off
- Begin of Universe:
19000101 - End of Universe:
99991231 - Persist Validity: off
- Create Result Views: on
- Target Object Comment Type:
None - Artifact Output Mode:
Layer Composites - Deployment Options:
Generate Drop Table Statements - Configure LoadControl: on
- Deploy LoadControl: on
- LoadControl Options:
Native Load Control; alsoAirflow - Create GRANTs for Imported Objects: on
Platform differences
The table compares the configuration with Microsoft SQL Server - Datamart of the same release:
| Item | Oracle | Microsoft SQL Server |
|---|---|---|
| Timestamp Default Terms | TIMESTAMP | datetimeoffset |
| Hash Default Terms | RAW(20) | binary(20) |
| Text Default Terms | VARCHAR2 | nvarchar |
| Number Default Terms | NUMBER | int or bigint |
| Flag Default Terms | NUMBER(1, 0) | bit |
Hash Algorithm values besides SHA1 and MD5 | SHA256, SHA384, SHA512 | SHA2_256 |
| Index types | B-tree, bitmap | rowstore, columnstore |
Create GRANTs for Imported Objects, Hash Group Size, Create as local Index and the table storage properties exist only on Oracle. Included Columns of an index exists only on Microsoft SQL Server.
These Default Terms belong to each group; text Default Terms have the same lengths on both platforms:
- Timestamps:
BG_LoadTimestamp,BG_ValidFromTimestamp,BG_ValidToTimestamp,BG_UpdateTimestamp,BG_EffectiveTimestamp - Row hashes:
BG_RowHash,BG_RowHashScd1,BG_RowHashScd2 - Text:
BG_SourceSystem,BG_DataflowName,BG_DataflowSetName,BG_ErrorDescription,BG_IncrementLoadStatus - Numbers:
BG_ID,BG_ErrorCount,BG_DataQuality_ID,BG_MartDimension_Identity,BG_MartFact_ForeignKey_Identity - Flags:
BG_IsDeleted
Example
A Mart Dimension common_pos with the business key term POS_ID generates this table. Its surrogate key COMMON_POS_SK is an identity column. In the excerpt, <mart schema> stands for the placeholder of the Mart schema, and short lines are joined:
CREATE TABLE <mart schema>.DM_MD_COMMON_POS (
BG_SOURCESYSTEM VARCHAR2(255)
,BG_LOADTIMESTAMP TIMESTAMP NOT NULL
,COMMON_POS_SK NUMBER GENERATED BY DEFAULT AS IDENTITY NOT NULL
,POS_ID NUMBER NOT NULL
,CASHBOX_NO NUMBER NOT NULL
,BRANCH_ID NUMBER NOT NULL
,HUB_HK RAW(20) NOT NULL
,BG_ROWHASHSCD1 RAW(20) NOT NULL
)
;
ALTER TABLE <mart schema>.DM_MD_COMMON_POS
ADD CONSTRAINT DM_MD_COMMON_POS_PK PRIMARY KEY (COMMON_POS_SK)
RELY
USING INDEX (
CREATE UNIQUE INDEX <mart schema>.DM_MD_COMMON_POS_PK
ON <mart schema>.DM_MD_COMMON_POS (COMMON_POS_SK)
);
ALTER TABLE <mart schema>.DM_MD_COMMON_POS
ADD CONSTRAINT DM_MD_COMMON_POS_UK UNIQUE (POS_ID)
USING INDEX (
CREATE UNIQUE INDEX <mart schema>.DM_MD_COMMON_POS_UK
ON <mart schema>.DM_MD_COMMON_POS (POS_ID)
);
On Microsoft SQL Server, BG_SOURCESYSTEM and BG_LOADTIMESTAMP get the types nvarchar(255) and datetimeoffset.
Release differences
Project Settings shows the Generator Version of your project.
- Generator 2.0: first release of the configuration.
- Generator 2.2: Mart Out; the project properties Persist Validity, Create Result Views, Hash Casing, Hash Concatenation Separator, Hash Null Placeholder and Hash Trim; the model object property Increment Management Type on Mart Facts; the platform data types with length semantics and the data type validation; the replacement of characters in generated names. Up to Generator 2.0.1, precision 3 was written as
TIMESTAMP(3 WITH TIME ZONE). - Generator 2.3: the model object properties Hash Group Size and Custom Singleton Values.
- Fixes for Oracle are listed in Generators Release - 2.3.0, Generators Release - 2.4.0 and Generators Release - 2.4.1.
Related articles
- Previous: Import a Project to be used as a Linked Project
- Oracle: Target environment
- Next: Generate artifacts, Replace the placeholders in the artifacts
- Reference: Foreign Key Mode (Model Object), Partition Clause and table storage (Model Object), Hash Group Size (Model Object), Custom Singleton Values (Model Object), Create GRANTs for Imported Objects (Project), LoadControl Options (Project)
- Oracle: Placeholder values
- See also: Available Generator Configurations, Understand the Generator Configuration, Use Linked Projects, Microsoft SQL Server - Datamart
- Oracle: Stage, Data Store, DataVault, DataVault and Mart