When does PROSTRCT REPAIR need to be run?
- When a database is moved or copied to a new file system or location, or database extents need to be moved to disks with more space, so that the directory structure is updated.
- To unlock old shared memory references in the database Master block or Before image file(s) point to memory which is now in use by one of the other databases running on the same machine, error "Shared memory in use by another process. (1260)"
What does PROSTRCT REPAIR do?
- The database structure is written into the Control Area .db file for the database.
- The structure description file (.st) is the text-file representation of the database structure that is saved in the .db file.
- The .db file, or database Control Area, acts as a table of contents for the database engine, listing the name and location of every Area and extent in the database.
- When a database is moved using operating system utilities, the .db file must be updated accordingly.
- The .db file is updated running prostrct repair.
- PROSTRCT repair uses a .st file to update the location of extent files.
PROSTRCT REPAIR does not:
- Initiate crash recovery
- Disable After-imaging
- 'Repair' anything but the database structure on disk.
How to run PROSTRCT REPAIR:1. Run
prostrct list to obtain an up-to-date structure file (.st).
Example:
$ prostrct list mydb temp.st
2. Backup the database, using probkup or system utilities.
3. Use Operating System or 3rd Party Software to move the database files to the new locations.
4. Edit the database structure file to reflect the paths to the database files. Change all path references in the .st file to reflect the fully qualified new location paths where the database files will be moved to, or more precisely their fully qualified current locations on disk even if they have not been moved. This is important!
In the above example, edit the
temp.st file.
5. Run
prostrct repair using the edited .st file to update the database structure.
Example:
$ prostrct repair mydb modified-temp.st
6. Run
prostrct list again to verify the paths to the database files are correct.
Example:
$ prostrct list mydb new-temp.st
It is advised to test the steps first using a copy of sports2000 or sports2020.