<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by FanFan on Medium]]></title>
        <description><![CDATA[Stories by FanFan on Medium]]></description>
        <link>https://medium.com/@690929799?source=rss-ccb4b201e354------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by FanFan on Medium</title>
            <link>https://medium.com/@690929799?source=rss-ccb4b201e354------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 10:06:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@690929799/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[GBase Database: Used vs. UsedCurrent in Logical Log Monitoring]]></title>
            <link>https://medium.com/@690929799/gbase-database-used-vs-usedcurrent-in-logical-log-monitoring-f38e89377967?source=rss-ccb4b201e354------2</link>
            <guid isPermaLink="false">https://medium.com/p/f38e89377967</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[数据库]]></category>
            <category><![CDATA[gbase]]></category>
            <dc:creator><![CDATA[FanFan]]></dc:creator>
            <pubDate>Sat, 05 Dec 2026 01:31:13 GMT</pubDate>
            <atom:updated>2026-12-05T01:31:13.925Z</atom:updated>
            <content:encoded><![CDATA[<p>GBase Database distinguishes Used from UsedCurrent in SMI. Understanding this difference prevents false logical log alerts.</p><h3>Why Used and UsedCurrent Mean Different Things</h3><p>In GBase Database (GBase 8s), the syslogfil SMI view translates logical log bitmasks into readable status values.</p><p>Two states are particularly important:</p><ul><li>Used: A logical log has been used but not backed up. It requires monitoring and appropriate handling.</li><li>UsedCurrent: The logical log is currently being written. This is normal database activity, not an alert condition by itself.</li></ul><p>The difference is just one word, but the operational consequences are completely different.</p><p>Treating both states as abnormal creates unnecessary monitoring noise. As false alerts accumulate, on-call engineers become less responsive to genuine database risks.</p><h3>Use SMI to Distinguish Logical Log States</h3><p>The syslogfil view provides readable logical log states, including:</p><p>SMI Status Meaning Monitoring Action Used Used, not backed up Trigger an alert and investigate UsedCurrent Currently being written Normal; do not alert UsedBackedUp Used and backed up Check recovery requirements before considering reuse NewAdd Newly added log Monitor according to the expected configuration</p><p>The key is to build monitoring rules around the actual status rather than relying on usage percentages alone.</p><p>For example, an alert targeting Used should not automatically include UsedCurrent.</p><p>This is one of the practical benefits of SMI in GBase Database: bitmask information becomes readable SQL output, making monitoring rules easier to maintain and understand.</p><h3>Match SMI Results with the onstat Command</h3><p>For command-line verification, use:</p><pre>onstat -l | grep &quot;U--&quot; | grep -v C</pre><p>This filters used logical logs while excluding the current log.</p><p>The grep -v C condition is important because the current log also matches the U-- pattern. Without this exclusion, normal write activity may repeatedly trigger false alerts.</p><p>Another important distinction is %used.</p><p>A logical log reaching 100% usage is not necessarily an anomaly. Logical logs switch after becoming full, so the percentage describes how much has been written, not whether the log is in an unsafe state.</p><p>Similarly, U-B--- indicates a backed-up log that is still needed for recovery. A completed backup does not automatically mean the log can be cleaned up or reused.</p><p>In GBase Database logical log monitoring, status interpretation matters more than reading a percentage in isolation.</p><h3>Validate Alert Rules Before Production Deployment</h3><p>A reliable monitoring rule should distinguish normal activity from conditions requiring intervention.</p><p>After modifying logical log alerts, replay historical command output or use representative test samples.</p><p>A basic validation checklist:</p><ol><li>A Used sample should trigger the expected alert.</li><li>A UsedCurrent sample should not trigger an alert.</li><li>A log with %used=100 should not trigger an alert solely because of its usage percentage.</li><li>A UsedBackedUp log should not be automatically treated as reusable without checking recovery requirements.</li></ol><p>This validation is often faster and safer than deploying a new rule and waiting several days to see whether false alerts occur.</p><p>It also makes changes easier to review when monitoring scripts are maintained by multiple administrators.</p><h3>Alert Quality Is Part of Database Operations</h3><p>Alert credibility is a limited operational resource.</p><p>When on-call engineers repeatedly receive notifications that require no action, they gradually learn to ignore them. Eventually, genuine warnings may receive the same treatment.</p><p>The better approach is to exclude normal database processes when designing alert rules, rather than asking administrators to manually distinguish meaningful alerts from noise every time.</p><p>An alert should answer one practical question:</p><p><strong>Does this condition require human intervention?</strong></p><p>It should not simply report every event occurring inside the database.</p><p>GBase Database uses SMI to translate logical log states into readable values, allowing this judgment to move into the monitoring rule itself.</p><p>One fewer false alert can be more valuable than ten additional notifications.</p><h3>Final Thoughts</h3><p>Reliable GBase Database logical log monitoring depends on understanding the difference between usage and state.</p><p>Use onstat -l for direct inspection and syslogfil for SQL-based status monitoring. Alert on Used, exclude normal UsedCurrent activity, and verify recovery requirements before treating backed-up logs as reusable.</p><p>The goal is not to generate more alerts. It is to make every alert meaningful.</p><p><strong>Does your GBase Database monitoring system treat</strong> **UsedCurrent** <strong>as an anomaly, or have you already separated it from</strong> **Used** <strong>in your alert rules?</strong></p><p><strong>Keywords:</strong> GBase Database, GBase 8s, Used vs UsedCurrent, Logical Log Monitoring, syslogfil, SMI SQL Query, onstat -l, Database Alert Management, Database Administration</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f38e89377967" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why 100% Log Usage Is Not a GBase Database Failure]]></title>
            <link>https://medium.com/@690929799/why-100-log-usage-is-not-a-gbase-database-failure-d45418217312?source=rss-ccb4b201e354------2</link>
            <guid isPermaLink="false">https://medium.com/p/d45418217312</guid>
            <category><![CDATA[数据库]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[gbase]]></category>
            <dc:creator><![CDATA[FanFan]]></dc:creator>
            <pubDate>Sat, 05 Dec 2026 01:29:32 GMT</pubDate>
            <atom:updated>2026-12-05T01:29:32.252Z</atom:updated>
            <content:encoded><![CDATA[<p>A GBase Database logical log at 100% usage is not necessarily a failure. Understanding log flags is key to accurate monitoring.</p><h3>Why %used=100 Does Not Mean a Log Failure</h3><p>Today’s lesson: when checking logical log usage in GBase Database (GBase 8s), seeing %used=100 in onstat -l does not automatically indicate a problem.</p><p>Start with this command:</p><pre>onstat -l | grep &quot;U--&quot; | grep -v C</pre><p>A logical log switches to the next log when it becomes full. Therefore, 100% usage simply means the current log file has been filled.</p><p>The more important signal is its status.</p><p>A growing number of U-- logs (used but not backed up) can eventually prevent further log switching and cause the database instance to hang.</p><p>These two indicators describe different things:</p><ul><li>%used: How much of the logical log has been written.</li><li>Log flags: Whether the log has been backed up, is currently active, or is still needed for recovery.</li></ul><p>Confusing usage percentage with log status can turn normal database behavior into a false alarm.</p><h3>Understand Logical Log Flags in GBase Database</h3><p>In GBase Database, the logical log flags provide more operational information than the usage percentage alone.</p><p>Here are several states worth recognizing:</p><p>Log Flag Meaning Monitoring Interpretation U---C Current log being filled Normal; exclude from used-log alerts U-B--- Backed up but still needed for recovery Must not be treated as freely reusable F------ Free log Available for reuse U---C-L Current log containing the latest checkpoint Normal current-log state</p><p>The distinction between these flags matters.</p><p>For example, U---C represents the current logical log being written. It is not an abnormal condition.</p><p>That is why the following filter includes grep -v C:</p><pre>onstat -l | grep &quot;U--&quot; | grep -v C</pre><p>Without excluding the current log, monitoring scripts may repeatedly report a normal log as an issue.</p><p>GBase Database (GBase 8s) uses log status flags to describe operational states, allowing administrators to distinguish normal log activity from conditions that require investigation.</p><h3>Use SMI to Read Logical Log States in SQL</h3><p>Reading bitmask flags directly from command-line output is not always convenient, especially when database monitoring is integrated with external platforms.</p><p>GBase Database provides the syslogfil SMI view to translate logical log information into readable status values.</p><p>Common states include:</p><ul><li>UsedBackedUp</li><li>UsedCurrent</li><li>Used</li><li>NewAdd</li></ul><p>This makes monitoring easier to understand and automate.</p><p>For example, alert rules can distinguish Used logs from UsedCurrent logs instead of relying entirely on raw bitmask interpretation.</p><p>The practical advantage is that monitoring platforms can work with readable status values rather than requiring every administrator to understand the underlying flag combinations.</p><p>For automated monitoring, this distinction is particularly useful:</p><ul><li>Used: Monitor for accumulation and investigate backup or log-reuse conditions.</li><li>UsedCurrent: Normal current-log activity; do not trigger a failure alert solely because of this state.</li></ul><p>The key is to build alerts around actual log states, not just percentages.</p><h3>Separate Abnormal Numbers from Abnormal States</h3><p>This logical log example illustrates a common database monitoring mistake: assuming that a large number automatically indicates a failure.</p><p>Similar situations occur elsewhere in GBase Database:</p><ul><li>(CKPT REQ) in onstat - indicates a checkpoint request, not necessarily an error.</li><li>Physical log %used does not directly describe logical log backup or reuse status.</li><li>A logical log at 100% usage may simply have completed its normal write cycle.</li></ul><p>Database monitoring should distinguish between numerical indicators and operational states.</p><p>A percentage provides a measurement. A status explains what that measurement means.</p><p>Understanding both is essential for reliable GBase Database administration.</p><h3>Avoid False Alerts in Logical Log Monitoring</h3><p>There is another easy-to-miss problem when writing shell-based monitoring scripts.</p><p>Consider this filter:</p><pre>onstat -l | grep &quot;U--&quot;</pre><p>It also matches the current log because U---C contains the same U-- prefix.</p><p>As a result, a monitoring script may continuously generate alerts even when the database is operating normally.</p><p>The corrected filter is:</p><pre>onstat -l | grep &quot;U--&quot; | grep -v C</pre><p>The exclusion of C is intentional. It prevents the current log from being mistaken for a used, non-current log requiring investigation.</p><p>It is also worth adding a comment to the script explaining why this filter exists.</p><p>Otherwise, the next administrator may remove grep -v C while trying to simplify the command, unintentionally reintroducing persistent false alarms.</p><h3>Final Thoughts: Monitor Log States, Not Just Percentages</h3><p>Reliable GBase Database logical log monitoring requires more than checking whether a log is full.</p><p>Administrators need to understand which logs are current, which have been backed up, and which remain necessary for recovery.</p><p>Use onstat -l for direct inspection and SMI&#39;s syslogfil view for SQL-based monitoring. Build alert rules around meaningful status transitions rather than treating every 100% usage reading as a failure.</p><p><strong>Does your GBase Database monitoring system treat</strong> **%used=100** <strong>as an anomaly, or does it check logical log flags before triggering an alert?</strong></p><p><strong>Keywords:</strong> GBase Database, GBase 8s, Logical Log Monitoring, onstat -l, syslogfil, SMI, Database Log Management, Logical Log Backup, Database Administration, Database Monitoring</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d45418217312" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Monitor GBase Database Space Usage with SMI SQL Queries]]></title>
            <link>https://medium.com/@690929799/monitor-gbase-database-space-usage-with-smi-sql-queries-8943ab395b23?source=rss-ccb4b201e354------2</link>
            <guid isPermaLink="false">https://medium.com/p/8943ab395b23</guid>
            <category><![CDATA[数据库]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[gbase]]></category>
            <dc:creator><![CDATA[FanFan]]></dc:creator>
            <pubDate>Sat, 05 Dec 2026 01:28:16 GMT</pubDate>
            <atom:updated>2026-12-05T01:28:16.656Z</atom:updated>
            <content:encoded><![CDATA[<p>Monitor GBase Database space usage with SMI SQL queries. Convert raw page counts into readable dbspace capacity and usage percentages.</p><h3>From Raw Pages to Readable Space Usage</h3><p>The onstat -d command provides raw page counts. To calculate actual storage usage in bytes, you need to multiply size and free by pgsize. This manual conversion is a common source of errors in database space monitoring. Treating pages as bytes or overlooking the page size can lead to incorrect capacity assessments.</p><p>GBase Database provides another approach: use SQL through the System Monitoring Interface (SMI) to standardize space calculations and simplify daily checks.</p><h3>Query Dbspace Size and Usage Through SMI</h3><p>By joining syschktab (chunk details) with sysdbstab (dbspace attributes), you can retrieve dbspace information, including total size and usage percentage, in a single SQL query:</p><pre>SELECT A.dbsnum as No, trim(B.name) as name,<br>  format_units(sum(chksize), &#39;p&#39;) as DBS_SIZE,<br>  TRUNC(100-sum(decode(mdsize,-1,nfree,udfree))*100/sum(chksize),2)||&#39;%&#39; as used<br>FROM syschktab A, sysdbstab B<br>WHERE A.dbsnum = B.dbsnum<br>GROUP BY A.dbsnum, name<br>ORDER BY A.dbsnum;</pre><p>The format_units(...,&#39;p&#39;) function converts page counts using the current page size, eliminating the need to perform manual byte calculations.</p><p>In GBase Database (GBase 8s), this approach makes space reporting more consistent. Instead of calculating storage usage differently across scripts or administrators, everyone can use the same SQL-based calculation.</p><p>The benefit is straightforward: fewer manual calculations and more reliable capacity monitoring during daily operations.</p><h3>Check Dbspace Status Alongside Usage</h3><p>Space consumption is only one part of database storage monitoring. Dbspace availability is equally important.</p><p>The dbsstatus field provides status information such as:</p><ul><li>Operational: The dbspace is operating normally.</li><li>Recovering: The dbspace is undergoing recovery.</li><li>Disabled: The dbspace is unavailable and requires immediate investigation.</li></ul><p>Combining dbspace status with storage usage helps administrators identify both capacity risks and availability issues.</p><p>This makes the query useful for routine health checks and automated monitoring. Instead of maintaining separate checks for storage consumption and dbspace status, administrators can start with one consolidated result.</p><h3>Set Practical Dbspace Usage Thresholds</h3><p>A high storage usage percentage does not always indicate an immediate problem. Thresholds should reflect actual workload patterns and storage characteristics.</p><p>As initial monitoring references:</p><ul><li><strong>Above 85%:</strong> Review capacity trends and investigate potential growth risks.</li><li><strong>Around 90%:</strong> Consider triggering an alert for further investigation.</li></ul><p>These values are starting points, not universal thresholds.</p><p>Temporary dbspaces should also be monitored separately because their usage patterns can differ significantly from permanent dbspaces.</p><p>A better approach is to collect usage data at consistent times over at least two weeks. Use the results to establish a normal operating range before configuring alerts.</p><p>Applying another system’s thresholds without understanding your own workload is a common cause of unnecessary alert notifications.</p><h3>Check Down Chunks Before Analyzing Space Usage</h3><p>There is an important distinction between storage capacity and storage availability.</p><p>Before reviewing SMI usage results, run:</p><pre>onstat -d | grep PD</pre><p>This helps identify chunks in the Down state.</p><p>If a chunk is Down, tables stored on it may become inaccessible. In this situation, the reported usage percentage is no longer the primary concern. Chunk availability must be investigated first.</p><p>A practical GBase Database storage-checking sequence is:</p><ol><li>Check chunk status with onstat -d.</li><li>Identify Down chunks.</li><li>Query dbspace size and usage through SMI.</li><li>Review dbspace status.</li><li>Compare usage trends against established thresholds.</li></ol><p>This sequence separates immediate storage availability problems from longer-term capacity management.</p><h3>Understand Dbspace Types and Monitoring Boundaries</h3><p>The dbstype field in sysdbstab distinguishes different dbspace types.</p><p>Some field descriptions contain mirror-related terminology. These descriptions should be treated as metadata, not as instructions to perform deployment or switching operations.</p><p>The purpose of this SMI query is to read database storage information and monitor current states. Configuration changes, mirroring operations, and failover procedures belong to separate operational workflows.</p><p>Keeping this boundary clear helps prevent monitoring queries from being mistaken for operational commands.</p><h3>Standardize GBase Database Storage Reporting</h3><p>There is also a management benefit to using a consistent SMI query.</p><p>When administrators calculate storage usage independently, some report page counts, others report bytes, and some rely on approximate observations. Weekly capacity reviews can end up spending more time reconciling numbers than discussing actual risks.</p><p>A standardized SQL query provides a shared measurement method.</p><p>With consistent reporting, teams can focus on more useful questions:</p><ul><li>Which dbspaces are approaching capacity limits?</li><li>Are any dbspaces in a Disabled or Recovering state?</li><li>How quickly is storage consumption increasing?</li><li>Does the current capacity support expected workload growth?</li><li>When should additional storage be planned?</li></ul><p>GBase Database storage monitoring should go beyond checking whether a dbspace is nearly full. It should combine availability checks, usage trends, and consistent reporting.</p><p><strong>How does your team monitor dbspace usage: manual calculations from</strong> **onstat -d** <strong>or automated reporting through SMI SQL queries?</strong></p><p><strong>Keywords:</strong> GBase Database, GBase 8s, SMI SQL Query, Dbspace Monitoring, Database Space Usage, Database Storage Monitoring, SQL Database Administration, Database Capacity Planning</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8943ab395b23" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GBase Database Storage Monitoring: Automate Daily Checks with One Script]]></title>
            <link>https://medium.com/@690929799/gbase-database-storage-monitoring-automate-daily-checks-with-one-script-b219cf86b295?source=rss-ccb4b201e354------2</link>
            <guid isPermaLink="false">https://medium.com/p/b219cf86b295</guid>
            <category><![CDATA[数据库]]></category>
            <category><![CDATA[gbase]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[FanFan]]></dc:creator>
            <pubDate>Fri, 04 Dec 2026 01:31:34 GMT</pubDate>
            <atom:updated>2026-12-04T01:31:34.001Z</atom:updated>
            <content:encoded><![CDATA[<p>Automate GBase Database storage checks with one shell script to monitor chunks, dbspaces, logical logs, and storage risks.</p><h3>Why Automate GBase Database Storage Checks?</h3><p>Storage monitoring often fails not because DBAs don’t know which commands to run, but because checks depend on memory.</p><p>During a busy shift, someone may skip a check. On a quieter day, another person may fill in a missing record. A few days later, nobody can confirm whether the check actually happened.</p><p>The solution is simple: put the commands into one script and execute it once per shift.</p><p>For GBase Database (GBase 8s), a small shell script can provide a consistent overview of storage and logical log conditions.</p><h3>1. Build a Basic Storage Check Script</h3><p>Run the following script as the gbasedbt user:</p><pre>#!/bin/bash</pre><pre>echo &#39;SPACE&#39;<br>onstat -d</pre><pre>echo &#39;DOWN&#39;<br>onstat -d | grep PD</pre><pre>echo &#39;LOG&#39;<br>onstat -l</pre><pre>echo &#39;RISK&#39;<br>onstat -l | grep &quot;U--&quot; | grep -v C</pre><p>Each section answers a different operational question:</p><p>Section Command What to Check SPACE onstat -d Dbspace and chunk information DOWN onstat -d \| grep PD Chunks with Down status LOG onstat -l Logical log states RISK onstat -l \| grep &quot;U--&quot; \| grep -v C Used logs that have not been backed up</p><p>These onstat commands retrieve information from shared memory and do not require a database connection. This makes them particularly useful when the instance is experiencing connectivity problems.</p><h3>2. Understand Logical Log States Before Raising Alerts</h3><p>One important detail in the script is:</p><pre>onstat -l | grep &quot;U--&quot; | grep -v C</pre><p>Why exclude lines containing C?</p><p>The current logical log normally has a state such as U---C. It contains the U-- pattern, but it is not equivalent to a pileup of used, unbacked-up logs.</p><p>Without the grep -v C filter, the current log may trigger a persistent false warning.</p><p>There are several other details worth understanding:</p><p><strong>A logical log at 100% usage is not automatically a failure.</strong></p><p>A log normally switches after it becomes full. Therefore, 100% usage can simply mean that the log has been filled.</p><p><strong>Multiple used, unbacked-up logs are a more serious warning.</strong></p><p>A growing accumulation of these logs can eventually prevent further writes and make the database appear to have run out of storage.</p><p>**U-B---** <strong>should not be ignored either.</strong></p><p>A backed-up log may still be needed for recovery. Backup status alone does not mean that the log can be safely reused.</p><p>The important distinction is between normal log rotation, backup status, and recovery requirements.</p><h3>3. Combine onstat and SMI for Different Monitoring Needs</h3><p>GBase Database provides two useful monitoring approaches.</p><h3>onstat: Instance-Level Evidence</h3><p>Commands such as onstat -d and onstat -l retrieve information directly from shared memory.</p><p>Use them when:</p><ul><li>Checking instance storage status</li><li>Investigating Down chunks</li><li>Reviewing logical log states</li><li>Collecting evidence when database connections are unavailable</li></ul><h3>SMI: Structured Storage Information</h3><p>SMI queries run through dbaccess against the sysmaster database.</p><p>Two useful sources include:</p><ul><li>syschktab and sysdbstab: Used together to retrieve chunk and dbspace usage and status information</li><li>syslogfil: Provides logical log information, including status information derived from log bitmasks</li></ul><p>SMI is useful when you need structured percentages and reporting data.</p><p>The two approaches should complement each other rather than be treated as interchangeable.</p><p>Monitoring Method Main Purpose When to Use onstat Instance-level status and evidence Routine checks and connectivity problems SMI Structured storage and log information Reporting and detailed analysis</p><p>When the instance is healthy, collect both types of readings. When it is unhealthy and connections are unavailable, prioritize onstat and avoid repeatedly retrying SMI queries against an unreachable database.</p><p>Archive the two types of output separately to preserve their different purposes.</p><h3>4. Archive Results for Historical Comparison</h3><p>A storage check is much more useful when you can compare today’s results with previous readings.</p><p>Save each execution with a timestamp instead of overwriting the previous output.</p><p>For example:</p><pre>#!/bin/bash</pre><pre>LOG_DIR=&quot;/var/log/gbase_storage&quot;<br>mkdir -p &quot;$LOG_DIR&quot;</pre><pre>OUTPUT=&quot;$LOG_DIR/storage_$(date +%F_%H%M%S).log&quot;</pre><pre>{<br>    echo &quot;===== GBase Database Storage Check =====&quot;<br>    echo &quot;Time: $(date)&quot;<br>    echo</pre><pre>    echo &quot;===== SPACE =====&quot;<br>    onstat -d</pre><pre>    echo &quot;===== DOWN =====&quot;<br>    onstat -d | grep PD</pre><pre>    echo &quot;===== LOG =====&quot;<br>    onstat -l</pre><pre>    echo &quot;===== RISK =====&quot;<br>    onstat -l | grep &quot;U--&quot; | grep -v C</pre><pre>} &gt; &quot;$OUTPUT&quot; 2&gt;&amp;1</pre><p>The output files can help identify:</p><ul><li>Gradual dbspace and chunk growth</li><li>Repeated Down chunk conditions</li><li>Increasing logical log accumulation</li><li>Storage changes following maintenance or workload changes</li></ul><p>A week’s worth of archived output is much more valuable than a single isolated reading.</p><h3>5. Establish Storage Warning Thresholds</h3><p>Thresholds should be based on actual workload and historical behavior.</p><p>As initial reference points:</p><p>Storage Usage Suggested Attention 85% Start monitoring closely 90% Raise an alert and investigate</p><p>These are starting references, not universal GBase Database limits.</p><p>Collect at least two weeks of consistent readings before defining permanent alert rules. Consider growth rates, available capacity, workload peaks, and expected expansion requirements.</p><p>A dbspace at 85% with stable usage may be less urgent than one at 75% growing rapidly.</p><p>Trend analysis matters as much as the current percentage.</p><h3>6. Keep Detection Separate from Remediation</h3><p>The script should identify anomalies, not automatically repair them.</p><p>Its responsibilities should remain limited to detecting conditions such as:</p><ul><li>Down chunks</li><li>High storage utilization</li><li>Accumulating used, unbacked-up logical logs</li><li>Disabled dbspaces</li></ul><p>Expansion, logical log configuration changes, and long-transaction investigation are separate operational activities.</p><p>Each requires its own impact assessment, approval, and maintenance window where applicable.</p><p>Mixing detection and repair into one automatic action can create additional risks during an incident.</p><h3>Conclusion: Make GBase Database Storage Checks Repeatable</h3><p>A reliable GBase Database storage monitoring process does not need to start with a complicated monitoring platform.</p><p>One script, a fixed execution schedule, timestamped archives, and clearly defined warning thresholds can already make daily operations more consistent.</p><p>The essential principles are:</p><ul><li><strong>Automate:</strong> Run the same checks once per shift.</li><li><strong>Archive:</strong> Preserve historical readings for comparison.</li><li><strong>Monitor:</strong> Establish thresholds using actual workload data.</li><li><strong>Separate:</strong> Detect anomalies first and handle remediation through controlled procedures.</li></ul><p>GBase Database storage checks should be an executable operational process, not just a document that someone might remember to read.</p><p><strong>Is your on-call storage checklist still a document, or has it become an automated script?</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b219cf86b295" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GBase Database Daily Health Checks: 5 Common Questions and Answers]]></title>
            <link>https://medium.com/@690929799/gbase-database-daily-health-checks-5-common-questions-and-answers-d10e8cca1b13?source=rss-ccb4b201e354------2</link>
            <guid isPermaLink="false">https://medium.com/p/d10e8cca1b13</guid>
            <category><![CDATA[gbase]]></category>
            <category><![CDATA[数据库]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[FanFan]]></dc:creator>
            <pubDate>Fri, 04 Dec 2026 01:30:33 GMT</pubDate>
            <atom:updated>2026-12-04T01:30:33.225Z</atom:updated>
            <content:encoded><![CDATA[<p>Learn how to perform daily GBase Database health checks, monitor performance, set thresholds, and handle anomalies safely in production.</p><h3>5 Common Questions About Daily GBase Database Checks</h3><p>Almost every team has questions when establishing a daily database monitoring routine. How safe are the commands? How often should checks run? When should an anomaly trigger action?</p><p>Here are five practical answers for teams managing GBase Database (GBase 8s).</p><h3>1. Does onstat Affect Production Performance?</h3><p>Generally, no. onstat retrieves instance information directly from shared memory without requiring a database connection or executing SQL queries.</p><p>This makes it a convenient entry point for routine health checks, especially when the instance is experiencing connection issues.</p><p>However, avoid assuming that every monitoring command has zero overhead. Some commands may produce more output or require additional processing. For routine checks, use lightweight commands and monitor their impact.</p><h3>2. How Often Should Daily Checks Run?</h3><p>The checking frequency should follow the application’s workload pattern.</p><p>For high-frequency transaction systems, a practical approach is to:</p><ul><li>Check instance status and performance statistics at fixed times every day.</li><li>Run an additional check after configuration changes or maintenance.</li><li>Compare current readings with historical records.</li></ul><p>For batch-oriented systems, align checks with the batch execution cycle, especially before and after major jobs.</p><p>Frequency matters, but consistency matters more. Every check should follow the same sequence:</p><ol><li>Instance state</li><li>Performance statistics</li><li>Resource usage</li></ol><p>Archive the output with timestamps so that historical changes can be traced.</p><h3>3. How Should We Set Monitoring Thresholds?</h3><p>Values such as %cached &gt; 95% and deadlks &gt; 10 can serve as initial reference points, but they should not be treated as universal alert thresholds.</p><p>Different workloads produce different performance patterns.</p><p>A better approach is to collect statistics for at least two weeks using a consistent monitoring sequence. Establish the normal operating range for your own environment, then define alert thresholds based on actual observations.</p><p>For example, a metric that fluctuates normally during batch processing may indicate a genuine problem if the same behavior appears during regular transaction hours.</p><p>Using another system’s baseline without validation is a common source of unnecessary alerts.</p><h3>4. Can GBase Database Health Checks Be Performed Remotely?</h3><p>Yes, but the monitoring method matters.</p><p>Instance-state and performance commands such as onstat - and onstat -p can be executed directly on the database host under the gbasedbt account. Their output can then be collected and aggregated by external monitoring scripts.</p><p>For batch monitoring scenarios, SQL queries against SMI (System Monitoring Interface) tables provide another option.</p><p>The recommended approach is to establish a reliable local checking sequence first, then extend it to remote collection and centralized monitoring.</p><h3>5. Should We Fix an Anomaly Immediately?</h3><p>Not necessarily.</p><p>A health check is designed to detect abnormal conditions, not automatically authorize corrective actions.</p><p>Parameter tuning, index changes, and SQL optimization are separate operational activities. They should follow change-management procedures and be performed within an approved maintenance window when necessary.</p><p>Separating detection from remediation helps prevent rushed decisions during production incidents.</p><p>For example, a basic daily check can start with:</p><pre>echo &#39;STATE&#39;<br>onstat -</pre><pre>echo &#39;HEALTH&#39;<br>onstat -p | grep -E &#39;%cached|deadlks|lokwaits&#39;</pre><p>This provides a quick view of instance status and selected performance indicators. Any abnormal result should be investigated before making changes.</p><h3>Who Should Review the Daily Check Results?</h3><p>One important question often gets overlooked: who is responsible for reading the results?</p><p>The answer should not be “whoever is available.”</p><p>Assign a fixed role or owner to review the output at a defined time. Record anomalies in the operational handoff log and track them until they are resolved or confirmed as normal fluctuations.</p><p>The person responsible for performing checks should also understand how to interpret their results.</p><p>When execution and review are disconnected, daily checks can gradually become a routine that produces files but no operational insight.</p><h3>Conclusion: Make GBase Database Checks a Repeatable Process</h3><p>Reliable GBase Database daily health checks depend on more than the commands themselves.</p><p>Three principles make the process sustainable:</p><ul><li><strong>Consistency:</strong> Follow the same checking sequence every time.</li><li><strong>Archiving:</strong> Preserve timestamped outputs for historical comparison.</li><li><strong>Clear responsibility:</strong> Assign ownership for reviewing and following up on anomalies.</li></ul><p>GBase Database (GBase 8s) exposes useful instance and performance information through shared memory. The challenge is turning that information into a repeatable operational process.</p><p>A good monitoring policy defines not only what to check, but also when to check, who reviews the results, and what happens when something looks abnormal.</p><p><strong>What other questions has your team encountered when establishing daily database health checks?</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d10e8cca1b13" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GBase Database: Cumulative vs. Interval Metrics in onstat -p]]></title>
            <link>https://medium.com/@690929799/gbase-database-cumulative-vs-interval-metrics-in-onstat-p-9bf56635282d?source=rss-ccb4b201e354------2</link>
            <guid isPermaLink="false">https://medium.com/p/9bf56635282d</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[gbase]]></category>
            <category><![CDATA[数据库]]></category>
            <dc:creator><![CDATA[FanFan]]></dc:creator>
            <pubDate>Fri, 04 Dec 2026 01:29:07 GMT</pubDate>
            <atom:updated>2026-12-04T01:29:07.830Z</atom:updated>
            <content:encoded><![CDATA[<p>Learn how GBase Database uses cumulative and interval statistics to reveal database performance trends, identify short-term pressure, and improve monitoring accuracy.</p><h3>Why the Same onstat -p Output Can Lead to Different Conclusions</h3><p>Two DBAs can examine the same onstat -p output and reach opposite conclusions. The problem is often not inaccurate data, but how the statistics are interpreted: one reads cumulative values, while the other focuses on values collected after a reset.</p><pre>onstat -p | grep -E &#39;%cached|deadlks|lokwaits&#39;<br>onstat -z</pre><p>Understanding the difference between cumulative and interval statistics is essential for accurate performance monitoring in GBase Database (GBase 8s).</p><h3>1. Cumulative Statistics: Understanding Long-Term Stability</h3><p>By default, onstat -p reports cumulative performance statistics since the database instance started.</p><p>Its main advantage is consistency. Cumulative values provide a long-term overview and are less affected by short-lived workload fluctuations.</p><p>However, they also have a limitation: historical anomalies gradually lose their visibility as the instance continues running.</p><p>For example, consider an instance that has been running for 90 days. A five-minute period of unusually high VP activity may have almost no visible impact on its long-term statistics.</p><p>Cumulative metrics are therefore useful for identifying persistent patterns, but they may hide short-term performance issues.</p><h3>2. Interval Statistics: Measuring Performance Within a Specific Window</h3><p>Interval statistics focus on what happens during a defined period.</p><p>In GBase Database, you can use onstat -z to reset performance counters and then collect new statistics over a specific monitoring window.</p><p>Before resetting, always save the existing output:</p><pre>onstat -p &gt; /tmp/onstat_p_before_$(date +%F).txt<br>onstat -z</pre><p>This step matters because resetting counters also removes the current statistical baseline. Without an archived copy, you lose the ability to compare the previous readings.</p><p>After the reset, monitor the instance throughout a complete business cycle. This helps reveal workload pressure, temporary spikes, and gradual performance changes that cumulative statistics might conceal.</p><h3>3. Why Both Metrics Matter: A Practical Comparison</h3><p>Consider two performance tests running under similar workloads.</p><p>Their cumulative %cached values are both close to 96%, suggesting nearly identical performance.</p><p>However, hourly interval sampling tells a different story:</p><ul><li><strong>Test A:</strong> %cached remains stable at approximately 97%.</li><li><strong>Test B:</strong> %cached gradually declines from 97% to 94%.</li></ul><p>The cumulative readings suggest that both tests behave similarly. The interval readings reveal that Test B is experiencing gradual performance degradation.</p><p>This illustrates why relying on only one type of statistic can lead to misleading conclusions.</p><p>Metric Type What It Reveals Best Use Cumulative Long-term performance patterns Overall stability and historical trends Interval Changes within a defined period Short-term pressure and performance degradation</p><p>Neither approach replaces the other. They answer different monitoring questions.</p><h3>4. A Better Monitoring Strategy</h3><p>A practical approach is to combine both types of statistics.</p><p><strong>Step 1: Review cumulative statistics</strong></p><p>Start with the existing onstat -p output to understand the instance&#39;s overall performance.</p><p>Look for long-term patterns in metrics such as:</p><ul><li>%cached</li><li>deadlks</li><li>lokwaits</li></ul><p><strong>Step 2: Archive and reset</strong></p><p>Save the current statistics before running:</p><pre>onstat -p &gt; /tmp/onstat_p_before_$(date +%F).txt<br>onstat -z</pre><p><strong>Step 3: Monitor a complete workload cycle</strong></p><p>Collect interval statistics during normal business operations. Avoid drawing conclusions from a single reading.</p><p><strong>Step 4: Compare results</strong></p><p>Compare interval readings with historical cumulative values to identify whether an issue is temporary, recurring, or progressively worsening.</p><p>This approach provides both historical context and actionable performance details.</p><h3>5. Sampling Consistency Matters</h3><p>Even interval statistics can be misleading if the sampling method is inconsistent.</p><p>A single per sec reading may coincide with a business peak or an unusually quiet period. Treating that sample as representative of normal performance can lead to incorrect conclusions.</p><p>A more reliable method is fixed-time sampling.</p><p>For example, collect three readings at the same time each day over one week, then compare the ranges for the same metrics.</p><p>Consistent sampling makes it easier to distinguish normal workload fluctuations from genuine performance changes.</p><h3>Conclusion: Use Both Views for Better GBase Database Monitoring</h3><p>Cumulative and interval statistics serve different purposes in GBase Database performance monitoring.</p><ul><li>Cumulative values help answer: <strong>Has the instance been stable over time?</strong></li><li>Interval values help answer: <strong>What happened during this specific period?</strong></li></ul><p>Use cumulative statistics to establish the overall performance baseline, then reset and collect interval statistics when investigating specific workload conditions.</p><p>The key is not choosing one over the other, but understanding the time window behind every metric.</p><p><strong>When monitoring database capacity and performance, do you rely more on cumulative statistics or interval statistics?</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9bf56635282d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GBase Database Shared Memory Troubleshooting: When ipcs -m and onstat -g seg Don’t Match]]></title>
            <link>https://medium.com/@690929799/gbase-database-shared-memory-troubleshooting-when-ipcs-m-and-onstat-g-seg-dont-match-74aaed4b8d4b?source=rss-ccb4b201e354------2</link>
            <guid isPermaLink="false">https://medium.com/p/74aaed4b8d4b</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[gbase]]></category>
            <category><![CDATA[数据库]]></category>
            <dc:creator><![CDATA[FanFan]]></dc:creator>
            <pubDate>Thu, 03 Dec 2026 01:26:36 GMT</pubDate>
            <atom:updated>2026-12-03T01:26:36.322Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Summary:</strong> Learn how to troubleshoot shared memory mismatches in GBase Database by cross-checking segment classes, IDs, and process ownership before taking action.</p><p>When onstat -g seg and ipcs -m show different shared memory segments, don&#39;t immediately clear segments or terminate processes. In GBase Database (GBase 8s), a mismatch doesn&#39;t automatically indicate memory corruption. First, verify instance identity, segment classes, and process ownership.</p><h3>1. Start with Three Diagnostic Commands</h3><p>When investigating shared memory, collect information from three sources:</p><pre>onstat -g seg<br>ipcs -m | head -20<br>ps -ef | grep oninit</pre><p>Each command provides a different perspective:</p><ul><li>onstat -g seg: Displays shared memory segments associated with the database instance.</li><li>ipcs -m: Lists system-wide System V shared memory segments.</li><li>ps -ef: Shows running processes and helps verify process ownership.</li></ul><p>The outputs won’t necessarily match line by line.</p><p>Common explanations include:</p><ul><li>You’re comparing different database instances.</li><li>The instance recently restarted, and old shared memory segments have not yet been released.</li><li>You’re comparing different shared memory classes.</li></ul><p>Rule out these possibilities before treating the mismatch as a memory problem.</p><h3>2. Check the Shared Memory Class First</h3><p>Start with the class field in onstat -g seg.</p><p>The common classifications include:</p><p>Class Meaning R Resident memory V Virtual memory B Buffer pool M Message-related memory</p><p>These classes represent different memory purposes.</p><p>Comparing segments without considering their classes can lead to incorrect conclusions.</p><p>Before investigating a missing segment, make sure you’re comparing the same memory category.</p><h3>3. Cross-Reference Segment IDs</h3><p>Next, compare the id field in onstat -g seg with the shmid field in ipcs -m.</p><p>These identifiers help establish whether the segments reported by the database correspond to those registered by the operating system.</p><p>A mismatch may indicate:</p><ul><li>A recently restarted instance.</li><li>Old shared memory segments that have not yet been released.</li><li>An incorrect instance selection.</li></ul><p>Also verify the environment variable:</p><pre>echo $GBASEDBTSERVER</pre><p>Make sure the current shell points to the intended GBase Database instance.</p><p>Never assume that two command outputs belong to the same instance simply because they were collected on the same server.</p><h3>4. Verify Process Ownership with ps -ef</h3><p>The third step is to cross-reference the pid information with the running processes.</p><pre>ps -ef | grep oninit</pre><p>The objective is to establish whether the process associated with the segment is actually the expected database instance.</p><p>This matters because a suspicious-looking segment identifier alone does not prove that the segment belongs to the instance you’re investigating.</p><p>Process ownership provides another layer of evidence.</p><p>Only after confirming the instance, segment ID, and process relationship should you consider further investigation or corrective action.</p><h3>5. Understand Which Indicators Actually Matter</h3><p>One detail that can easily be misread is:</p><pre>(* segment locked in memory)</pre><p>This annotation indicates that a shared memory segment is locked in memory. It is not, by itself, an error or evidence of a segment mismatch.</p><p>Two other observations deserve attention:</p><p><strong>Declining segment count</strong></p><p>A steadily shrinking segment count may indicate changing memory allocation or resource conditions. Investigate it alongside instance activity and memory usage rather than treating every change as an error.</p><p><strong>Low system free memory</strong></p><p>Persistently low System free memory deserves investigation at the operating system level. Check overall memory consumption and available resources before attributing the issue to GBase Database.</p><p>The important distinction is between a normal difference in diagnostic output and a persistent resource shortage.</p><h3>6. Turn the Three Checks into a Repeatable Procedure</h3><p>For database administrators, a repeatable verification process is more reliable than relying on memory during an incident.</p><p>Use this sequence:</p><ol><li>Run onstat -g seg to collect database-level shared memory information.</li><li>Run ipcs -m to inspect operating system shared memory segments.</li><li>Compare segment classes before comparing identifiers.</li><li>Cross-reference database segment IDs with operating system shared memory IDs.</li><li>Verify GBASEDBTSERVER to confirm the intended instance.</li><li>Use ps -ef to check process ownership.</li><li>Investigate unresolved differences before considering cleanup or process intervention.</li></ol><p>This workflow also makes a useful operational checklist for new team members.</p><p>The most important rule should be explicit:</p><p><strong>Confirm ownership first. Diagnose the anomaly second. Take action last.</strong></p><h3>Final Thoughts</h3><p>GBase Database (GBase 8s) provides onstat -g seg for inspecting instance-level shared memory, while Linux commands such as ipcs -m and ps -ef provide the operating system perspective.</p><p>Together, these commands help administrators establish whether a suspicious segment actually belongs to the instance under investigation.</p><p>A difference between two command outputs is a reason to verify, not an instruction to delete.</p><p>In shared memory troubleshooting, an incorrect cleanup operation can turn a harmless diagnostic discrepancy into a real production incident.</p><p><strong>When investigating GBase Database memory issues, do you routinely cross-check segment classes, IDs, and process ownership before taking action?</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74aaed4b8d4b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GBase Database: What Quiescent Really Means When You Can’t Connect]]></title>
            <link>https://medium.com/@690929799/gbase-database-what-quiescent-really-means-when-you-cant-connect-73b27ec98906?source=rss-ccb4b201e354------2</link>
            <guid isPermaLink="false">https://medium.com/p/73b27ec98906</guid>
            <category><![CDATA[数据库]]></category>
            <category><![CDATA[gbase]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[FanFan]]></dc:creator>
            <pubDate>Thu, 03 Dec 2026 01:25:37 GMT</pubDate>
            <atom:updated>2026-12-03T01:25:37.603Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Summary:</strong> Learn how to interpret Quiescent in GBase Database, troubleshoot connection failures, and avoid unnecessary database restarts.</p><p>When a GBase Database connection fails and onstat - reports Quiescent, restarting the instance may be the worst first move. Understanding database operating states helps prevent unnecessary intervention during maintenance and recovery.</p><h3>1. What Does Quiescent Mean in GBase Database?</h3><p>Start by checking the instance status:</p><pre>onstat -<br># gbase01: Quiescent -- Up 3 days 06:13:19 -- 165364 Kbytes</pre><p>When administrators see a connection failure alongside a state other than On-Line, the immediate assumption is often that the database is down.</p><p>But Quiescent does not necessarily mean an instance failure.</p><p>It is a quiet administrative state, commonly associated with maintenance activities. In this state, normal client connections may be unavailable by design.</p><p>Before restarting GBase Database, ask:</p><ul><li>Who initiated the state change?</li><li>When was the maintenance operation started?</li><li>Is there an approved maintenance window?</li><li>Has the operation already finished?</li></ul><p>If the state matches an ongoing maintenance activity, wait for the operation to complete rather than restarting the instance.</p><p>An unnecessary restart can interrupt maintenance and remove useful operational context.</p><h3>2. Why Maintenance Communication Matters</h3><p>The difficult part is that maintenance windows are not always documented in the duty schedule.</p><p>Some teams perform administrative operations without notifying the on-call engineer. When the next person checks the database, Quiescent looks like an unexpected outage.</p><p>A simple communication rule can prevent this:</p><p><strong>Any operation that puts a GBase Database instance into a quiet administrative state must be announced in the duty channel.</strong></p><p>The notification should include:</p><ul><li>The instance name.</li><li>The reason for the operation.</li><li>The person responsible.</li><li>The expected start and completion times.</li></ul><p>This small agreement makes database troubleshooting more predictable and reduces unnecessary restarts.</p><h3>3. Understand Other GBase Database Instance States</h3><p>Quiescent is not the only state that can be misinterpreted.</p><p>When using onstat -, understand these common status indicators:</p><p>State or Marker Meaning Recommended Response On-Line Normal operating state Continue routine monitoring Quiescent Quiet administrative state Check maintenance activity Fast Recovery Instance recovering after a crash Monitor recovery progress (CKPT REQ) Checkpoint requested Monitor the checkpoint process (CKPT INP) Checkpoint in progress Allow the operation to proceed</p><p>Two checkpoint markers deserve particular attention.</p><p>(CKPT REQ) indicates that a checkpoint has been requested, while (CKPT INP) indicates that a checkpoint is underway.</p><p>Neither marker alone means the database has failed.</p><p>Similarly, Fast Recovery is a recovery state, not an instruction to repeatedly restart the instance. Allow recovery to proceed and investigate further if it fails to make progress.</p><h3>4. Use Uptime to Identify Unexpected Restarts</h3><p>The Up field in onstat - shows how long the instance has been running continuously.</p><p>For example:</p><pre>gbase01: On-Line -- Up 3 days 06:13:19 -- 165364 Kbytes</pre><p>If yesterday’s output showed several days of uptime but today’s output shows only a few seconds, the instance has restarted.</p><p>This information is especially useful when distinguishing two situations:</p><ul><li><strong>Maintenance state:</strong> The instance has remained in a quiet state during an administrative operation.</li><li><strong>Recent restart:</strong> The instance has restarted, potentially entering recovery or returning to normal service.</li></ul><p>Read uptime together with the current state rather than interpreting either field in isolation.</p><p>If the output includes a role identifier, treat it as contextual information during the initial health check. Do not initiate a role switch based solely on this observation; role switching requires its own procedures and operational checks.</p><h3>5. One More Check: shared memory not initialized</h3><p>If onstat - returns:</p><pre>shared memory not initialized for GBASEDBTSERVER &#39;gbase01&#39;</pre><p>Don’t immediately conclude that the instance is down.</p><p>One possible cause is that the current environment points to a different instance.</p><p>Before taking action, verify the environment configuration, especially the GBASEDBTSERVER variable, and confirm that you&#39;re checking the intended instance.</p><p>This is an important distinction in GBase Database troubleshooting: an environment mismatch and an instance startup failure require different responses.</p><h3>6. A Safer On-Call Troubleshooting Order</h3><p>When a GBase Database connection fails, follow this sequence:</p><ol><li><strong>Check the instance state:</strong> Run onstat -.</li><li><strong>Check for recent changes:</strong> Ask whether maintenance or administrative operations are underway.</li><li><strong>Review uptime:</strong> Determine whether the instance has restarted recently.</li><li><strong>Interpret the state:</strong> Distinguish normal operation, maintenance, and crash recovery.</li><li><strong>Verify the environment:</strong> Check GBASEDBTSERVER if shared memory is not initialized.</li><li><strong>Take action only after identifying the likely cause.</strong></li></ol><p>The goal is not to avoid restarting a database under all circumstances. It is to avoid restarting before understanding why the instance is in its current state.</p><h3>Final Thoughts</h3><p>GBase Database (GBase 8s) exposes its current operating state through onstat -, which reads instance status information from shared memory and can be executed repeatedly during production checks.</p><p>For on-call database administrators, the most important habit is to interpret the state before taking action.</p><p>A connection failure is a symptom, not a diagnosis. Quiescent may indicate planned maintenance, while Fast Recovery indicates an ongoing recovery process.</p><p><strong>Check the state first. Ask about changes second. Take action last.</strong></p><p>When you encounter Quiescent in production, do you check for maintenance activity first or restart the instance?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73b27ec98906" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GBase Database: Why a 95% Cache Hit Rate Isn’t Enough]]></title>
            <link>https://medium.com/@690929799/gbase-database-why-a-95-cache-hit-rate-isnt-enough-7a4f9170eedd?source=rss-ccb4b201e354------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a4f9170eedd</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[gbase]]></category>
            <category><![CDATA[数据库]]></category>
            <dc:creator><![CDATA[FanFan]]></dc:creator>
            <pubDate>Thu, 03 Dec 2026 01:24:31 GMT</pubDate>
            <atom:updated>2026-12-03T01:24:31.516Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Summary:</strong> Learn how to interpret %cached in GBase Database, monitor performance counters, and build workload-specific alert thresholds.</p><p>A cache hit rate above 95% is generally a good sign, but it doesn’t automatically mean your database is healthy. In GBase Database (GBase 8s), %cached is only one performance indicator. Understanding its trend alongside other counters is what makes database monitoring useful.</p><h3>1. What Does %cached Actually Tell You?</h3><p>Start with:</p><pre>onstat -p | grep -E &#39;%cached|deadlks|lokwaits|lockreqs|seqscans&#39;</pre><p>%cached represents the percentage of reads satisfied by the buffer pool rather than requiring disk I/O.</p><p>A rate below 95% deserves investigation, but a rate above 95% doesn’t guarantee optimal performance.</p><p>The actual baseline depends on several factors:</p><ul><li><strong>Buffer pool size:</strong> Whether frequently accessed data fits in memory.</li><li><strong>Data distribution:</strong> How much of the working dataset is repeatedly accessed.</li><li><strong>Access patterns:</strong> Whether workloads are predominantly repetitive or involve large sequential reads.</li></ul><p>For example, a newly launched database may naturally show a low cache hit rate before its working data enters memory. A long-running production system experiencing a sudden decline deserves much closer attention.</p><p>The key is to distinguish an unusual value from a meaningful change in trend.</p><h3>2. Establish a Workload-Specific Baseline</h3><p>Instead of relying on a universal threshold, collect performance statistics over at least two weeks.</p><p>Keep the observation conditions consistent and include a complete business cycle.</p><p>Your monitoring process should answer three questions:</p><ol><li>What is the normal %cached range during business hours?</li><li>Does the hit rate change significantly during peak workloads?</li><li>Is a declining hit rate accompanied by increased I/O waits or other performance symptoms?</li></ol><p>Once you understand the normal behavior of your GBase Database workload, you can establish more meaningful alert thresholds.</p><p>A fixed 95% threshold is a useful starting point, not a substitute for workload analysis.</p><h3>3. Understand What onstat -z Really Does</h3><p>One common operational misunderstanding is treating a statistics reset as a performance fix.</p><pre>onstat -z</pre><p>This command resets cumulative performance counters. It does not:</p><ul><li>Change database configuration.</li><li>Restart the database instance.</li><li>Terminate active sessions.</li><li>Resolve SQL performance problems.</li></ul><p>If %cached appears to recover after a reset, it may simply be because the historical counters were cleared.</p><p>The underlying performance issue could still exist.</p><p>A better approach is to archive the current statistics first, reset the counters, and then monitor the system throughout a complete business cycle.</p><pre>onstat -p &gt; /tmp/onstat_p_before_$(date +%F).txt<br>onstat -z</pre><p>Remember: resetting counters removes the historical baseline. Always preserve the previous snapshot before doing so.</p><h3>4. Read Related Performance Counters Together</h3><p>The onstat -p output provides several useful indicators. Looking at them together gives you a broader picture of GBase Database performance.</p><p>Metric What It Indicates What to Investigate %cached Buffer pool read-cache hit rate Memory usage and access patterns deadlks Cumulative deadlocks detected and prevented Transaction order and concurrency lokwaits / lockreqs Lock contention Transaction duration and locking behavior seqscans Sequential scans Access paths and indexing bufwaits Buffer-related waits Buffer availability ckpwaits Checkpoint-related waits Checkpoint activity lgnwait Log-related waits Log I/O and write performance</p><p>A few practical observations:</p><ul><li>A growing deadlks count is a reason to review transaction execution order. A count above 10 is a prompt for investigation, not a universal failure threshold.</li><li>A rising lokwaits / lockreqs ratio may indicate increasing concurrency contention.</li><li>Persistently high seqscans deserves investigation, especially when accompanied by slow queries.</li><li>Increasing bufwaits, ckpwaits, or lgnwait can point toward resource bottlenecks.</li></ul><p>These counters provide clues, not automatic diagnoses. For example, a sequential scan isn’t necessarily inefficient, and a deadlock count alone doesn’t establish current application impact.</p><h3>5. Build a Practical Monitoring Routine</h3><p>For GBase Database administrators, a simple and repeatable monitoring routine is more useful than collecting isolated snapshots.</p><p>A practical workflow:</p><ol><li>Run onstat -p and archive the initial statistics.</li><li>Reset cumulative counters with onstat -z when appropriate.</li><li>Collect statistics at consistent intervals.</li><li>Compare changes across normal and peak business periods.</li><li>Correlate abnormal counters with SQL execution, application behavior, and operating system metrics.</li><li>Adjust alert thresholds according to actual workload patterns.</li></ol><p>This approach helps distinguish persistent performance problems from temporary fluctuations.</p><h3>Final Thoughts</h3><p>GBase Database (GBase 8s) provides several useful performance indicators through onstat -p, making it easier to perform initial instance-level checks without stitching together multiple monitoring commands.</p><p>However, instance-level statistics cannot identify the exact SQL statement responsible for a performance issue. Further investigation is necessary to locate the root cause.</p><p>The most important lesson is simple: <strong>don’t confuse a good metric value with a healthy database.</strong></p><p>Monitor trends, understand cumulative counters, preserve historical snapshots, and calibrate thresholds against real workloads.</p><p><strong>When did you last review your database cache hit-rate threshold?</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a4f9170eedd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GBase Database: Two Causes of “Shared Memory Not Initialized” and How to Fix Them]]></title>
            <link>https://medium.com/@690929799/gbase-database-two-causes-of-shared-memory-not-initialized-and-how-to-fix-them-55aecf347ddf?source=rss-ccb4b201e354------2</link>
            <guid isPermaLink="false">https://medium.com/p/55aecf347ddf</guid>
            <category><![CDATA[数据库]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[gbase]]></category>
            <dc:creator><![CDATA[FanFan]]></dc:creator>
            <pubDate>Tue, 01 Dec 2026 01:26:15 GMT</pubDate>
            <atom:updated>2026-12-01T01:26:15.018Z</atom:updated>
            <content:encoded><![CDATA[<p>The GBase Database error shared memory not initialized has two common causes: an instance that isn&#39;t running or an incorrect environment setting.</p><h3>Why Does “Shared Memory Not Initialized” Occur?</h3><p>When running onstat -, you may encounter this message:</p><pre>shared memory not initialized for GBASEDBTSERVER &#39;gbase01&#39;</pre><p>The first reaction is often that the database service is down. However, this message does not necessarily mean the instance has stopped.</p><p>In GBase Database(GBase 8s), it can indicate two different situations:</p><ol><li>The database instance has not started or failed during startup.</li><li>Your current session is pointing to the wrong database instance.</li></ol><p>These situations require different troubleshooting steps. Identifying which one applies should come before executing any startup or shutdown command.</p><h3>1. Scenario One: The Database Instance Is Not Running</h3><p>The first possibility is straightforward: the target instance has not been started.</p><p>If the environment is correct and the instance is intentionally stopped, you can start it with:</p><pre>oninit -vy</pre><p>The two options serve different purposes:</p><ul><li>-v: Displays verbose startup information.</li><li>-y: Automatically confirms prompts.</li></ul><p>After successful initialization, check the instance status:</p><pre>onstat -</pre><p>The expected status is:</p><pre>On-Line</pre><p>If startup fails, do not repeatedly execute oninit. Check the startup output and relevant database logs to identify the actual failure.</p><h3>Be Careful with Shutdown Commands</h3><p>For comparison, the following command can stop an instance immediately:</p><pre>onmode -ky</pre><p>This is not a routine troubleshooting command.</p><p>Before using it, evaluate active sessions and in-flight transactions. An immediate shutdown can interrupt ongoing work and should only be performed when the operational impact is understood.</p><p>Starting an instance and forcing it to stop are very different operations. Do not treat them as equally harmless diagnostic steps.</p><h3>2. Scenario Two: GBASEDBTSERVER Points to the Wrong Instance</h3><p>The second possibility is more deceptive: the database is running, but your current terminal is connected to the wrong instance environment.</p><p>Look closely at the error:</p><pre>shared memory not initialized for GBASEDBTSERVER &#39;gbase01&#39;</pre><p>The value gbase01 is the instance name associated with the current environment.</p><p>Check the environment variable:</p><pre>echo $GBASEDBTSERVER</pre><p>Then compare it with the instance you actually intend to access.</p><p>In environments with multiple GBase Database instances, this mistake is particularly common. One terminal may point to gbase01, while another points to a different instance.</p><p>The database itself may be running normally. Only the current session is looking in the wrong place.</p><p>This is why checking environment variables should be one of the first troubleshooting steps.</p><h3>3. Compare Environment Variables Across Terminals</h3><p>If onstat - produces different results in different terminals, check whether their environment settings are consistent.</p><p>Start with:</p><pre>echo $GBASEDBTSERVER</pre><p>Also inspect the related database environment:</p><pre>env | grep -E &#39;GBASE|INFORMIX&#39;</pre><p>Compare the results between the terminals and verify that each session uses the intended instance configuration.</p><p>A particularly common situation in new environments is that the root and gbasedbt accounts have different instance settings.</p><p>For example:</p><ul><li>The root session points to gbase01.</li><li>The gbasedbt session points to another instance.</li><li>The administrator checks one environment but investigates the other.</li></ul><p>This can lead to unnecessary troubleshooting simply because the wrong instance was being examined.</p><p>A more reliable practice is to define the required environment variables in the database user’s login configuration rather than exporting them manually every time.</p><p>For example, place the appropriate instance settings in the relevant login script and verify them after logging in.</p><h3>4. Check Whether System Service Management Is Enabled</h3><p>There is another operational detail worth checking: whether the installation enabled system service management.</p><p>If the installation used:</p><pre>DB_SERVICE=2</pre><p>the following service commands may be available:</p><pre>service gbase8s status<br>service gbase8s start<br>service gbase8s stop<br>service gbase8s restart</pre><p>They provide an alternative way to manage the instance through the operating system service interface.</p><p>However, this depends on the installation configuration.</p><p>If system service integration was not enabled, these commands may not be available. Do not assume every GBase Database installation supports the same service-management interface.</p><h3>5. A Practical Troubleshooting Sequence</h3><p>When you encounter shared memory not initialized, follow this sequence before making changes:</p><p>Step Check Purpose 1 echo $GBASEDBTSERVER Confirm the target instance 2 Compare terminal environments Identify inconsistent settings 3 Check instance status Determine whether the instance is running 4 Review startup logs Investigate failed initialization 5 Run oninit -vy if appropriate Start an intentionally stopped instance 6 Check service configuration Confirm whether service management is enabled</p><p>The key is to distinguish an actual startup failure from an environment mismatch.</p><p>If the instance has not started, investigate startup and logs.</p><p>If startup failed midway, identify the failure before trying again.</p><p>If the environment points to the wrong instance, correct the environment instead of restarting a healthy database.</p><h3>Conclusion</h3><p>The error shared memory not initialized describes a symptom, not necessarily its underlying cause.</p><p>In GBase Database(GBase 8s), the instance may genuinely be stopped, or the current terminal may simply be pointing to a different instance.</p><p>Before executing startup or shutdown commands, verify GBASEDBTSERVER and confirm which instance your session is actually accessing.</p><p>A few seconds spent checking the environment can save much more time spent investigating the wrong database.</p><p><strong>Have you ever spent time troubleshooting a database startup issue only to discover that your terminal was pointing to the wrong instance?</strong></p><p><strong>Keywords:</strong> GBase Database, GBase 8s, Shared Memory Not Initialized, GBASEDBTSERVER, Database Startup Troubleshooting, Database Environment Variables, oninit, onstat, Linux Database Administration</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=55aecf347ddf" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>