IBM Support

How to recreate the PostgreSQL database in IBM Sterling Connect:Direct for Microsoft Windows

How To


Summary

IBM Sterling Connect:Direct for Microsoft Windows installs PostgreSQL as its default database. This document provides instructions to recreate the PostgreSQL database if required, for example, if the database has become corrupted or the database password has been lost.

Objective

Create a new PostgreSQL database and configure IBM Sterling Connect:Direct for Microsoft Windows to use the new database.

Steps

NOTICE: These instructions will delete the existing database causing all statistics and processes on the TCQ to be lost. Take a backup, if needed.
The below commands use different values dependent on your version and setup of IBM Sterling Connect:Direct for Microsoft Windows. Replace <vrm> in any command with  the value that matches the version that you have installed (e.g. 6.4.0). See the table below for default values.
  1. Open a Command Prompt as Administrator (Run as Administrator).
  2. Stop the Connect Direct service.
    net stop "Connect Direct v<vrm> - <cdnode>"
  3. Stop the PostgreSQL - Connect Direct service.
    net stop "PostgreSQL - Connect Direct v<vrm>"
  4. Delete the PostgreSQL\data directory. Do not delete any other PostgreSQL directory.
    rmdir /S /Q "<cddir>/PostgreSQL/data"
  5. Run the CD Database Wizard to recreate the PostgreSQL database. Wait for the command to complete.
    start "DBWiz" /w "<cddir>\Server\DBWiz.exe" /Q /BCDWINNT /IPOSTGRESQL /N<cdnode> /Vv<vrm> /S127.0.0.1 /R<dbport> /D /U<dbuser>
  6. Verify that the PostgreSQL\data directory has been created again. Review "<cddir>\Server\DBWizTrace.log" and look for this message with "rc 0". Any other rc value indicates that the database has not been initialized successfully.
    CDBWIZApp::InitDb Exited with rc 0
  7. Run the CD Message Import Utility to reload the message table. Wait for the command to complete.
    start "MsgImp" /w "<cddir>\Server\MsgImp.exe" /Q /I
  8. Stop the PostgreSQL - Connect Direct service.
    net stop "PostgreSQL - Connect Direct v<vrm>"
  9. Change permission and ownership of the PostgreSQL\data directory and all subfolders to SYSTEM.
    icacls "<cddir>\PostgreSQL\data" /grant SYSTEM:F /T
    icacls "<cddir>\PostgreSQL\data" /setowner SYSTEM /T
  10. Start the Connect:Direct node and verify it is working properly, for example, by running a process script and viewing the statistics.
Default values

CD Version
<vrm>

CD Installation Directory
<cddir>

Database Port
<dbport>

Database User
<dbuser>

CD Node Name
<cdnode>

6.1.0 C:\Program Files\IBM\Connect Direct v6.1.0 23610 postgres
6.2.0 C:\Program Files\IBM\Connect Direct v6.2.0 23620 postgres
6.3.0 C:\Program Files\IBM\Connect Direct v6.3.0 23630 postgres
6.4.0 C:\Program Files\IBM\Connect Direct v6.4.0 23640 postgres
Example
Sample output from performing the steps for IBM Sterling Connect:Direct for Microsoft Windows 6.4.0.
> net stop "Connect Direct v6.4.0 - MYCDNODE"
The Connect Direct v6.4.0 - MYCDNODE service is stopping.......
The Connect Direct v6.4.0 - MYCDNODE service was stopped successfully.


> net stop "PostgreSQL - Connect Direct v6.4.0"
The PostgreSQL - Connect Direct v6.4.0 service is stopping.
The PostgreSQL - Connect Direct v6.4.0 service was stopped successfully.


> rmdir /S /Q "C:\Program Files\IBM\Connect Direct v6.4.0/PostgreSQL/data"

> start "DBWiz" /w "C:\Program Files\IBM\Connect Direct v6.4.0\Server\DBWiz.exe" /Q /BCDWINNT /IPOSTGRESQL /NMYCDNODE /Vv6.4.0 /S127.0.0.1 /R23640 /D /Upostgres

> find "CDBWIZApp::InitDb Exited with rc" "C:\Program Files\IBM\Connect Direct v6.4.0\Server\DBWizTrace.log"

---------- C:\Program Files\IBM\CONNECT DIRECT V6.4.0\SERVER\DBWIZTRACE.LOG
07/01 03:48:57 CDBWIZApp::InitDb Exited with rc 0

> start "MsgImp" /w "C:\Program Files\IBM\Connect Direct v6.4.0\Server\MsgImp.exe" /Q /I

> net stop "PostgreSQL - Connect Direct v6.4.0"
The PostgreSQL - Connect Direct v6.4.0 service is stopping.
The PostgreSQL - Connect Direct v6.4.0 service was stopped successfully.


> icacls "C:\Program Files\IBM\Connect Direct v6.4.0\PostgreSQL\data" /grant SYSTEM:F /T
processed file: C:\Program Files\IBM\Connect Direct v6.4.0\PostgreSQL\data
processed file: C:\Program Files\IBM\Connect Direct v6.4.0\PostgreSQL\data\base
processed file: C:\Program Files\IBM\Connect Direct v6.4.0\PostgreSQL\data\current_logfiles
...
Successfully processed 1318 files; Failed processing 0 files

> icacls "C:\Program Files\IBM\Connect Direct v6.4.0\PostgreSQL\data" /setowner SYSTEM /T
processed file: C:\Program Files\IBM\Connect Direct v6.4.0\PostgreSQL\data
processed file: C:\Program Files\IBM\Connect Direct v6.4.0\PostgreSQL\data\base
processed file: C:\Program Files\IBM\Connect Direct v6.4.0\PostgreSQL\data\current_logfiles
...
Successfully processed 1318 files; Failed processing 0 files

> net start "Connect Direct v6.4.0 - MYCDNODE"
The Connect Direct v6.4.0 - MYCDNODE service is starting.
The Connect Direct v6.4.0 - MYCDNODE service was started successfully.

Document Location

Worldwide

[{"Type":"MASTER","Line of Business":{"code":"LOB77","label":"Automation Platform"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSRRVY","label":"IBM Sterling Connect:Direct for Microsoft Windows"},"ARM Category":[],"ARM Case Number":"","Platform":[{"code":"PF033","label":"Windows"}],"Version":"4.8.0;6.0.0;6.1.0;6.2.0;6.3.0;6.4.0"}]

Document Information

Modified date:
19 October 2023

UID

ibm10875446