11.7.2 Migration procedure
(1) Execute the database structure modification utility
The alter HiRDB mode to parallel statement of the database structure modification utility (pdmod command) is used to modify the RDAREAs for the HiRDB/Parallel Server. For examples of using this utility, see the manual HiRDB Version 8 Command Reference.
(2) Terminate HiRDB normally
The pdstop command is entered to terminate the HiRDB/Single Server normally (the termination must be a normal termination).
(3) Set up the HiRDB/Parallel Server environment
The HiRDB/Parallel Server environment is set up. For details on HiRDB/Parallel Server environment setup, see the manual HiRDB Version 8 Installation and Design Guide.
The following points should be noted about environment setup:
- A different HiRDB directory must be used than the one for the HiRDB/Single Server.
- The system files for the HiRDB/Single Server must not be used; new system files must be created for the HiRDB/Parallel Server.
- The server machine used by the HiRDB/Single Server (existing server machine) must be defined as the dictionary server.
(4) Migrate the user RDAREAs, user LOB RDAREAs, and list RDAREAs to the other server machine
At this point, the user RDAREAs, user LOB RDAREAs, and list RDAREAs are still at the server machine used for the HiRDB/Single Server (existing server machine). There are two ways to migrate the user RDAREAs, user LOB RDAREAs, and list RDAREAs to the other server machine:
- Using HiRDB operation commands
- Using OS commands
(a) Using HiRDB operation commands
RDAREAs can be migrated in units of HiRDB file system areas or in units of HiRDB files by using HiRDB operation commands.
Figure 11-3 shows the procedure for migrating RDAREAs to another server using HiRDB operation commands.
Figure 11-3 Procedure for migrating RDAREAs to another server using HiRDB operation commands
![[Figure]](figure/zu110050.gif)
- Rules and notes on migration
- The HiRDB identifier cannot be changed (the value of pd_system_id in the system common definition cannot be changed).
- The HiRDB file system areas must be created in the target server machine under the same names as were used in the source server machine.
- The lengths of the HiRDB file system areas in the target server machine must be set so as to be equal to or greater than the lengths of the HiRDB file system areas in the source server machine.
- When a HiRDB file is restored, the HiRDB file system area created in the target server machine must be large enough to store the file.
- The HiRDB file system areas in the source server machine should not be deleted immediately after migration has been completed. Startup and operation of the HiRDB/Parallel Server should be checked before the HiRDB file system areas are deleted from the source server machine.
(b) Using OS commands
The following OS commands can be used to migrate RDAREAs to another server machine:
- tar or cp command
- rcp command
RDAREAs can be migrated in units of HiRDB file system areas by using OS commands.
- Using the tar or cp command
- Figure 11-4 shows the procedure for migrating RDAREAs to another server machine using the tar or cp command.
Figure 11-4 Procedure for migrating RDAREAs to another server machine using the tar or cp command
![[Figure]](figure/zu110060.gif)
- Notes
- The HiRDB file system areas must be created in the target server machine under the same names as were used in the source server machine.
- If a file to be migrated is a character special file, the partition size in the target server machine must be set to be equal to or greater than the partition size in the source server machine.
- The HiRDB file system areas in the source server machine should not be deleted immediately after migration has been completed. Startup and operation of the HiRDB/Parallel Server should be checked before the HiRDB file system areas are deleted from the source server machine.
- Using the rcp command
- Figure 11-5 shows the procedure for migrating RDAREAs to another server machine using the rcp command.
Figure 11-5 Procedure for migrating RDAREAs to another server machine (using the rcp command)
![[Figure]](figure/zu110070.gif)
- Notes
- The HiRDB file system areas must be created in the target server machine under the same names as were used in the source server machine.
- If a file to be migrated is a character special file, the partition size in the target server machine must be set to be equal to or greater than the partition size in the source server machine.
- The HiRDB file system areas in the source server machine should not be deleted immediately after migration has been completed. Startup and operation of the HiRDB/Parallel Server should be checked before the HiRDB file system areas are deleted from the source server machine.
(5) Start HiRDB normally
The pdstart command is entered to start the HiRDB/Parallel Server normally.
(6) Re-create the stored procedures and stored functions
If stored procedures and stored functions (stored functions for user-defined functions) have been created, ALTER ROUTINE must be used to re-create them.
This step is necessary because when a HiRDB/Single Server is migrated to a HiRDB/Parallel Server, the existing stored procedures and stored functions are no longer valid.