WORKAROUND #1:1.) Ensure that a valid structure file exists where:
- The dbname.db file resides in the same directory as the dbname.st structure file
- The structure file lists fully qualified paths, describing every extent that should be in place on disk including all the bi and ai extents.
Run:
prostrct list dbnameView the output of
dbname.st in a text editor
2.) If the bi extents are still present, remove them then replace the bi extent(s) with placebo bi extents. The prostrct unlock utility uses the information in the dbname.st file, which is a reflection of the information in the database control area (dbname.db) to re-create them.Run:
prostrct unlock dbname -extentsAnswer "y" (without quotes) to skip crash recovery
For each bi extent messages similar to the following will result
Processing extent: <fullpath>\<dbname>.b1 size: <size>
** Cannot find or open file <full path>\<dbname>.b1, errno = 2. (43)
WARNING: Database is damaged, missing extent file <full path>\<dbname>.b1. (1990)
3.) Force crash recovery again:
Run:
proutil dbname -C truncate bi -FWORKAROUND #2:The workaround involves creating a new database from an empty database and then creating the missing bi files. Once created, these files will be used as a replacement for the missing bi files.
1.) Take an OS backup of the database before proceeding. This backup can be used to restore from if problems arise with this workaround.
2.) Create a new database to mirror the existing database:
a. Copy the existing
dbname.st file to
newdbname.st file.
b. Replace the "dbname" in the newdbname.st file with the newdbname.
c. Create a void database:
prostrct create newdbname newdbname.st -blocksize (same blocksize as original dbname).
d.
procopy <DLC>/emptyN newdbname N = block size used above.
Example: if -blocksize 8192 was used to create the void database:
$ procopy <DLC>/empty8 newdbname 3.) Once the new database has been created, copy the "
newdbname.b1" file to replace the missing/existing
dbname.bi file. During the copy, rename the file to the name of the original database. Example:
copy newdbname.b1 dbname.b1 If there was more than 1 bi file, copy all of the bi files from newdbname to dbname in order to fully recover the extents.
4.) Once the new bi extent is in place, run "
prostrct unlock" to fix the timestamp differences:
Command:
prostrct unlock dbnameFor each bi extent, a messages similar to the following will result confirming the timestamp inconsistency corrections:
Processing extent: ./dbname.b1 size: 0
Inconsistency: dbname last opened Mon Jun 13 13:54:04 2008
./dbname.b1 last opened Mon Jun 13 13:54:04 2008. (6948)
1 inconsistency(ies) fixed. (6951)
5.) Force into the database. The new bi exents have no relation to the current database. The force option without the -G needs to be specified. (This option will then cause the Forced Flag to be set on the database)
Command:
proutil dbname -C truncate bi -F After applying either of the above Workarounds, the database should be accessible.
To validate that the database was not damaged as a result of the PROSTRCT UNLOCK or the forcing into the database, scan the database using the instructions provided in the Article
What tools / utilities can I run to check the integrity of a database or check for corruption? It is strongly recommended that a dump and load operation is considered at the next convenience.