Creating the Tables Database - Teradata Database

Teradata Database Administration

Product
Teradata Database
Release Number
15.10
Language
English (United States)
Last Update
2018-10-06
Product Category
Software

Creating the Tables Database

Use the following procedure to create the Tables Database that will contain all data tables.

1 Start Teradata Administrator and log on as user DBADMIN.

2 From the main screen, click the Preview Mode button to display generated SQL.

3 Click Tools>Create>Database. The Create Database dialog box appears.

4 Specify values for the following database parameters.

 

Syntax Element

Explanation

Database Name

Required. The name of the master database containing all tables and data.

Recommendation: Use a name that provides a hint about the function of the database, for example, Tables, Tables_Database, or TBL_DB.

Owner

Required. The name of the user or database that owns the space in which the object is being created.

Recommendation: Enter the name of the primary administrative user, DBADMIN, previously set up in “Setting Up the Database Administrator User” on page 30.

Permanent

Required. The permanent space in bytes allocated to contain tables and other objects created in the database.

Recommendation: For the Tables database, enter a value or an expression resulting in a numeric value equivalent to 80% of permanent space allocated to user DBADMIN.

If you create child databases within the Tables database, divide the Tables database perm space among them according to the size of the tables each database contains.

Note: Tables do not have perm space allocations. They automatically take the space required to contain their data from the owning database.

Spool

Recommendation: Not applicable. Queries running against the Tables database draw from the spool space available to the user.

Temporary Space

Use TEMPORARY = n BYTES to define the space allowed by default for users to create global temporary tables within this database. The default is the largest value that is less than the owner temporary space and that is a multiple of the number of AMPs in the system. n must not exceed the owner temporary space.

If no default temporary space is defined for a database, the space allocated for global temporary tables created in that database is the maximum temporary space allocated to the immediate owner of the database.

The database/user must have adequate perm space to accommodate the global temporary table header on each AMP. Table header size varies by table definition and the maximum size for a table header is 1 MB.

Account

Not applicable.

Recommendation: Specify accounts at the profile or user level. For information on using accounts, see “Working with User Accounts” on page 156.

Default Journal

The default location for journal images of tables created in the new or modified database.

Recommendation: Specify only if you use journaling. See the syntax elements Before Journal and After Journal in this table.

Comment

Optional. You can enter text to describe the database.

Before Journal

Specifies journaling for “before” change row images as follows:

  • Yes - specifies a single journal.
  • No - specifies no journal.
  • Dual - specifies dual journals.
  • These are actual journaling requirements when specified in the Create Database dialog box.

    This option is not normally specified for the initial database implementation.

    After Journal

    Specifies journaling for “after” change row images as follows:

  • Yes - specifies a single journal on a different AMP from changed row.
  • No - specifies no journal.
  • Dual - specifies dual journals.
  • Local - specifies a single journal on the same AMP as changed row. The Local option is only available for non-FallBack tables.
  • These are actual journaling requirements when specified on the Create Database dialog box.

    This option is not normally specified for the initial database implementation.

    FallBack

    Not applicable, but enabled by default. Specifies that the system will automatically create a duplicate of each table stored in the database space, to provide backup in the event of a failure.

    Recommendation: Uncheck the FallBack box. Fallback is required only for individual mission-critical tables or tables so large that their size prevents timely backup to tape or external disk.

    Note: This example is the minimum recommended specification for creating the Tables_Database. You can specify additional options later using the MODIFY DATABASE statement.

    5 Click the Create button to create the database. The Query Window displays a generated CREATE DATABASE statement similar to the following:

    CREATE DATABASE "Tables_Database" FROM "DBADMIN"
    AS PERM = 2e7 * (hashamp()+1); 
    NO FALLBACK
    NO BEFORE JOURNAL
    NO AFTER JOURNAL

    6 In the Query Window, click the Run Query button . A Query Complete message appears in the bottom left corner of the main window when the query executes.

    7 Close the Query Window and the Create Database dialog box.

    8 You can optionally create additional child databases within the Tables database to group tables by function or department, but it is not required.

    Reference Information

     

    For step...

    Information on...

    Is available in...

    All

    options for setup and operation of Teradata Administrator

    Teradata Administrator User Guide

    3 and 4

    syntax and options for:

  • CREATE DATABASE
  • DELETE DATABASE
  • DROP DATABASE
  • MODIFY DATABASE
  • SQL Data Definition Language Syntax and Examples
  • SQL Data Definition Language Detailed Topics