Automating user credentials definition

The --to-file option allows to create credentials into a temporary file of his choice, and the --import-credentials option allows to import credentials from such temporary file into the db2hpu.creds configuration file.

About this task

One can temporarily create credentials into a file of his choice. Once the credentials are created into such a separate file, one can then import them automatically from this file to the db2hpu.creds configuration file, without any interactive prompting. This offers the ability of automating the credentials creation.

Procedure

  1. If the db2hpu.creds configuration file and its directory do not already exist, a manual creation is necessary before starting the procedure.
  2. Run Optimâ„¢ High Performance Unload with the --credentials command-line option, and the --to-file command-line option. You can specify to the --credentials command-line option one of the types supported. You need to specify to the --to-file command-line option the name of a file where the credentials are going to be stored. This step is an interactive one, where the same information as the one needed for the standard credentials creation must be typed. For example: db2hpu --credentials local --to-file mycreds.txt
  3. Run Optim High Performance Unload with the --import-credentials command-line option. You must specify to the --import-credentials command-line option the name of the file passed to the --to-file command-line option during the previous step. For example: db2hpu --import-credentials mycreds.txt

Results

The credentials are first added into the temporary file chosen, and then they are imported from this file into the db2hpu.creds configuration file.