NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
A-35
Considerations—ALTER TABLE
reuse-spec
specifies FIRST KEY for a partition reused with the ADD PARTITION clause.
The FIRST KEY clause specifies the primary or clustering key values for the first
key allowed in a reused partition of a table with key-sequenced file organization. It
is required for key-sequenced files. val is a list of comma-separated literals (one for
each column in key) that specifies the beginning key value for the partition to be
reused.
Considerations—ALTER TABLE
Authorization and access requirements
To alter a table or partition, you must be a generalized owner of the table or
partition. In addition, you must have authority to read and write to the affected
catalogs. For a partitioned table, affected catalogs include all catalogs that describe a
partition of the table or that will describe a new partition of the table as a result of
the ALTER TABLE operation.
ALTER TABLE executes only if the specified table or partition is available. Unless
you are altering file attributes for a partition, all partitions of the table must be
available.
Only one DDL statement can operate on a given SQL object (or partition of an SQL
object) at a time. An error occurs if you attempt to execute an ALTER TABLE
statement while another process is executing a DDL operation on the same object.
The specific error depends on the DDL operation involved and the phase of the
operation at which the conflict occurs. (See DDL (Data Definition Language)
Statements on page D-19 for more information.)
Additional authorization and access requirements that exist for some ALTER
TABLE operations are described in the following subsections.
Renaming tables
°
To rename a table, you must have authority to read and write to the catalogs that
describe the views, indexes, programs, and collations associated with the table,
as well as to the catalog that describes the table.
°
Renaming a table invalidates all programs dependent on the table.
°
You cannot rename a table within a user-defined transaction.
Altering file attributes for tables
°
To alter security attributes for a table, the table and any indexes and protection
views defined on the table must be accessible.
°
Changing either the SECURE or OWNER attribute of a table can affect
processes using the table when the change occurs. ALTER TABLE closes the
table to make the change. Other SQL processes using the table attempt to reopen
it after the change, but the new attribute values can prevent such processes from
doing so.