SQL to check database activities in Greenplum