SQL-Width is the current SQL Width for the field listed. Max-Width represents the size of the longest piece of data in the field. If the Max Width of a field exceeds the SQL Width then this can cause problems when executing SQL queries, typically "Column in table has value exceeding its max length or precision"
DBTOOL is a character mode diagnostic tool that identifies and reports on possible record format, index space, SQL width or date issues and fixes SQL Width and index space violations.
This tool was first included in Progress 9.1D06 Service Pack, 9.1E and later and is included in the DLC/bin executables.
More menu items and reporting granularity were added in major and minor releases.
To access the DBTOOL menus, from a PROENV shell run :
$ dbtool <dbname>
The following options menu are presented by DBTOOL (OE11.4).
DATABASE TOOLS MENU
1. SQL Width & Date Scan w/Report Option
2. SQL Width Scan w/Fix Option
3. Record Validation
4. Record Version Validation
5. Read or Validate database block(s)
6. Record fixup
7. Schema Validation
9. Enable/Disable File Logging
10. Index Space Validation
11. Index Space Fixup
12. Schema Fixup
Option 1: Will report on SQL width or date violations
Option 2: Will find width violations over the specified percentage of the current maximum width, and increase the SQL width when found. (Padding % introduced in OpenEdge 10.x)
Option 3: Will compare the physical storage of the record to the schema definition and reports discrepancies.
Option 4: Will validate record schema versioning before and after the records are updated in memory by the tool
Option 5: Will validate the information in database block headers depending on the level of validation chosen
Option 6: Will scan records for indications of possible corruption. (This option was added in Service Pack 10.0B04)
Option 7: Will identify errors in schema records for word indexes (Added in 10.1A as _StorageObject Record Validation)
Option 9: Will enable or disable redirection of the tool output to a file named dbtool.out as opposed to the screen.
Option 10: Will check and report on index space allocation errors
Option 11: Will fix errors discovered with Index Space Validation
Option 12: Fixes rare types of schema corruption.
After the required Option is selected the following prompt appears:
<connect>:(0=single-user 1=self-service >1=#threads)?
- If the database is offline, select 0 to run the tool single-user,
- If the database is online, enter a value "n" to run self-service multi-threaded, where n = number of CPU's (i.e. one thread per CPU)
After a valid connection code is entered, prompts specific to the functionality of the selection appear.
- When prompted: enter a specific table number or all tables for the option to scan:
<table>: (Table number or all)?
The specific table number can be found through the following 4GL query:
FOR EACH _file WHERE _file-number > 0 AND NOT _file-name BEGINS "SYS" NO-LOCK:
DISPLAY _FILE._file-name _file-number.
- Depending on the Option selected, a prompt for the RECID may appear:
<recid>: (recid or all)?
Unless a specific recid is known from error message analysis or integrity reporting, scan all recid's.
- When prompted for the Storage Area number:
<area>: (Area number or all)?
The Storage Area Number will be for the Storage Area that houses the table that the recid(s) in the previous prompt belong to.
Given the table number for example, the related Storage Area number can be found through the following 4GL query:
FIND _Storageobject WHERE _Storageobject._object-type = 1 AND
_Storageobject._object-number = <tablenumber>.
- When a prompt for the verbosity level appears:
<display>: (verbose level 0-3)?
Use verbosity levels above 1 only if explicitly instructed by Progress Technical Support. The varying output content and file sizes based on the verbose level used against a single table are detailed in Article