<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.informix-zone.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>The Informix Zone - smi-query-series</title>
 <link>http://www.informix-zone.com/taxonomy/term/112/0</link>
 <description></description>
 <language>en</language>
<item>
 <title>SMI Query Series - Dbspace Sizes</title>
 <link>http://www.informix-zone.com/node/477</link>
 <description>&lt;h1&gt;SMI Query Series - Dbspace Sizes&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;/files/graphics/ids.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The &lt;a target=&quot;_blank&quot; href=&quot;http://publib.boulder.ibm.com/infocenter/idshelp/v115/index.jsp?topic=/com.ibm.adref.doc/sii02rsmi1011428.htm&quot;&gt;sysmaster interface&lt;/a&gt; (&lt;b&gt;SMI&lt;/b&gt;) presents a comfortable way to extract information about various parts of your running IDS instance. This information can be used for:&lt;/p&gt;
&lt;ul class=&quot;ba&quot;&gt;
&lt;li&gt;ad hoc analysis of performance problems&lt;/li&gt;
&lt;li&gt;determining the status of several IDS sub components&lt;/li&gt;
&lt;li&gt;monitoring replication metrics&lt;/li&gt;
&lt;li&gt;sampling data for capacity planning purposes&lt;/li&gt;
&lt;li&gt;tracking system usage of individual sessions&lt;/li&gt;
&lt;li&gt;and many more...&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The below SMI query is the &lt;b&gt;fith&lt;/b&gt; one of a new &lt;a href=&quot;/taxonomy/term/112&quot;&gt;SMI query series&lt;/a&gt; at &lt;i&gt;The Informix Zone&lt;/i&gt;. The queries show you how to extract valuable information from the &lt;b&gt;sysmaster&lt;/b&gt; database.&lt;/p&gt;
&lt;h2&gt;smi_dbspace_size.sql&lt;/h2&gt;
&lt;p&gt;The purpose of this SMI query is to display the &lt;b&gt;individual sizes&lt;/b&gt; of all &lt;b&gt;dbspaces&lt;/b&gt; in your IDS instance:&lt;/p&gt;
&lt;pre&gt;
-- ****************
-- normal dbspaces
-- ****************
SELECT 
   sd.name[1,18],
   SUM(sc.chksize * ( SELECT sh_pagesize FROM sysshmvals)) / (1024*1024) mb_allocated,
   SUM(sc.nfree * ( SELECT sh_pagesize FROM sysshmvals)) / (1024*1024) mb_free,
   100 / SUM(sc.chksize) * SUM(sc.nfree) percent_free
FROM sysdbspaces sd, syschunks sc
WHERE sd.dbsnum = sc.dbsnum
AND   sd.is_sbspace = 0
AND   sd.is_blobspace = 0
GROUP by sd.name
 
UNION
 
--  *************
--  blob dbspaces
--  *************
SELECT
   sd.name[1,18],
   SUM(sc.chksize * ( SELECT sh_pagesize FROM sysshmvals)) / (1024*1024) mb_allocated,
   SUM(sc.nfree * sdt.pagesize) / (1024*1024) mb_free,
   100 / SUM(sc.chksize) * SUM(sc.nfree * sdt.pagesize) / ( SELECT sh_pagesize FROM sysshmvals) percent_free
FROM sysdbstab sdt, sysdbspaces sd, syschunks sc
WHERE sd.dbsnum = sc.dbsnum
AND   sd.dbsnum = sdt.dbsnum
AND   sd.is_blobspace = 1
GROUP by sd.name
 
UNION
 
--  ******************
--  smartblob dbspaces
--  ******************
SELECT
   sd.name[1,18],
   SUM(sc.chksize) * ( SELECT sh_pagesize FROM sysshmvals) / (1024*1024) mb_allocated,
   SUM(sc.udfree) * ( SELECT sh_pagesize FROM sysshmvals) / (1024*1024) mb_free,
   100 / SUM(sc.chksize) * SUM(sc.udfree) percent_free
FROM sysdbspaces sd, syschunks sc
WHERE sd.dbsnum = sc.dbsnum
AND sd.is_sbspace = 1
GROUP by sd.name
ORDER BY 4;

&lt;/pre&gt;&lt;br /&gt;
</description>
 <comments>http://www.informix-zone.com/node/477#comment</comments>
 <category domain="http://www.informix-zone.com/taxonomy/term/112">smi-query-series</category>
 <category domain="http://www.informix-zone.com/taxonomy/term/93">sysmaster</category>
 <category domain="http://www.informix-zone.com/taxonomy/term/15">technical</category>
 <pubDate>Thu, 10 Jul 2008 21:25:17 +0200</pubDate>
 <dc:creator>eherber</dc:creator>
 <guid isPermaLink="false">477 at http://www.informix-zone.com</guid>
