Connecting to Analytics Plus Database (PostgreSQL) for version 6110 and above

Connecting to Analytics Plus Database (PostgreSQL) for version 6110 and above

Overview: 

This article provides step-by-step instructions to connect to the Analytics Plus PostgreSQL database from a Windows machine.


Prerequisites:  

  • Access to the Analytics Plus server machine

  • Login in to Analytics Plus UI as Admin 

  • Access the Command Prompt as Adminis 


Procedure for Windows Machines:


Step 1: Open Command Prompt as admin

Navigate to the PostgreSQL bin directory: <AnalyticsPlus_Home>\pgsql\bin

Step 2: Execute the Connection Command  

Run the following command: psql.exe -U postgres -p <port_number> -h 127.0.0.1  zreportsdb

Example:

Info
psql.exe -U postgres -p 33366 -h 127.0.0.1

'U' represents the Username of DB (default username of the Aplus DB is postgres)
'p' represents the port number of the DB (by default Aplus DB is 33366)  
'h' represents the hostname of the DB (default Aplus DB host name is 127.0.0.1)

Note: Default port: 33366, if unknown then find it under: <AnalyticsPlus_Home>\conf\port.properties


Step 3: Access Analytics Plus Web Console  

Log in to the Analytics Plus application as admin.


Step 4: Navigate to DBQuery  

Go to: Settings → Troubleshoot → DBQuery → Execute the below query

select propvalue from zdbsysprop where propkey like '%zrop.postgres.user.password%'

  • The output will display the encrypted password as shown in the below image.


Step 5: Decrypt the Password  

Open a new browser tab and navigate to:

https://<aplusurl>:<portnumber>/zrop/jsp/Encrypt.jsp

  • Paste the encrypted password into: "Enter the Value to EAR Decrypt" field

  • Click Submit


  • The decrypted password will be displayed below the input field as shown in the below image.


Step 6: Authenticate in Command Prompt  
  • Enter the decrypted password in the command prompt.

If successful, you will see:

Info
zreportsdb=#



Expected Outcome  

You will now be connected to the Analytics Plus PostgreSQL database (zreportsdb).


 

Procedure for Linux


Step 1: Open Terminal
  

Log in to the Analytics Plus server and open a terminal session.


Step 2: Navigate to PostgreSQL bin Directory
  

Run: cd <AnalyticsPlus_Home>/pgsql/bin


Step 3: Execute the Connection Command  

Run the following command:

./psql -U postgres -p <port_number> -h 127.0.0.1 zreportsdb

Example: ./psql -U postgres -p 33366 -h 127.0.0.1 zreportsdb

'U' represents the Username of DB (default username of the Aplus DB is postgres)
'p' represents the port number of the DB (by default Aplus DB is 33366)  
'h' represents the hostname of the DB (default Aplus DB is 127.0.0.1)

Note:

  • Default port: 33366

  • If unknown, find it in: <AnalyticsPlus_Home>/pgsql/conf/port.properties


Step 4: Enter Database Password  

  • You will be prompted to enter the password.

  • The password will not be visible while typing (expected behavior).

  • Press Enter after typing the password.


If Password is Unknown  

Step 5: Access Analytics Plus Web Console  

Log in to the Analytics Plus application from a browser. 

Note: If the Linux server machine doesn't support accessing the Application UI, you may access it from a client machine.


Step 6: Navigate to DBQuery  

Go to: Settings → Troubleshoot → DBQuery


Step 7: Retrieve Encrypted Password  

Execute the below query:

select propvalue from zdbsysprop where propkey like '%zrop.postgres.user.password%';

  • The output will display the encrypted password as shown in the below image.


Step 8: Decrypt the Password  

Open a new browser tab and navigate to:

https://:/zrop/jsp/Encrypt.jsp

  • Paste the encrypted password into:
    "Enter the Value to EAR Decrypt"

  • Click Submit


Step 9: Copy Decrypted Password  

  • The decrypted password will be displayed below the input field.


Step 10: Authenticate in Terminal  

  • Enter the decrypted password in the terminal.


Step 11: Verify Connection  

If successful, you will see:

postgres=#


Step 12: Connect to Analytics Plus Database  

Input 'zreportsdb' and press enter


Expected Outcome  

You will now be connected to the Analytics Plus PostgreSQL database (zreportsdb).


                  New to ADSelfService Plus?

                    • Related Articles

                    • Analytics Plus Inventory

                      Aim: To have the detailed list of all the Reports, Databases created in Analytics  Open Local & Cloud Databases and fill the entries password = Postgres and if any error occurs stating something like "check the DB connection" change the Port to ...
                    • How to connect to Analytics Plus database

                      This article will help you with the steps to connect to Analytics Plus database(Postgres) Note: Analytics Plus is bundled with Postgres and it cannot be changed to any other database due to reliability and chart rendering. Steps for Windows: 1. Open ...
                    • Move Analytics Plus from one Server/folder

                      Go to Start --> Services.msc and stop the ManageEngine Analytics Plus service. Take a backup of the entire <Analytics Plus_Home> directory and then move it to the new server.  On the new server, navigate to (similar path) <Analytics Plus_Home>\bin ...
                    • Steps to enable Google Analytics Connector

                      1. Stop the Analytics Plus services. 2. Modify the entry under <Analytics Plus home>/reports/conf/app.properties show.create.google.analytics.view=true Note: If the above property is missing, add them. By default the value will be set to 'false' 3.  ...
                    • Unable to see Create Database Icons

                      Issue: When Analytics Plus Professional edition is rebranded, the Create Database Icons on the home page disappears. Build: 2905 or less Solution: Though the identified issue is resolved in the latest builds 2906 or above, we need to perform a minor ...