database.sarang.net
UserID
Passwd
Database
DBMS
MySQL
PostgreSQL
Firebird
Oracle
ㆍInformix
Sybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
Informix Q&A 2554 게시물 읽기
No. 2554
유용한 query 두번째..
작성자
작은거
작성일
2008-12-10 15:25
조회수
7,836

What is the current version of the engine
  select owner
          from sysmaster:systables .
          where tabid = 99


How to list the users
  select unique username
          from  syssessions

 

What is the disk IO for a session
  select syssesprof.sid,
          isreads,
          iswrites,
          isrewrites,
          isdeletes
          from syssesprof, syssessions 
          where syssesprof.sid = syssessions.sid


How to convert a PID to a session ID
  select sid
          fromsyssessions
          where pid = 'pid'

 

How to find the sequential scans for a table
  select dbsname, tabname, seqscans
          from sysptprof;

 


How to list the logging status of a database
  select name,
          is_logging,
          is_buff_log,
          is_ansi,
          is_nls
          from sysdatabases

  The flags are:
          0:  Not logged
          1:  Buffered Logging
          2:  Unbuffered Logging
          4:  Ansi
          8:  NLS

 

How to list the locks
  select dbsname,
          tabname,
          rowidlk,
          keynum,
          type 
          from syslocks,
          syssessions
          where owner = "sid"
         
       
      B   Byte lock
      IS  Intent shared lock
      S   Shared lock
      XS  Repeatable read shared lock
      U   Update lock
      IX  Intent exclusive lock
      SIX Shared intent exclusive
      X   Exclusive lock
      XR  Repeatble read exclusive

 

How to list the database locks
SELECT "database lock" table_name, l.type lock_type, l.keynum index_num,
  HEX(l.rowidlk) rowid, s.sid session_id, s.username, s.pid, s.hostname,
  q.sqs_statement statement
FROM syslocks l, sysdatabases d, syssessions s, syssqlstat q
WHERE d.name = ' database_name '
  AND l.rowidlk = d.rowid
  AND l.owner = s.sid
  AND dbsname = 'sysmaster'
  AND tabname = 'sysdatabases'
  AND s.sid = q.sqs_sessionid 
 

UNION ALL

SELECT l.tabname, l.type, l.keynum, HEX(l.rowidlk), s.sid, s.username,
  s.pid, s.hostname, q.sqs_statement
FROM syslocks l, syssessions s, syssqlstat q
WHERE l.dbsname = ' database_name '
  AND l.owner = s.sid
  AND s.sid = q.sqs_sessionid
  AND dbsname = 'sysmaster'
  AND tabname = 'sysdatabases'
ORDER BY 5;

[Top]
No.
제목
작성자
작성일
조회
2557oninit -PHY 설명좀 부탁드려요 [2]
장나라
2008-12-18
6128
2556DBVisualizer 설치하여 써보신분 !!! [1]
지원요청
2008-12-18
8382
2555[질문]ibatis에서 인포믹스 text형 insert처리방법 [1]
이진홍
2008-12-10
7963
2554유용한 query 두번째..
작은거
2008-12-10
7836
2552두개의 on_servername 사용하기 [1]
달팽이
2008-12-03
6043
2551crontab 관련 mail 질문입니다.
홍순범
2008-12-01
6060
2550informix에서 요일 월을 영문으로 받아오는 방법좀 가르쳐주세요.
난몰까
2008-11-30
6739
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.017초, 이곳 서비스는
	PostgreSQL v16.4로 자료를 관리합니다