</item>
<item>
 <title>SMI Query Series - Logical Log Space Used</title>
 <link>http://www.informix-zone.com/node/440</link>
 <description>&lt;h1&gt;SMI Query Series - Logical Log Space Used&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;/files/graphics/ids.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The &lt;a target=&quot;_blank&quot; href=&quot;http://publib.boulder.ibm.com/infocenter/idshelp/v111/index.jsp?topic=/com.ibm.adref.doc/adref220.htm&quot;&gt;sysmaster interface&lt;/a&gt; (&lt;b&gt;SMI&lt;/b&gt;) presents a comfortable way to extract information about various parts of your running IDS instance. This information can be used for:&lt;/p&gt;
&lt;ul class=&quot;ba&quot;&gt;
&lt;li&gt;ad hoc analysis of performance problems&lt;/li&gt;
&lt;li&gt;determining the status of several IDS sub components&lt;/li&gt;
&lt;li&gt;monitoring replication metrics&lt;/li&gt;
&lt;li&gt;sampling data for capacity planning purposes&lt;/li&gt;
&lt;li&gt;tracking system usage of individual sessions&lt;/li&gt;
&lt;li&gt;and many more...&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The below SMI query is the &lt;b&gt;fourth&lt;/b&gt; one of a new &lt;a href=&quot;/taxonomy/term/112&quot;&gt;SMI query series&lt;/a&gt; at &lt;i&gt;The Informix Zone&lt;/i&gt;. The queries show you how to extract valuable information from the &lt;b&gt;sysmaster&lt;/b&gt; database.&lt;/p&gt;
&lt;h2&gt;smi_log_used.sql&lt;/h2&gt;
&lt;p&gt;The purpose of this SMI query is to display the &lt;b&gt;used&lt;/b&gt; and &lt;b&gt;total&lt;/b&gt; logical log space. The corresponding &lt;b&gt;onstat&lt;/b&gt; command is: &lt;b&gt;&lt;i&gt;onstat -l&lt;/i&gt;&lt;/b&gt;:&lt;/p&gt;
&lt;pre&gt;
SELECT SUM
       (
         size *
         (
            select sh_pagesize from sysshmvals
         )/1024/1024
      ) mb_used_and_total
FROM   syslogs
WHERE uniqid &gt;=
       (
       SELECT min(tx_logbeg)
          FROM  systrans
          WHERE tx_logbeg &gt; 0
       )
OR     is_backed_up = 0
 
UNION ALL
 
SELECT SUM
       (
         size *
         (
            select sh_pagesize from sysshmvals
         )/1024/1024
       )
FROM   syslogs;
&lt;/pre&gt;&lt;p&gt;
Examplary Output:&lt;/p&gt;
&lt;pre&gt;
mb_used_and_total 
 
120.00
400.00
&lt;/pre&gt;&lt;p&gt;
In the above example we have a total configured logical space of about &lt;b&gt;400 mb&lt;/b&gt;. Currently &lt;b&gt;120 mb&lt;/b&gt; of the total log space is either used by &lt;b&gt;ongoing transactions&lt;/b&gt; or because certain logs have &lt;b&gt;not been backed up&lt;/b&gt; yet. There is about &lt;b&gt;280 mb&lt;/b&gt; of free log space available on the IDS instance. Actually there might be more than &lt;b&gt;280 mb&lt;/b&gt; because the &lt;b&gt;current&lt;/b&gt; logical log is considered to be full by this query. You might further adjust the SMI query and select the &lt;b&gt;sum(syslogs.used)&lt;/b&gt; column for the current log (&lt;b&gt;syslogs.is_current=1&lt;/b&gt;) if you prefer.  The available log space for ongoing transactions might be further &lt;b&gt;limited&lt;/b&gt; by the LTXHWM/LTXEHWM (Long Transaction Highwater Marks) settings in your onconfig file.&lt;/p&gt;
&lt;p&gt;The above query has been tested with IDS &lt;b&gt;10&lt;/b&gt;. It should also run with IDS versions &lt;b&gt;&gt;= 9.30&lt;/b&gt;. In IDS &lt;b&gt;&lt;= 9.30&lt;/b&gt; you might also need to check the column &lt;b&gt;syslogs.is_new&lt;/b&gt; because newly added logs are not immediately available for use. A Level-0-Backup has to be taken first.&lt;/p&gt;
</description>
 <comments>http://www.informix-zone.com/node/440#comment</comments>
 <category domain="http://www.informix-zone.com/taxonomy/term/112">smi-query-series</category>
 <category domain="http://www.informix-zone.com/taxonomy/term/93">sysmaster</category>
 <category domain="http://www.informix-zone.com/taxonomy/term/15">technical</category>
 <pubDate>Fri, 18 Apr 2008 11:08:31 +0200</pubDate>
 <dc:creator>eherber</dc:creator>
 <guid isPermaLink="false">440 at http://www.informix-zone.com</guid>
