1. The primary reason why a new Schema Cache file requires rebuilding is timestamp differences.
The Schema Cache is valid only if the time stamp of the Schema Cache file matches the Schema time stamp in the database master block. If the time stamps do not match, or for some reason the Schema Cache file cannot be read, a warning message is issued and the schema is read from the database instead. Depending on the size of the schema being transmitted from database to remote client system a noticeable pause may be observed.
As a result of an outdated Schema Cache file, it is possible that one or more of the following errors will result:
CRC error in -cache <filename>. The file has been corrupted. (825)
The time stamp in the database does not match the time stamp in the -cache file: <filename>. (840)
Error while reading -cache file. ret=<return-code> errno=<errno>. (844)
Cannot find or open file <path>\<filename>.sch, errno = 2 (43)
WARNING: The -cache <filename> parameter was used. An error occurred while attempting to read the Schema Cache from the named file. The Schema Cache will be read from the database instead. (6126)
Unless there are issues reading the file, these errors indicate that the Schema Cache file (.csh) is out of date and needs to be rebuilt using the SAVE CACHE statement. This will occur when:
- Database schema has changed, for example Data Dictionary, Loading .df, Changing SQL widths with DBTOOL
- Schema permissions have changed, or
- Database dump and load has been performed involving schema definitions (not purely data)
PROCOPY/PRODB/PROREST does not require a new Schema Cache file.
2. While minor versions between the client and the cache file are allowed, major versions are not. In the event that the client version changes from that of the original cache file, the following error(s) are seen.
The file <filename> is not a valid local cache file. (823)
The Schema Cache needs to be rebuilt with the SAVE CACHE statement using the same major version as the client.
For further information, refer to the following Articles: