datamaint - Data Maintenance

datamaint --auditsnapshot -V|-U|-F|-H [-cdtrACS] [-n NN][-f filter] [-w workFileName] dataArea [businessClass]

datamaint --effectivedatedrpt -H [-f filter] -[dt] dataArea [businessClass]

datamaint --encryption -V|-U|-H [-f filter] -[Fdt] dataArea [businessClass]

datamaint --modifylist [-H] [-od] dataArea actor businessClass list [targetActor]

datamaint --baddata -V|-U [OPTIONS]

datamaint --auditcorrections -V|-U|-F|-H [-dtr] [-n NN] [-f filter] [-w filename ] dataArea [busClass]

The datamaint utility provides several specialized functions for verifying and correcting system data, including

Maintaining Audit Snapshot Data

Audit snapshot data is the supplemental data for the auditing and effective dating feature. Auditing and effective dating information is stored on each business object whose business class implements the auditing and/or effective dating patterns.

To maximize runtime efficiency, audit snapshot data is stored in a different form than business class data. This utility allows a Lawson administrator to verify whether the audit snapshot data is in sync with the auditing and effective dating logs, and correct any inconsistencies that might occur. The datamaint utility is often used as part of an upgrade or update in order to verify the integrity of any changes to the data that occurred as part of the update or upgrade.

You can also use the datamaint utility at other times to verify the aspects of the data covered by this utility. A typical sequence would be to run datamaint with the --auditsnapshot option in the verify mode, examine the log files that are created, and then run the appropriate updates. For example, you can run datamaint -–auditsnapshot for a single business class if that is all that needs fixing. You can also run datamaint -–auditsnapshot without the -c option if the log file indicates no Current Row/AuditLog mismatches that need fixing.

You can find log files at

%LALOGDIR%\datamaint\auditsnapshot.log.dataArea.Stamp

To maintain audit snapshot data, use the following command syntax:

datamaint --auditsnapshot -V|-U|-F|-H [-cdtrACS] [-n NN] [-f filter] [-w workFileName] dataArea [businessClass]

Program Option Description
-A Perform a data type validation against all persistent audited fields. For example, an audited date value of "02190202" would be reported as an invalid date as it is outside the common date range of "18000101" and "21991231". This option is only valid if the -V option is also specified.
-V Validate that snapshot data is in sync with auditing and effective dating logs.
-U Update snapshot data from auditing and effective dating logs if out of sync.
-F Program Option Force delete and recreate of all snapshot data. This option acquires exclusive lock on the data area.
-H Access help for this command.
-r Prompt for repeat when done.
-d Show more detailed output.
-t Show terse output (default).
-c Correct or verify current row/audit view inconsistencies (this is the default for validate mode).
-C Do NOT correct or validate current row/audit view inconsistencies (this is the default for an update mode).
-S Do NOT correct or validate snapshot data.
-n NN Use multiple concurrent threads when running datamaint. This is useful if you have multiple CPUs available.
-f filter Filter criteria. (Valid only when business class is specified.)
-w workFileName Process the business classes listed in the specified work file.
dataArea Select a data area to work with.
businessClass Select a specific business class to work with.

Reporting on Effective Dated Changes

You can generate a report listing business objects that have pending future dated changes. The report lists the primary key of the object that has pending changes, the number of pending changes, and when the first pending change will apply.

This utility only takes action on data in business classes that use the implement Effective Dated pattern.

You can find log files at

%LALOGDIR%\datamaint\effectivedatedreport.log.DataArea.Stamp 

To run the effective dated report, use the following command syntax:

datamaint --effectivedatedrpt -H [-f filter] -[dt] dataArea [businessClass]

Program Option Description
-H Access help for this command.
-d Show more detailed output.
-t Show terse output (default).
-f filter Filter criteria. (Valid only when business class is specified.)
dataArea
businessClass Select a specific business class to work with.

Maintaining Encrypted Data

You can verify or update the encryption status for data belonging to a business class that implements the Encrypted LPL pattern. This type of encryption is managed by the application layer, rather than the database interface layer, thus requiring an action other than a database reorganization to implement changes. Select a data area to work with.

This utility only takes action on data in business classes that use the implement Encryption pattern.

You can find log files at

%LALOGDIR%\datamaint\encryptionmaint.log.DataArea.Stamp

To maintain encrypted data, use the datamaint command with the following command syntax:

datamaint --encryption -V|-U|-H [-f filter
                    Select a data area to work with.] -[Fdt] dataArea [businessClass]
Program Option Description
-V Validate encryption condition in sync with the state of the business object.
-U Update encryptable fields if out of sync.
-F Force update of encryptable fields.
-H Access help for this command.
-d Show more detailed output.
-t Show terse output (default).
-f filter Filter criteria. (Valid only when business class is specified.)
dataArea Select a data area to work with.
businessClass Select a specific business class to work with.

