수색…


비고

Firebird 2.1과 ODS 11.1 이상 버전의 데이터베이스를 사용하여 Firebird는 특정 데이터베이스 내에서 발생하는 서버 측 활동을 모니터링하는 기능을 도입했습니다.

SYSDBA와 데이터베이스 소유자는 완전한 데이터베이스 모니터링을 사용할 수 있습니다. 일반 사용자는 자신의 첨부 파일에 대한 정보만으로 제한됩니다. 다른 첨부 파일은 보이지 않습니다.

Firebird 2.1 및 ODS 11.1 이후로 사용 가능한 모니터링 테이블 :

  • MON $ DATABASE (연결된 데이터베이스)
  • MON $ ATTACHMENTS (연결된 첨부 파일)
  • MON $ TRANSACTIONS (시작 트랜잭션)
  • MON $ STATEMENTS (준비된 진술)
  • MON $ CALL_STACK (활성 PSQL 요청의 스택 호출)
  • MON $ IO_STATS (I / O 통계)
  • MON $ RECORD_STATS (레코드 수준 통계)

참조 : Firebird 2.1 릴리스 노트

Firebird 2.5와 ODS 11.2 이상 버전의 데이터베이스를 사용하여 Firebird는 다음과 같은 새로운 모니터 테이블을 추가합니다

  • MON $ MEMORY_USAGE (현재 메모리 사용)
  • MON $ CONTEXT_VARIABLES (알려진 컨텍스트 변수)

참조 : Firebird 2.5 릴리스 노트

연결된 데이터베이스의 첨부 파일에 대한 정보 얻기

데이터베이스 연결에 대한 정보

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)

결과 :

여기에 이미지 설명을 입력하십시오.

보다 구체적인 예

연결된 클라이언트에 대한 정보.

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

현재 CPU를로드하는 모든 서버 프로세스의 PID를 검색합니다 (Classic Server Architecture와 관련 있음).

SELECT
   MON$SERVER_PID
FROM
   MON$ATTACHMENTS
WHERE
   MON$STATE = 1

연결된 사용자, 워크 스테이션 및 클라이언트 응용 프로그램에 대한 정보 검색

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

참고:



Modified text is an extract of the original Stack Overflow Documentation
아래 라이선스 CC BY-SA 3.0
와 제휴하지 않음 Stack Overflow