Firebird: Unterschied zwischen den Versionen
Aus Vosp.info
F (Diskussion | Beiträge) (→zeige aktuelle sql queries an die ausgeführt werden) |
F (Diskussion | Beiträge) (→zeige aktuelle sql queries an die ausgeführt werden) |
||
Zeile 45: | Zeile 45: | ||
WHERE ncstatements.MON$SQL_TEXT IS NOT NULL | WHERE ncstatements.MON$SQL_TEXT IS NOT NULL | ||
ORDER BY ncstats.MON$STAT_GROUP; | ORDER BY ncstats.MON$STAT_GROUP; | ||
+ | </source> | ||
+ | |||
+ | == zeige angemeldete user an == | ||
+ | |||
+ | <source lang=sql> | ||
+ | -- Information about the database connections | ||
+ | -- https://riptutorial.com/firebird/example/18210/get-information-about-attachments-on-the-connected-database | ||
+ | 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_address as ip4, | ||
+ | a.mon$remote_os_user AS osuser, | ||
+ | a.mon$remote_host AS host, | ||
+ | a.mon$remote_pid as Remote_PID, | ||
+ | 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 stat_id | ||
+ | FROM | ||
+ | mon$attachments a | ||
+ | |||
</source> | </source> | ||
Version vom 1. November 2019, 12:52 Uhr
https://firebirdsql.org/file/documentation/reference_manuals/html/de/
Inhaltsverzeichnis
info über datenbank
fbstat VARIO8 -header
connect to database
# isql-fb -user sysdba -password masterkey localhost:employee
isql-fb -user sysdba -password masterkey "/path/to/db/file.fdb"
isql-fb -user sysdba -password masterkey 192.168.0.123/123:DB -i file.sql
Installation
Monitor Tabellen
- Systemtabelle Inhalte
- MON$IO_STATS Input/Output-Statistiken (beinhaltet Primärschlüssel MON$STAT_ID)
- MON$ATTACHMENTS Informationen über aktive Datenbankattachments
- MON$CALL_STACK Stackaufrufe von aktiven Abfragen durch Stored Procedures und Trigger
- MON$DATABASE Informationen über die Datenbank, welche durch die CURRENT_CONNECTION verbunden ist
- MON$STATEMENTS Zur Ausführung vorbereitete Statements
- MON$TRANSACTIONS Gestartete Transaktionen
- MON$CONTEXT_VARIABLES Informationen zu benutzerdefinierten Kontextvariablen
- MON$MEMORY_USAGE Statistiken über den Speicherverbrauch
- MON$RECORD_STATS Record-Level-Statistiken
- MON$IO_STATS Input/Output-Statistiken (beinhaltet Primärschlüssel MON$STAT_ID)
zeige aktuelle sql queries an die ausgeführt werden
SELECT *
FROM MON$IO_STATS AS ncstats
LEFT JOIN MON$STATEMENTS AS ncstatements ON ncstats.MON$STAT_ID = ncstatements.MON$STAT_ID
WHERE ncstatements.MON$SQL_TEXT IS NOT NULL
ORDER BY ncstats.MON$STAT_GROUP;
zeige angemeldete user an
-- Information about the database connections
-- https://riptutorial.com/firebird/example/18210/get-information-about-attachments-on-the-connected-database
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_address as ip4,
a.mon$remote_os_user AS osuser,
a.mon$remote_host AS host,
a.mon$remote_pid as Remote_PID,
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 stat_id
FROM
mon$attachments a
zeige andere Informationen
select * from MON$DATABASE ;