Feedback
Did this article resolve your question/issue?

   

Article

PROSTRCT STATISTICS fails with error 6939

« Go Back

Information

 
TitlePROSTRCT STATISTICS fails with error 6939
URL NamePROSTRCT-STATISTICS-fails-with-error-6939
Article Number000116483
EnvironmentProduct: OpenEdge
Version: 10.x, 11.x, 12.x
OS: All supported platforms
Question/Problem Description
PROSTRCT STATISTICS fails with error 6939 on a specific Area then stops
_Dbstatus query with "FIND FIRST/LAST" ABL statement fails with error 565
Managed databases throw error 12109 every poll when the OEM getStatistics routine fails to read from _Dbstatus due to the schema denied error
_area reports more extents than _areaextent 
_area and _areaextent system table reports should not be mismatched
PROSTRCT LIST screen output shows more extents than those written to the structure file: dbname.st
Steps to Reproduce
Clarifying Information
The database runs in production mode without any issues relating to database area extent structure
DBANALYS runs without error
A full PROBKUP online or offline succeeds without reporting block corruption
AIMGT manages ai file switching and archiving without issue
Replication ai transaction notes process to the target database without issues
PROSTRCT adds new extents online or offline to the database
PROSTRCT LIST runs without error
Error MessageError getting control area extent descriptor. (6939)

Unable to retrieve statistics for database <database>. Error: Schema denied for database <database> / table _DbStatus (12109)

** FIND FIRST/LAST failed for table _DbStatus (565)
Defect Number
Enhancement Number
Cause
The Control Area is corrupt. 

This is most likely a consequence of extents being added in the past, when the operation was cancelled of failed.

The following code verifies Control Area corruption, when _area <> _areaextents
DEFINE VARIABLE i AS INTEGER NO-UNDO.

FOR EACH _area NO-LOCK:
    i = 0.
    FOR EACH _AreaExtent OF _area NO-LOCK:
        i = i + 1.
    END.
    
    IF (i < _Area._Area-extents) THEN DO:
        MESSAGE "ERROR: Number of extents for this area **invalid** :"
        _Area._Area-extents i SKIP
        _Area-Name
        _Area-extents
        VIEW-AS ALERT-BOX INFORMATION BUTTONS OK.
    END.
    
    ELSE DO:
        MESSAGE "Number of extents for this area are valid:"
        _Area._Area-extents i  _Area-Name
        VIEW-AS ALERT-BOX INFORMATION BUTTONS OK.
    END.
END.

 
Resolution
It is advised to upgrade to OpenEdge 12.3, 12.2.1.0, 11.7.7.0 or later where databases have many tables and or indexes in Type II storage areas before running the area statistics report. Further information is provided in the following Article: 

New Area extents can be added once the Database Control Area is repaired.

  • OPTION 1:  Restore a Backup to rebuild the Control Area

PROREST functionality by definition allows a database to be restored to a new database structure. As part of the restore operation, the Control Area is rebuilt and associated meta-schema tables are updated accordingly: _fileList, _area, _areaextent, _dbstatus
  • OPTION 2:  Repair the database structure (Control Area).

Rebuild the database Control Area offline with: PROSTRCT BUILDDB. 
  • Reparing the database structure disables after-imaging. If Replication is enabled, disablesitereplication before repairing the Control Area. For further details refer to Article  What effect does builddb have on a replication enabled database? 
  • Before running BUILDDB, ensure a structure file contains the full paths of all active extents.
  • The filename of the structure file must be the <databasename>.st
$   mv dbname.db dbname.db-OLD
$   prostrct dbname builddb dbname.st

For detailed instructions refer to Article: 

New Area extents can be added out of file number sequence until the Database Control Area is repaired 

Until downtime can be scheduled, new extents can be added to the database by not specifying the extent numbers in the structure file (.st). New extents numbers will be automatically assigned based on the current area/extent structure configuration.  For detailed instructions refer to Article: 
Workaround
Notes
Last Modified Date10/27/2021 4:40 PM
Attachment 
Files
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.