Propagating User List Modifications

You can propagate user list modifications from one user to other users. The --modifylist option enables a specific actor's UserList modifications to be cloned to another actor or all other actors. List modifications are stored in the UserList business class of the module repository. Lists already modified by a targetActor are skipped if -o is not specifie. If targetActor is not specified, the list modifications are cloned across all actors. Wildcards are accepted for businessClass and/or list (for example, datamaint --modifylist MyDataArea Fred "*" "*" Bob).

datamaint --modifylist [-H] [-od] dataArea actor businessClass list [targetActor]

Program Option Description
-H Access help for this command.
-d Show more detailed output.
-o Overwrite existing list modifications (skipped by default).
dataArea The data area the user list modifications apply to.
actor The actor (user) whose list modifications you want to clone.
businessClass The specific business class(es) to work with.
list The user list you want to clone.
targetActor A specific actor (user) whose lists you want modified with the source actor's list modifications. If no targetActor is specified, the list modifications are cloned across all actors.

Verifying/Updating Field Data for SQL Portability

User this datamaint option to verify and update field data so that it can ported to an SQL database. By default, this option identifies embedded NULLs in alpha and text fields, and replaces these with u+0020. You can also supply regular expressions to identify other bad data in alpha and text fields.

To verify or update field data for SQL portability, use the datamaint command with the following command syntax:

datamaint --baddata -V|-U [OPTIONS] dataarea [busClass ...]

datamaint --baddata -V|-U [OPTIONS] --prodline prodLine [busClass ...]

datamaint --baddata -V|-U [OPTIONS] --tenant tenant [busClass ...]

datamaint --baddata -V|-U [OPTIONS] --all [busClass ...]

datamaint --baddata -H

Program Option Description
-V Verify field data (no update).
-U Update field data for SQL portability.
-H Access help for this command.
dataarea Run this datamaint option for the specified data area.
--all Run this datamaint option for all active data areas.
--prodline prodLine Run this datamaint option for all active data areas within the specified product line.
--tenant tenant Run this datamaint option for all active data areas within the specified tenant.
businessClass Specify a specific business class to work with.
--badalphafilter STRING To identify bad characters in alpha fields, specify a quoted regular expression filter (for example, ".[^\p{Graph}\u0020]"). The default is ".[\u0000]".
--badtextfilter STRING To identify bad characters in text fields, specify a quoted regular expression filter (for example, ".[^\p{Graph}\u0020\t\n\r]"). The default is ".[\u0000]".
-d FILE_PREFIX or --dump FILE_PREFIX Specify a prefix for the name of the zip file to dump bad records to. For example, if you specify baddata as the prefix, the file name will be baddata_<dataArea>.zip.
--filter STRING If you want to filter which data to run this datamaint option against, specify a filter expression.
--nonulldetectoptimize Do not optimize the detection of embedded NULLs via database level filtering.
--quiet Show only errors
--replacecharhex HEX If you want to replace bad characters with a different value than the default of u+0020, specify that hex value.
--showbadchar Send message with unicode value of each bad character to stderr (not logged).
--skiplobs

Do not check LOBs

--threads=N

Maximum active threads for processing, for example, --threads=3. If you use multiple threads, you may see a performance improvement. However, performance depends on other factors as well. Note that a very large table will be processed in a single thread.

The default number of threads is four.

-v displayoptions

errorlevel, tracelevel, and verbose specified in any order, where:

  • errorlevel = {n}none | {f}atal | {e}rror | {w}arning (warning is the default)

  • tracelevel = 0:6 where 0 is no message and 6 is everything

  • verbose = whether to display exception stacktrace

Maintaining Audit Corrections Data

This datamaint option provides the ability to validate and/or update incorrectly applied future audit corrections data. If the data is out of sync, data visability issues can arise. This utility allows a Lawson administrator to verify whether the audit correction data is in sync and correct inconsistencies if they exist.

After running the verification you can scan the LALOGDIR/datamaint/auditcorrectionmaint.log.XXX that was produced to identify specific business classes that need updates. The datamaint --auditcorrections also accepts a '-W workfile' argument where you can create a file with a list of business classes to process. If the verify identifies more than a couple than it may be easier to create a workfile instead of running the update on each individual business class.

Program Option Description
-H Access help for this command.
-V Validate snapshot data is in sync with Auditing and Effective Dating logs.
-U Update snapshot data from auditing and effective dating logs if out of sync.
-r Prompt for repeat when done
-d Show more detailed output.
-t Show terse output (default),
-n NN Number of concurrent threads. The default is 4.
-f filter Filter criteria to use (only valid if business classes specified).
-w filename A file containing a list of business classes to process.
dataarea
businessClass The specific business class(es) to work with (comma separated).