Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   SQL Statements >

CREATE DUPLICATE

Use the CREATE DUPLICATE statement to create a duplicate copy of an existing table for read-only use in a specified dbslice or in specified dbspaces across coservers.

Only Extended Parallel Server supports this statement, which is an extension to the ANSI/ISO standard for SQL.

Syntax

Read syntax diagramSkip visual syntax diagram>>-CREATE DUPLICATE OF TABLE--table----------------------------->
 
            .-,-------.
            V         |
>--IN--+-(----dbspace-+--)-+-----------------------------------><
       '-dbslice-----------'
 
Element Description Restrictions Syntax
dbslice Name of a dbslice in which to duplicate one fragment of table Must exist and must contain at most one dbspace on each target coserver Identifier
dbspace Name of a dbspace in which to duplicate one fragment of table Must exist; must not contain an original or duplicate fragment of table Identifier
table Name of the original table from which to create a duplicate Must exist in the database. See also Supported Operations. Database Object Name

Usage

If the original table resides entirely on a single coserver, you can create duplicate copies of small tables across coservers for read-only use. For each attached index of the original table, a similarly defined index is built on each table duplicate, using the same dbspaces as the table.

Because query operators read the local copy of the table, duplicating small tables across coservers might improve the performance of some queries.

If a local copy of a duplicated table exists but is not available because the dbspace that stores it is offline (or for some similar reason), a query that requires access to the table fails. The database server does not attempt to access the original table.

The location of a duplicated table can be either a dbslice or a comma-separated list of dbspaces. You can combine dbslices and lists of dbspaces in a single CREATE DUPLICATE statement.

The first fragment of the original table is duplicated into dbsl1, which contains a dbspace on each coserver, the second fragment into dbsl2, which also contains a dbspace on each coserver, and the third fragment into the list of dbspaces.

Only one fragment of a duplicated table can reside in any single dbspace. You cannot list an existing dbspace of the duplicated table in the list of dbspaces into which it is duplicated, but it is not an error for an existing dbspace to be a member of a dbslice that specifies duplication dbspaces. Matching dbspaces in the dbslice are ignored.

The CREATE DUPLICATE statement requires the ALTER privilege.

Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]