The AmtReoConsole application can be used as a command-line interface to perform database reorganizations. This is useful when starting Reorganize from scripts. AmtReoConsole.exe is located in the AmtTools\Reorganize folder of the AMT environment.
| The AmtReoConsole application takes over the CLI functionality of AmtReorganize.exe. As AmtReoConsole.exe is a dedicated CLI application, the /BATCH option is no longer required. |
Usage:
AmtReoConsole.exe [/REMOVEINDEXES] [/REMOVETRIGGERS] [/FILLIDENTITYFIELDS] [/FORCEFIRSTUSER] [/FORCEAFTERTIME=minutes] [/SKIPUPDATEFLAGS] [/SKIPNULLTEST] [/CREATEEXPLAINTABLES] [/KEEPALLTABLES] [/KEEPALLSTOREDPROCEDURES] [/KEEPALLVIEWS] [/REOSERVICEADDRESS=Server:Port] [/APP=ALL|SYSTEM|appname|dbname] [/THREADS=1-8] [/ANALYZEONLY] [/WHOLETABLEUPDATE] [/LOG=logfilename] [/USEFILECONTROLLER] [/SKIPWARNINGS=T|F] [/?]
| Option | Description |
|---|---|
| /REMOVEINDEXES | All indexes are removed from the database. |
| /REMOVETRIGGERS | All triggers are removed from the database. |
| /FILLIDENTITYFIELDS | A value will be automatically assigned to an identity field in an Oracle database. This option should only be used with the utmost care. |
| /FORCEFIRSTUSER | Ensures the Reorganization will start even when there are database connections. This option should only be used with the utmost care. |
| /FORCEAFTERTIME=<number> | Forces reorganization to start after an idle time of n minutes. The default is 2 minutes. This option should be used with the utmost care. |
| /SKIPUPDATEFLAGS | Flag fields belonging to conditional logic will NOT be updated when a change in the conditional logic is found. This option should only be used with the utmost care since it leaves the index in an unknown state. |
| /SKIPNULLTEST | When a NOT NULL constraint is added to an existing field during reorganization, all existing records are scanned and filled with a non-null value. When this option is used, reorganization might fail when the NOT NULL constraint is added and records containing null values exist. |
| /CREATEEXPLAINTABLES | Explain Tables for DB2 databases will be created during the Reorganize. |
| /KEEPALLTABLES | Any tables that are no longer in the schema are retained after reorganization. It is recommended to set this option in the database definition in Control Center instead of using this command-line option. |
| /KEEPALLSTOREDPROCEDURES | Any stored procedures that are no longer in the schema are retained after reorganization. It is recommended to set this option in the database definition in Control Center instead of using this command-line option. |
| /KEEPALLVIEWS | Any views that are no longer in the schema are retained after reorganization. It is recommended to set this option in the database definition in Control Center instead of using this command-line option. |
| /REOSERVICEADDRESS=<Server>:<Port> | Connect to an Amt Reorganize Service. Using this option will automatically set the Reorganizer to batch mode. The server name and port should correspond to the values in the config file of the Reorganize service. When using this option, there is only a limited set of additional options that can be used in combination with the Reorganize Service. The working options to combine are: /BATCH All other options will be ignored in combination with this option. |
| /APP=<Name> | Name can have the following values:
|
| /THREADS=<Number> | Reorganization is executed by using the specified number of threads. Allowed values are 1 through 8. |
| /ANALYZEONLY | Performs an analysis of the database(s) and reports the differences without altering the database(s). Only available in batch mode. |
| /LOG=<logfile> | Logs messages to the specified logfile. |
| /WHOLETABLEUPDATE | When used the whole table will be updated at once instead of in blocks. In some cases this will produce a vast time advantage when reorganizing large databases. |
| /USEFILECONTROLLER | Uses the AMT Filecontroller to write log files. When this option is used, the AMT Filecontroller must be running and reachable from the AMT reorganization program. |
| /SKIPWARNINGS=T|F | This option can hide or show warning messages from the analysis phase in the reorganization process. The default setting is True (T), which hides warning messages. Example: /SKIPWARNINGS=F. |
| /? | Displays the usage message. |
| Reorganization can be a time-consuming job depending on the size and complexity of the databases. It is strongly recommended to make a backup of the database before reorganizing! |
AmtReoConsole.exe supports the following exit codes:
| Exit code | Description |
|---|---|
| 0 | Success, no error. |
| 1 | Error, no applications were defined. |
| 2 | Error, the given parameters were invalid. |
| 3 | A reorganization error has occurred, check the log for the error description. |
| 4 | Error opening the log file. |
| 5 | Unknown application defined. |
These exit codes can be accessed by using the ERRORLEVEL command in batch files.