Reorganizing the Database from the Command Line

You can use the jadclient non-GUI client application executable to automate the reorganization of one or more user‑defined schemas, passing command line arguments after the startAppParameters parameter to specify your reorganization requirements.

For details about the jadclient non‑GUI client application, see "Running a Non-GUI Client Application using jadclient", in Chapter 1 of the JADE Runtime Application Guide.

If the restarting of a reorganization fails, you must abort the reorganization before you can initiate an new reorganization.

To reorganize schemas as a non-GUI application, specify the following arguments in the jadclient program.

jadclient path=database-path
          [ini=jade-initialization-file]
          [server=multiUser|singleUser]
          schema=RootSchema
          app=JadeReorgApp
          startAppParameters
          [action=reorganization-action
          [reorganization-arguments]]

The non-GUI client program arguments are described in the following subsections. When specifying reorganization arguments:

The jadclient program treats processing arguments enclosed in double ("") or single ('') quotation marks after the startAppParameters argument as single-string entries in the HugeStringArray. The handling of strings in this HugeStringArray is application‑specific. For example, dir=program files is treated as a two‑string entry and dir="program files" is treated as a one‑string entry. How these entries are handled is determined by your application.

The following is an example of the command prompt that runs a non-GUI client application to initiate a replayable reorganization of all schemas in the database. The reorganization is suspended before initiating the transition.

jadclient.exe path=c:\jade\system ini=c:\jade\system\jade.ini server=multiUser 
app=JadeReorgApp schema=RootSchema startAppParameters action=initiateReorgAllSchemas waitForReorg=true initiateTransition=false replayableReorg=true reorgAllowUpdates=false noReorgRecovery=true fastBuildBTreeCollections=false

The following example resumes the reorganization process by initiating the transition following a prior reorganization action with initiateTransition set to false.

jadclient path=c:\jade\system server=multiUser schema=RootSchema app=JadeReorgApp startAppParameters action=initiateTransition

The following is an example of the command prompt that runs a non‑GUI client application to initiate a reorganization of all schemas requiring reorganization and that are waiting for the reorganization to complete.

jadclient path=c:\jade\system server=multiUser schema=RootSchema app=JadeReorgApp startAppParameters action=initiateReorgAllSchemas

The following is an example of the command prompt that runs a non‑GUI client application on the primary database to restart server applications on secondary databases. You could do this when such server applications have been shut down on the secondary database because a change has been made in a primary database to a class with no persistent instances in the JADE development environment or by using the Schema Load utility (that is, the jadload or jadloadb program) with the Only Structural Versioning load style.

jadclient path=c:\jade\system ini=s:\jade\system\jadesds.ini server=multiUser schema=RootSchema app=JadeReorgApp startAppParameters action=auditEnableSecondaryApps

The following is an example of the command prompt that runs a non‑GUI client application to initiate the offline phase of the reorganization on the primary system.

jadclient path=c:\jade\system ini=c:\jade\jade.ini server=singleUser schema=RootSchema app=JadeReorgApp startAppParameters action=initiateManagedTransition

The JadeReorgApp application returns an error code if the command line is invalid. This value corresponds to exception 1407 (Invalid argument passed to method). You can obtain the invalid argument in a script by using the status returned from the invocation of the jadclient non-GUI client application.