Monday 18 November 2013

Avamar - How to query the PostgreSQL MCS database

Here is how to connect to the DB if you need custom reports and want to create custom queries:

1.)  SSH to the Utility node


root@dpn:~/#: su - admin
admin@dpn:~/>: psql -p 5555 -U viewuser mcdb
Welcome to psql 8.2.3, the PostgreSQL interactive terminal.

mcdb=>

Note:  Please use "viewuser" (read only) account for your queries !


2.) Here is the example for a simple SQL query, but you can build your own queries and export it as plain text .

    SELECT * FROM "public"."v_clients";
    SELECT v_clients.cid, v_clients.client_name, v_clients.client_addr,v_clients.os_type FROM "public"."v_clients";


select client_name,status_code,domain FROM v_activities_2 WHERE (status_code=30901 or status_code=30915) and recorded_date_time > current_timestamp - interval '24 hours';

No comments:

Post a Comment