Environment
ZENworks Configuration Management
Situation
ZENworks DB Name: zenworks
Audit DB Name: zenworksaudit
Password: (hint: Use command zman dgc)
Port: 54327
Port: 5432
Resolution
Remember postgresql will have case sensitivity on by default.
Connecting to the database - verify case sensitivity.
Example:
ZSD configuring Integrations with a ZCM db - Sybase db is ZENworksDB
After migrating to PostgreSQL check case - it maybe zenworksdb
It is possible to run postgres command directly in the internal database.
Example: ZENworks Service Desk Server Name is NIM-ZSD
Log in to appliance as root/pw and run queries
postgres@NIM-ZSD:~>
psql \servicedesk
Run db queries (don’t forget the ending ; )
servicedesk=#
: select * from team;
Run a script
servicedesk=# \i <filename>.sql;
Restore a dump of the database (see Additional Information for details)
servicedesk=# psql -U postgres -d servicedesk < /tmp/zsdDb.backup
servicedesk=# \quit
Exit from Service Desk Database console
postgres@NIM-ZSD:~>exit
NIM-ZSD:~# pg_dump --dbname=postgresql://sdadmin@localhost:5432/servicdesk --file=/tmp/zsdDb.backup --encoding=UTF8 --blobs --format=tar
password:
Additional Information
Syntax example to display guid zuid with encode(zuid::bytea,'hex')
PGAdmin4 examples to call out guid id with '\x<guid>'
select * from zdevice where zuid = 0x99d89b65dc2e0f43a8bbbfff4684710a;
select * from zdevice where zuid = '\x99d89b65dc2e0f43a8bbbfff4684710a';
DBeaver
By default DBeaver doesn't pick up the guid hex.
Modifications to the default properties helps display GUID & easier syntax.
DBeaver Properties (global) for Editors > Data Editor > Editors - Binary data format=hex
DBeaver syntax before change format hex:
DBeaver syntax after change format to hex:
select * from zdevice where zuid = '\x99d89b65dc2e0f43a8bbbfff4684710a';