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 2500 게시물 읽기
No. 2500
[TIP] SMI Query Series - Database Size
작성자
김선규(cbspd)
작성일
2008-04-04 14:12
조회수
6,905

이 쿼리는 IDS instance의 모든 database의 개별 size를 보여주는 쿼리입니다.

여기에는 두개의 버전이 있는데 IDS 10.x 이전 버전은 결과를 세로로 스크롤해주고 (아시져 10 이전버전은 display 방식이 single line 만 지원이 되어서 그렇다는것을..) 10.x 이후 버전은 가로줄 방식(이게 보기가 훨 좋긴 하죠)으로 스크롤 해준다는 것 외에는 결과값 자체에는 변함이 없습니다.

다음은 쿼리입니다.
=================================================================
IDS 10 미만 버전

DATABASE sysmaster;
SELECT stn.dbsname db_name,
   SUM
   (
      sti.ti_npused *
      (
         select sh_pagesize from sysshmvals
      )/1024/1024
   ) mb_used,
   SUM
   (
      sti.ti_nptotal *
      (
         select sh_pagesize from sysshmvals
      )/1024/1024
    ) mb_total
FROM systabnames stn, systabinfo sti, sysdatabases sdb
WHERE stn.partnum = sti.ti_partnum
AND   stn.dbsname = sdb.name
GROUP BY 1
ORDER BY 1;



IDS 10 이상 버전

DATABASE sysmaster;
SELECT stn.dbsname[1,35] db_name,
   SUM
   (
      sti.ti_npused *
      (
         select pagesize
            from  sysdbspaces
            where name = dbinfo('dbspace', sti.ti_partnum)
      )/1024/1024
   ) mb_used,
   SUM
   (
      sti.ti_nptotal *
      (
         select pagesize
            from  sysdbspaces
            where name = dbinfo('dbspace', sti.ti_partnum)
      )/1024/1024
    ) mb_total
FROM systabnames stn, systabinfo sti, sysdatabases sdb
WHERE stn.partnum = sti.ti_partnum
AND   stn.dbsname = sdb.name
GROUP BY 1
ORDER BY 1;

===============================================================

다음은 당연히 원문입니다.

smi_seq_scans.sql

The purpose of this SMI query is to display the individual sizes of all databases in your IDS instance .

The smi_db_size.sql comes in two versions. Choose the one that fits your current IDS version. The purpose of the substrings (stn.dbsname[1,35] is only to make sure that the retrieved row is displayed on a single line within the dbaccess utility. You can remove it if you need the full database name.

IDS < 10

DATABASE sysmaster;
SELECT stn.dbsname db_name,
   SUM
   (
      sti.ti_npused *
      (
         select sh_pagesize from sysshmvals
      )/1024/1024
   ) mb_used,
   SUM
   (
      sti.ti_nptotal *
      (
         select sh_pagesize from sysshmvals
      )/1024/1024
    ) mb_total
FROM systabnames stn, systabinfo sti, sysdatabases sdb
WHERE stn.partnum = sti.ti_partnum
AND   stn.dbsname = sdb.name
GROUP BY 1
ORDER BY 1;

IDS >= 10

DATABASE sysmaster;
SELECT stn.dbsname[1,35] db_name,
   SUM
   (
      sti.ti_npused *
      (
         select pagesize
            from  sysdbspaces
            where name = dbinfo('dbspace', sti.ti_partnum)
      )/1024/1024
   ) mb_used,
   SUM
   (
      sti.ti_nptotal *
      (
         select pagesize
            from  sysdbspaces
            where name = dbinfo('dbspace', sti.ti_partnum)
      )/1024/1024
    ) mb_total
FROM systabnames stn, systabinfo sti, sysdatabases sdb
WHERE stn.partnum = sti.ti_partnum
AND   stn.dbsname = sdb.name
GROUP BY 1
ORDER BY 1;


[Top]
No.
제목
작성자
작성일
조회
2503[TIP] Free informix online Certification Assesment Testing 정보
김선규
2008-04-16
6737
2502쿼리 도와주세요 [1]
하늘
2008-04-04
6728
2501[TIP] SMI Query Series - Sequential Scans on Tables
김선규
2008-04-04
7108
2500[TIP] SMI Query Series - Database Size
김선규
2008-04-04
6905
2499instance down일때.. [2]
최재환
2008-04-02
5932
2498[TIP] SMI Query Series - Shared Memory Segments
김선규
2008-04-02
5946
2497쿼리로 IDS의 버전 확인 방법 있나요?? [3]
최재환
2008-04-01
7254
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2023 DSN, All rights reserved.
작업시간: 0.046초, 이곳 서비스는
	PostgreSQL v16.1로 자료를 관리합니다