AMT Help Files

Command Line Interface Reorganization

The application AmtReoConsole can be used as a command-line interface to perform database reorganizations. This is useful when starting the 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 will be removed from the database 
/REMOVETRIGGERS  All triggers will be 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>  Force the Reorganization to start after an idle time of n minutes : Default is 2 minutes. This option should only 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 in the reorganize an NOT NULL constraint is added to an existing field all existing records will be scanned and filled with a not null value. When this option is used the Reorganize 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 no longer in the schema will be retained after the Reorganize. It is advised to set this option in the database definition in the Control Center instead of using this command line option. 
/KEEPALLSTOREDPROCEDURES  Any stored procedures no longer in the schema will be retained after the Reorganize. It is advised to set this option in the database definition in the Control Center instead of using this command line option. 
/KEEPALLVIEWS  Any views no longer in the schema will be retained after the Reorganize. It is advised to set this option in the database definition in the 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
/APP=<Name> (mandatory)
/ANALYZEONLY
/LOG=<logfile> (only for the client side log, the reorganize service generated its own logfile)
/?

All other options will be ignored in combination with this option

/APP=<Name> Name can have the following values:
  • ALL: All databases will be Reorganized
  • SYSTEM: The system database will be Reorganized
  • application name: The database belonging to this application will be Reorganized
  • database name: The specified database will be Reorganized, e.g. a transaction database or encryption database.
/THREADS=<Number>  The Reorganize will be executed using the specified Number of threads. Allowed values are from 1 to 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 the messages to the given 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.
/USEFILECONTROLLERUse the Amt Filecontroller to write the log files. When this option is used the AMT Filecontroller must be both running and reachable from the AMT Reorganization program in order to reorganize.
/SKIPWARNINGS=T|FThis option can hide or show warning messages from the analysis phase in the reorganize process. The default setting is True (T) which will hide the warning messages.
Example: /SKIPWARNINGS=F   
/?  Will display the Usage message. 

Reorganization can be a time-consuming job depending on the size and complexity of the databases.
You are strongly recommended to make a backup of the database before reorganizing!

 

Exit codes

AmtReorganize.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.
5Unknown application defined.

These exit codes can be accessed by using the ERRORLEVEL command in batch files.