SQL/MP Installation and Management Guide
Moving a Database
HP NonStop SQL/MP Installation and Management Guide—523353-004
9-22
Moving Indexes
specify the VIEWS EXPLICIT option, the view is moved. If the file set list does not
include the view but you do specify VIEWS EXPLICIT, the view is not moved
automatically. You can specify not to automatically duplicate views with the underlying
table by including the VIEWS OFF option.
The BACKUP and RESTORE utilities always move protection views when moving the
underlying table. Shorthand views are not automatically moved unless they are
explicitly named in the file set list. No options apply to BACKUP and RESTORE to
restrict the automatic move of protection views with the underlying table.
In cases where you need to move a large number of views, it will be easier for you to
create the views on the target instead of using the BACKUP and RESTORE utilities to
move them.
Invalid Views
The possibility that a shorthand view definition might refer to tables or views that have
not yet been moved to the new location means that the view definition might be
created but marked invalid. After all the objects have been moved, the utilities attempt
to make the view valid. If the utility does not complete for any reason or if you specified
an invalid mapping scheme, a view might be left in an invalid state. If a view is invalid
after a move operation, you must drop the view and re-create it. For more information
about invalidity, see Program Validity on page 10-1.
If you want to move a view to a new subvolume on the same volume or rename a view,
use the ALTER VIEW statement with the RENAME option. This approach alters the
directory entry and all associated catalog references to the view.
Shorthand views and protection views contain no physical data; therefore, there is an
easy way to move the view: re-create the view definition at the new location,
registering the view in a catalog, then drop the view definition at the old location.
Example
This example moves a view by re-creating the view in a new location and then
dropping the old view:
>> CREATE VIEW new-view ...;
>> DROP VIEW old-view;
Moving Indexes
An index moves with the underlying table. The DUP utility and the BACKUP/RESTORE
utilities enable you to move the underlying table and indexes to a new location by using
the MAP NAMES option. You can move an index on the same volume with the ALTER
INDEX RENAME statement. Furthermore, you can move an index to another volume
by re-creating the index on the target volume with the CREATE INDEX statement and
then dropping the index from the source volume with the DROP statement.