Information about the database connections
SELECT
a.mon$attachment_id as Attachment_ID,
a.mon$server_pid as Server_PID,
case a.mon$state
when 1 then 'active'
when 0 then 'idle'
end as State,
a.mon$attachment_name as Database_Name,
a.mon$user as User_Name,
a.mon$role as Role_Name,
a.mon$remote_protocol as Remote_Protocol,
a.mon$remote_address as Remote_Address,
a.mon$remote_pid as Remote_PID,
cs.rdb$character_set_name as Connection_Character_Set,
a.mon$timestamp as Established_At,
case a.mon$garbage_collection
when 1 then 'allowed'
when 0 then 'not allowed'
end as Garbage_Collection,
a.mon$remote_process as Remote_Process,
a.mon$stat_id as Statistics_ID
FROM
mon$attachments a, rdb$character_sets cs
where
(a.mon$character_set_id = cs.rdb$character_set_id)
Results:
More specific examples
Information about the connected clients.
SELECT
a.mon$remote_protocol as Remote_Protocol,
a.mon$remote_address as Remote_Address,
a.mon$remote_pid as Remote_PID,
a.mon$timestamp as Established_At,
a.mon$remote_process as Remote_Process
FROM
mon$attachments a
Retrieve PIDs of all server processes loading CPU at the moment (interesting with a Classic Server Architecture)
SELECT
MON$SERVER_PID
FROM
MON$ATTACHMENTS
WHERE
MON$STATE = 1
Retrieve information about the connected users, workstations and the client applications
SELECT
mon$attachment_name as Database_Name,
mon$user as User_Name,
mon$role as Role_Name,
mon$remote_process as Client_Application,
mon$remote_address as Client_IP,
mon$remote_pid as Client_Application_PID
FROM
mon$attachments