17.00 - Example: Creating a Database with Fallback and Journaling - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Release Date
September 2020
Content Type
Programming Reference
Publication ID
B035-1144-170K
Language
English (United States)

The following request creates a database named personnel from database administration:

    CREATE DATABASE personnel FROM administration
    AS PERMANENT = 5000000 BYTES, FALLBACK, BEFORE JOURNAL, 
    DUAL AFTER JOURNAL, DEFAULT JOURNAL TABLE = personnel.fin_copy;

The FALLBACK keyword specifies that for each table created in the personnel database, the default is to store a secondary, duplicate copy in addition to the primary copy.

The JOURNAL option specifies that the default journaling for each data table is to maintain a single copy of the before change image and dual copies of the after change image. A duplicate before change image is maintained automatically for any table in this database that uses both the fallback and the journal defaults.

The DEFAULT JOURNAL TABLE clause is required because journaling is requested. This clause specifies that a new journal table named fin_copy is to be created in the new database.

Permanent journaling is activated because you specified the BEFORE JOURNAL and AFTER JOURNAL options. Either option, by itself, is sufficient to activate journaling.