Designator queries

From Come play with my wiki

Jump to: navigation, search

To get the distinct count of designators:

mysql> select designation, count(*) as Counts from info_current group by designation order by Counts;
+---------------------------------------------+--------+
| designation                                 | Counts |
+---------------------------------------------+--------+
| OAS_BPEL_EBIZ                               |      1 |
| OAS_BPEL_DAP                                |      1 |
...
| OAS_A3_CROSSPLANE_INT                       |     19 |
| TBD                                         |     23 |
| ORACLE_DB                                   |     24 |
| JCAPS                                       |     25 |
|                                             |     84 |
+---------------------------------------------+--------+
120 rows in set (0.02 sec)

For one offs of the OAS stuff, list the host as well (again this only works if the count is 1): select hostname, designation, count(*) as Counts from info_current where designation like '%OAS%' group by designation order by Counts;


Blank designators:

mysql> select hostname from info_current where designation="";
+------------+
| hostname   |
+------------+
| unix0019   |
...
| unix0056   |
| zone0249   |
+------------+
84 rows in set (0.00 sec)

Do the same query for TBD and "X"



mysql> select hostname, designation, environment from info_current where designation like '%omca%' order by designation;
+-----------+------------------+-------------+
| hostname  | designation      | environment |
+-----------+------------------+-------------+
| zone0168  | LAP_TOMCAT_SRVR  | MOT         |
| rc-sun94d | LAP_TOMCAT_SRVR  | DEV         |
| zone0035  | LAP_TOMCAT_SRVR  | PROD        |
| zone0129  | RACHADE - Tomcat | DEV         |
| zone0163  | Tomcat           | MOT         |
| zone0044  | Tomcat           | PROD        |
| zone0045  | Tomcat           | PROD        |
| zone0080  | Tomcat           | MOT         |
+-----------+------------------+-------------+
8 rows in set (0.01 sec) 



mysql> select count(designation), designation from info_current group by designation order by count(designation);
+--------------------+---------------------------------------------+
| count(designation) | designation                                 |
+--------------------+---------------------------------------------+
|                  1 | OAS_BPEL_EBIZ                               |
|                  1 | OAS_BPEL_DAP                                |
|                  1 | SSO/OID                                     |
|                  1 | JumpStart Server                            |
|                  1 | RACHADE
Personal tools