SQL/MX 3.2.1 Management Manual (H06.26+, J06.15+)
ALTER DISK, ALTNAME and ALTER DISK, VOLNAME
CAUTION: ALTER DISK, ALTNAME and ALTER DISK, VOLUME are extremely dangerous commands
because they can corrupt a database. Before using an ALTER DISK command, perform a
STOPOPENS DISK and a CONTROL DISK, REFRESH on the volume to ensure valid file labels, and
then perform a STOP DISK to make the volume inactive.
The ALTER DISK operation renames the files on a volume, but SQL/MX metadata and file labels
still contain the old names. Use it only on disks that contain SQL/MX objects. ALTER DISK should
be used only for volumes that do not contain SQL/MX objects.
If a volume is renamed inadvertently, reissue the command to rename the volume to its previous
name. If this is not possible, recover the volume only if all the objects on the renamed volume are
described in catalogs on the same volume. If this is the case, use BACKUP and RESTORE to back
up the volume:
1. Identify all the SQL/MX objects to be renamed and all dependencies. Produce hard-copy
reports containing this information.
2. Create an EDIT file containing CREATE CATALOG and ALTER TABLE statements to re-create
the catalogs and reset the security of the catalog tables.
3. Back up the volume by using a file-mode BACKUP command.
4. Use ALTER DISK, ALTNAME to rename the disk. You might first want to label the disk with
ALTER DISK, LABEL to clear the old files.
To restore files:
1. Re-create the catalogs on the renamed volume by using the file created in Step 2 as the input
file for the MXCI OBEY command.
2. Restore the files to the disk volume, mapping the old volume names to the new volume names
in the RESTORE command.
3. Map the objects to the new catalogs.
4. Verify the database by using the mxtool VERIFY utility. For more information, see the SQL/MX
Reference Manual.
5. SQL compile all programs with new DEFINEs to revalidate the programs. For more information,
see the SQL/MX Programming Manual for C and COBOL.
ALTER DISK, LABEL
CAUTION: ALTER DISK, LABEL use is extremely dangerous because it can corrupt a database.
Before using an ALTER DISK command, perform a STOPOPENS DISK and a CONTROL DISK,
REFRESH on the volume to ensure valid file labels. Then perform a STOP DISK to make the volume
inactive. Do not use this command on disks containing SQL/MX objects, with a few exceptions.
You can safely use ALTER DISK, LABEL on disk volumes with SQL/MX objects in these situations:
• To label a disk that has been destroyed and has completely corrupt data
• To label all the disks on a node and recover the database with a complete restore
• To label a disk following repair or replacement if a volume with SQL/MX objects has a
catastrophic failure and no mirrored volume is available. In this situation, you should label
the disk with its previous name.
To recover the volume with the ALTER DISK, LABEL command:
1. Retrieve the tables by using the latest TMF online dumps and TMF file recovery. To initiate a
file recovery of all files on $VOL, enter this command through one of the TMF interfaces (this
example uses TMFCOM):
264 Performing Recovery Operations










