Recovered from the older tannerjc.net wiki snapshot dated January 23, 2016.

Proxy-activate-deactivate-code

SQL SELECT PI.server_id ID, S.name,
       (SELECT 1
          FROM rhnServerFeaturesView SFV
         WHERE SFV.server_id = S.id
           AND SFV.label = 'ftr_system_grouping') AS selectable
  FROM rhnServer S, rhnProxyInfo PI
 WHERE EXISTS (SELECT 1 FROM rhnUserServerPerms USP WHERE USP.server_id = PI.server_id)
   AND S.id = PI.server_id;  2    3    4    5    6    7    8

        ID
----------
NAME
--------------------------------------------------------------------------------
SELECTABLE
----------
1000012511
muntz.usersys.redhat.com
         1

1000012529
moleman.usersys.redhat.com
         1

        ID
----------
NAME
--------------------------------------------------------------------------------
SELECTABLE
----------

1000012750
quimby.usersys.redhat.com
         1
SQL select * from rhnProxyInfo;

 SERVER_ID PROXY_EVR_ID
---------- ------------
1000012511	   5469
1000012529	   4678