</item>
<item>
 <title>SMI Query Series - Shared Memory Segments</title>
 <link>http://www.informix-zone.com/node/429</link>
 <description>&lt;h1&gt;SMI Query Series - Shared Memory Segments&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;/files/graphics/ids.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The &lt;a target=&quot;_blank&quot; href=&quot;http://publib.boulder.ibm.com/infocenter/idshelp/v111/index.jsp?topic=/com.ibm.adref.doc/adref220.htm&quot;&gt;sysmaster interface&lt;/a&gt; (&lt;b&gt;SMI&lt;/b&gt;) presents a comfortable way to extract information about various parts of your running IDS instance. This information can be used for:&lt;/p&gt;
&lt;ul class=&quot;ba&quot;&gt;
&lt;li&gt;ad hoc analysis of performance problems&lt;/li&gt;
&lt;li&gt;determining the status of several IDS sub components&lt;/li&gt;
&lt;li&gt;monitoring replication metrics&lt;/li&gt;
&lt;li&gt;sampling data for capacity planning purposes&lt;/li&gt;
&lt;li&gt;tracking system usage of individual sessions&lt;/li&gt;
&lt;li&gt;and many more...&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The below SMI query is the &lt;b&gt;third&lt;/b&gt; one of a new &lt;a href=&quot;/taxonomy/term/112&quot;&gt;SMI query series&lt;/a&gt; at &lt;i&gt;The Informix Zone&lt;/i&gt;. The queries show you how to extract valuable information from the &lt;b&gt;sysmaster&lt;/b&gt; database.&lt;/p&gt;
&lt;h2&gt;smi_mem_seg.sql&lt;/h2&gt;
&lt;p&gt;The purpose of this SMI query is to display the &lt;b&gt;allocated&lt;/b&gt;, &lt;b&gt;used&lt;/b&gt; and &lt;b&gt;free&lt;/b&gt; number of megabytes for the individual IDS shared memory segment areas:&lt;/p&gt;
&lt;ul class=&quot;ra&quot;&gt;
&lt;li&gt;Resident Segment&lt;/li&gt;
&lt;li&gt;Virtual Segment(s)&lt;/li&gt;
&lt;li&gt;Message Segment&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The corresponding &lt;b&gt;onstat&lt;/b&gt; command is: &lt;b&gt;&lt;i&gt;onstat -g seg&lt;/i&gt;&lt;/b&gt; &lt;/p&gt;
&lt;pre&gt;
SELECT DECODE
       (
         seg_class,
         1, &quot;Resident&quot;,
         2, &quot;Virtual&quot;,
         3, &quot;Message&quot;
       ),
       COUNT(*) count_seg,
       (SUM(seg_blkused + seg_blkfree)*4/1024) mb_total,
       (SUM(seg_blkused)*4/1024) mb_used,
       (SUM(seg_blkfree)*4/1024) mb_free
FROM  syssegments
GROUP BY 1
ORDER BY 1;
&lt;/pre&gt;&lt;br /&gt;
</description>
 <comments>http://www.informix-zone.com/node/429#comment</comments>
 <category domain="http://www.informix-zone.com/taxonomy/term/112">smi-query-series</category>
 <category domain="http://www.informix-zone.com/taxonomy/term/93">sysmaster</category>
 <category domain="http://www.informix-zone.com/taxonomy/term/15">technical</category>
 <pubDate>Tue, 04 Mar 2008 18:25:15 +0100</pubDate>
 <dc:creator>eherber</dc:creator>
 <guid isPermaLink="false">429 at http://www.informix-zone.com</guid>
</item>
<item>
 <title>SMI Query Series - Database Size</title>
 <link>http://www.informix-zone.com/node/412</link>
 <description>&lt;h1&gt;SMI Query Series - Database Size&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;/files/graphics/ids.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The &lt;a target=&quot;_blank&quot; href=&quot;http://publib.boulder.ibm.com/infocenter/idshelp/v111/index.jsp?topic=/com.ibm.adref.doc/adref220.htm&quot;&gt;sysmaster interface&lt;/a&gt; (&lt;b&gt;SMI&lt;/b&gt;) presents a comfortable way to extract information about various parts of your running IDS instance. This information can be used for:&lt;/p&gt;
