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

SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Published
September 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
wgr1555383704548.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1144
lifecycle
previous
Product Category
Teradata Vantage™

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.