&lt;ul class=&quot;ba&quot;&gt;
&lt;li&gt;ad hoc analysis of performance problems&lt;/li&gt;
&lt;li&gt;determining the status of several IDS sub components&lt;/li&gt;
&lt;li&gt;monitoring replication metrics&lt;/li&gt;
&lt;li&gt;sampling data for capacity planning purposes&lt;/li&gt;
&lt;li&gt;tracking system usage of individual sessions&lt;/li&gt;
&lt;li&gt;and many more...&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The below SMI query is the &lt;b&gt;second&lt;/b&gt; one of a new &lt;a href=&quot;/taxonomy/term/112&quot;&gt;SMI query series&lt;/a&gt; at &lt;i&gt;The Informix Zone&lt;/i&gt;. The queries show you how to extract valuable information from the &lt;b&gt;sysmaster&lt;/b&gt; database.&lt;/p&gt;
&lt;h2&gt;smi_db_size.sql&lt;/h2&gt;
&lt;p&gt;The purpose of this SMI query is to display the &lt;b&gt;individual sizes&lt;/b&gt; of all &lt;b&gt;databases&lt;/b&gt; in your IDS instance .&lt;/p&gt;
&lt;p&gt;The &lt;b&gt;smi_db_size.sql&lt;/b&gt; comes in &lt;b&gt;two&lt;/b&gt; versions. Choose the one that &lt;b&gt;fits&lt;/b&gt; 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 &lt;b&gt;single line&lt;/b&gt; within the &lt;b&gt;dbaccess&lt;/b&gt; utility. You can remove it if you need the &lt;b&gt;full&lt;/b&gt; database name.&lt;/p&gt;
&lt;h3&gt;IDS &lt; 10&lt;/h3&gt;
&lt;pre&gt;
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;
&lt;/pre&gt;&lt;h3&gt;IDS &gt;= 10&lt;/h3&gt;
&lt;pre&gt;
DATABASE sysmaster;
SELECT stn.dbsname[1,35] db_name,
   SUM
   (
      sti.ti_npused *
      (
         select pagesize
            from  sysdbspaces
            where name = dbinfo(&#039;dbspace&#039;, sti.ti_partnum)
      )/1024/1024
   ) mb_used,
   SUM
   (
      sti.ti_nptotal *
      (
         select pagesize
            from  sysdbspaces
            where name = dbinfo(&#039;dbspace&#039;, 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;
&lt;/pre&gt;&lt;br /&gt;
</description>
 <comments>http://www.informix-zone.com/node/412#comment</comments>
 <category domain="http://www.informix-zone.com/taxonomy/term/112">smi-query-series</category>
 <category domain="http://www.informix-zone.com/taxonomy/term/93">sysmaster</category>
 <category domain="http://www.informix-zone.com/taxonomy/term/15">technical</category>
 <pubDate>Wed, 30 Jan 2008 19:56:39 +0100</pubDate>
 <dc:creator>eherber</dc:creator>
 <guid isPermaLink="false">412 at http://www.informix-zone.com</guid>
</item>
<item>
 <title>SMI Query Series - Sequential Scans on Tables</title>
 <link>http://www.informix-zone.com/node/405</link>
 <description>&lt;h1&gt;SMI Query Series - Sequential Scans on Tables&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;/files/graphics/ids.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The &lt;a target=&quot;_blank&quot; href=&quot;http://publib.boulder.ibm.com/infocenter/idshelp/v111/index.jsp?topic=/com.ibm.adref.doc/adref220.htm&quot;&gt;sysmaster interface&lt;/a&gt; (&lt;b&gt;SMI&lt;/b&gt;) presents a comfortable way to extract information about various parts of your running IDS instance. This information can be used for:&lt;/p&gt;
&lt;ul class=&quot;ba&quot;&gt;
&lt;li&gt;ad hoc analysis of performance problems&lt;/li&gt;
&lt;li&gt;determining the status of several IDS sub components&lt;/li&gt;
&lt;li&gt;monitoring replication metrics&lt;/li&gt;
&lt;li&gt;sampling data for capacity planning purposes&lt;/li&gt;
&lt;li&gt;tracking system usage of individual sessions&lt;/li&gt;
&lt;li&gt;and many more...&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The below SMI query is the &lt;b&gt;first one&lt;/b&gt; of a new &lt;a href=&quot;/taxonomy/term/112&quot;&gt;SMI query series&lt;/a&gt; at &lt;i&gt;The Informix Zone&lt;/i&gt;. The queries show you how to extract valuable information from the &lt;b&gt;sysmaster&lt;/b&gt; database.&lt;/p&gt;
&lt;h2&gt;smi_seq_scans.sql&lt;/h2&gt;
&lt;p&gt;The purpose of this SMI query is to display &lt;b&gt;sequential scans&lt;/b&gt; on tables. Sequential scans are &lt;b&gt;not always&lt;/b&gt; a bad thing, but they may &lt;b&gt;hurt performance&lt;/b&gt; if they occur &lt;b&gt;frequently&lt;/b&gt; on tables that contain &lt;b&gt;more&lt;/b&gt; than a few hundred rows. An &lt;b&gt;update statistics&lt;/b&gt; or the creation of a missing &lt;b&gt;index&lt;/b&gt; (plus update statistics if you are &lt;b&gt;not&lt;/b&gt; already on &lt;a href=&quot;/cheetah-resources&quot;&gt;IDS 11&lt;/a&gt;) on the respective table should normally help in such situations.&lt;/p&gt;
&lt;p&gt;The &lt;b&gt;smi_seq_scans.sql&lt;/b&gt; comes in &lt;b&gt;two&lt;/b&gt; versions. Choose the one that &lt;b&gt;fits&lt;/b&gt; your current IDS version. You may &lt;b&gt;swap&lt;/b&gt; the two columns in the ORDER BY clause to sort the result set by the number of sequential scans instead of the table size. The purpose of the substrings (stn.dbsname[1,15] and stn.tabname[1,20]) is only to make sure that the retrieved row is displayed on a &lt;b&gt;single line&lt;/b&gt; within the &lt;b&gt;dbaccess&lt;/b&gt; utility. You can remove it if you need the &lt;b&gt;full&lt;/b&gt; database and table names.&lt;/p&gt;
&lt;p&gt;You might also reset the &lt;b&gt;statistics profile&lt;/b&gt; (&lt;i&gt;onstat -z&lt;/i&gt;) before executing the query. Executing the query &lt;b&gt;several times&lt;/b&gt; after the &lt;b&gt;reset&lt;/b&gt; of the statistics shows you how many sequential scans occurred in this period.&lt;/p&gt;
&lt;h3&gt;IDS &lt; 10&lt;/h3&gt;
&lt;pre&gt;
DATABASE sysmaster;
SELECT 
   stn.dbsname[1,15], 
   stn.tabname[1,18], 
   sti.ti_nptotal *
   (
      select sh_pagesize from sysshmvals
   )/1024/1024 mb_total,
   sti.ti_nrows, 
   spp.seqscans
FROM  systabnames stn, systabinfo sti, sysptprof spp
WHERE stn.partnum = sti.ti_partnum
AND   stn.partnum = spp.partnum
AND   spp.seqscans &gt; 0
ORDER BY mb_total DESC, spp.seqscans DESC;
&lt;/pre&gt;&lt;h3&gt;IDS &gt;= 10&lt;/h3&gt;
&lt;pre&gt;
DATABASE sysmaster;
SELECT
   stn.dbsname[1,15],
   stn.tabname[1,18],
   sti.ti_nptotal *
   (
      select pagesize
         from  sysdbspaces
         where name = dbinfo(&#039;dbspace&#039;, sti.ti_partnum)
   )/1024/1024 mb_total,
   sti.ti_nrows,
   spp.seqscans
FROM  systabnames stn, systabinfo sti, sysptprof spp
WHERE stn.partnum = sti.ti_partnum
AND   stn.partnum = spp.partnum
AND   spp.seqscans &gt; 0
ORDER BY mb_total DESC, spp.seqscans DESC;
&lt;/pre&gt;&lt;br /&gt;
</description>
 <comments>http://www.informix-zone.com/node/405#comment</comments>
 <category domain="http://www.informix-zone.com/taxonomy/term/112">smi-query-series</category>
 <category domain="http://www.informix-zone.com/taxonomy/term/93">sysmaster</category>
 <category domain="http://www.informix-zone.com/taxonomy/term/15">technical</category>
 <pubDate>Sat, 05 Jan 2008 17:16:43 +0100</pubDate>
 <dc:creator>eherber</dc:creator>
 <guid isPermaLink="false">405 at http://www.informix-zone.com</guid>
</item>
</channel>
</rss>
