<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: mmllllzcn</title>
    <description>The latest articles on DEV Community by mmllllzcn (@mmllllzcn).</description>
    <link>https://dev.to/mmllllzcn</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4062113%2Feee70651-be48-4a57-beb0-5ef576a28ad2.png</url>
      <title>DEV Community: mmllllzcn</title>
      <link>https://dev.to/mmllllzcn</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mmllllzcn"/>
    <language>en</language>
    <item>
      <title>GBase Database: Why unload Delimiters Are Limited to 4 Characters</title>
      <dc:creator>mmllllzcn</dc:creator>
      <pubDate>Sat, 21 Nov 2026 01:17:13 +0000</pubDate>
      <link>https://dev.to/mmllllzcn/gbase-database-why-unload-delimiters-are-limited-to-4-characters-4p0d</link>
      <guid>https://dev.to/mmllllzcn/gbase-database-why-unload-delimiters-are-limited-to-4-characters-4p0d</guid>
      <description>&lt;p&gt;&lt;strong&gt;Summary:&lt;/strong&gt; Learn how delimiter selection affects data export and import in GBase Database(GBase 8s). This guide explains the four-character delimiter limit, compound delimiters, delimiter collisions, and how to keep &lt;code&gt;unload&lt;/code&gt; and &lt;code&gt;load&lt;/code&gt; operations consistent.&lt;/p&gt;

&lt;p&gt;Today I ran into a small but costly data export issue: I exported a table using commas as delimiters, then loaded it back. One record became five rows.&lt;/p&gt;

&lt;p&gt;The data was not corrupted. The problem was that the remarks field already contained commas.&lt;/p&gt;

&lt;p&gt;This is a classic delimiter collision, and it is worth understanding how to avoid it in GBase Database.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Choose a Compound Delimiter Instead of a Single Character
&lt;/h2&gt;

&lt;p&gt;In GBase Database(GBase 8s), the &lt;code&gt;unload&lt;/code&gt; statement allows you to specify a delimiter for exported data.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="no"&gt;UNLOAD&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="s1"&gt;'/data/order.unl'&lt;/span&gt;
&lt;span class="no"&gt;DELIMITER&lt;/span&gt; &lt;span class="s1"&gt;'|#'&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;t_order&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The delimiter here is &lt;code&gt;|#&lt;/code&gt;, a combination of two characters.&lt;/p&gt;

&lt;p&gt;GBase Database supports delimiters of up to four characters. You can combine multiple characters into one delimiter, but a delimiter longer than four characters is rejected rather than silently truncated.&lt;/p&gt;

&lt;p&gt;Why use a compound delimiter?&lt;/p&gt;

&lt;p&gt;A single character such as &lt;code&gt;|&lt;/code&gt; or &lt;code&gt;#&lt;/code&gt; may already appear in business data. A combination of two characters is generally less likely to occur naturally in a text field.&lt;/p&gt;

&lt;p&gt;The objective is to reduce delimiter collisions, especially when exporting large datasets containing free-form text.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The Export and Import Delimiters Must Match
&lt;/h2&gt;

&lt;p&gt;Choosing a delimiter during export is only half the job.&lt;/p&gt;

&lt;p&gt;The same delimiter must be specified when importing the file with &lt;code&gt;load&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="no"&gt;LOAD&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="s1"&gt;'/data/order.unl'&lt;/span&gt;
&lt;span class="no"&gt;DELIMITER&lt;/span&gt; &lt;span class="s1"&gt;'|#'&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;t_order_bak&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The export and import operations must use the same delimiter.&lt;/p&gt;

&lt;p&gt;Consider what happens if you export using &lt;code&gt;|#&lt;/code&gt; but import using &lt;code&gt;|&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The import process does not necessarily report a clear delimiter mismatch error. Instead, it may split fields incorrectly, resulting in column-count errors, data conversion failures, or incorrectly mapped values.&lt;/p&gt;

&lt;p&gt;The error message often points to the symptom rather than the original cause.&lt;/p&gt;

&lt;p&gt;This is why delimiter consistency matters in GBase Database data migration and backup workflows.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Inspect the Exported File Before Loading
&lt;/h2&gt;

&lt;p&gt;Before importing a large export file, inspect a few records:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;head -n 3 /data/order.unl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check whether each line contains the expected number of fields and whether the delimiter appears unexpectedly inside business data.&lt;/p&gt;

&lt;p&gt;A useful validation sequence is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Export a small sample.&lt;/li&gt;
&lt;li&gt;Inspect the first few records.&lt;/li&gt;
&lt;li&gt;Verify the expected field boundaries.&lt;/li&gt;
&lt;li&gt;Test the import into a temporary or staging table.&lt;/li&gt;
&lt;li&gt;Run the full import only after validation succeeds.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This small checkpoint can prevent a much larger data-cleanup task.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Keep the Delimiter in One Shared Configuration
&lt;/h2&gt;

&lt;p&gt;There is another easy mistake: changing the export delimiter without updating the import and validation scripts.&lt;/p&gt;

&lt;p&gt;For example, the export script may use &lt;code&gt;|#&lt;/code&gt;, while the import script still uses &lt;code&gt;|&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;An even more dangerous situation occurs when the validation script continues splitting records using the old delimiter and reports success.&lt;/p&gt;

&lt;p&gt;Define the delimiter once:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;DELIM&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'|#'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then reference the same configuration in the export, import, and validation workflows.&lt;/p&gt;

&lt;p&gt;The exact variable-passing mechanism depends on how your SQL and shell scripts are organized, but the principle is simple: one configuration value should control all three stages.&lt;/p&gt;

&lt;p&gt;A false validation success is often more dangerous than an obvious import failure because the problem may remain undetected until business users discover incorrectly mapped data.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. What If the Business Field Contains the Entire Delimiter?
&lt;/h2&gt;

&lt;p&gt;A compound delimiter reduces collision risk, but it does not eliminate it.&lt;/p&gt;

&lt;p&gt;What if a remarks field genuinely contains &lt;code&gt;|#&lt;/code&gt;?&lt;/p&gt;

&lt;p&gt;Do not assume that choosing a longer delimiter will solve the problem. GBase Database's delimiter length is limited, and no delimiter is guaranteed to be absent from arbitrary free-form text.&lt;/p&gt;

&lt;p&gt;Consider the data format itself:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Structured fields are easier to export and validate.&lt;/li&gt;
&lt;li&gt;Free-form text may require separate handling.&lt;/li&gt;
&lt;li&gt;If the export format supports an appropriate escaping or encoding strategy, define it consistently on both sides.&lt;/li&gt;
&lt;li&gt;Validate records containing special characters before processing the full dataset.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Delimiter selection is ultimately a data-boundary decision, not just a SQL parameter choice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;In GBase Database(GBase 8s), &lt;code&gt;unload&lt;/code&gt; and &lt;code&gt;load&lt;/code&gt; make data export and import straightforward, but delimiter selection deserves attention.&lt;/p&gt;

&lt;p&gt;Remember three rules:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Choose a delimiter of no more than four characters.&lt;/li&gt;
&lt;li&gt;Use exactly the same delimiter for export and import.&lt;/li&gt;
&lt;li&gt;Validate field boundaries before loading the full dataset.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A delimiter is not just a character between columns. It defines where one piece of data ends and another begins.&lt;/p&gt;

&lt;p&gt;Before every export, ask one question: &lt;strong&gt;Can any field contain the delimiter I selected?&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>gbase</category>
      <category>database</category>
      <category>数据库</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>GBase Database: Single vs. Layered Dbspace Layout — A Reproducible Comparison</title>
      <dc:creator>mmllllzcn</dc:creator>
      <pubDate>Sat, 21 Nov 2026 01:14:52 +0000</pubDate>
      <link>https://dev.to/mmllllzcn/gbase-database-single-vs-layered-dbspace-layout-a-reproducible-comparison-2kg8</link>
      <guid>https://dev.to/mmllllzcn/gbase-database-single-vs-layered-dbspace-layout-a-reproducible-comparison-2kg8</guid>
      <description>&lt;p&gt;&lt;strong&gt;Summary:&lt;/strong&gt; Should business tables share rootdbs or use dedicated dbspaces? This guide presents a reproducible benchmark methodology for comparing single-space and layered storage layouts in GBase Database(GBase 8s), covering test design, SQL placement, I/O behavior, temporary space usage, and operational overhead.&lt;/p&gt;

&lt;p&gt;Deciding whether business tables need dedicated dbspaces often turns into a debate based on individual experience. A more reliable approach is to run a controlled comparison.&lt;/p&gt;

&lt;p&gt;Use the same machine, the same data, and the same SQL workload. Change only the storage layout, then compare the results.&lt;/p&gt;

&lt;p&gt;This article focuses on the testing methodology, not a predetermined conclusion. Actual results depend on hardware, data volume, concurrency, and workload characteristics. Someone else's benchmark numbers cannot replace testing in your own environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Design Two Control Groups
&lt;/h2&gt;

&lt;p&gt;The comparison uses two storage layouts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Group A: Single-space layout&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;All business tables reside in &lt;code&gt;rootdbs&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Temporary sorting uses the default storage arrangement.&lt;/li&gt;
&lt;li&gt;No additional business dbspaces are introduced.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Group B: Layered-space layout&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Business tables reside in &lt;code&gt;datadbs01&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Historical tables reside in &lt;code&gt;datadbs02&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Temporary sorting uses &lt;code&gt;tempdbs01&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;BLOB data resides in &lt;code&gt;sbspace01&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The purpose is to isolate the impact of storage placement rather than introduce unrelated configuration differences.&lt;/p&gt;

&lt;h3&gt;
  
  
  Control Variables
&lt;/h3&gt;

&lt;p&gt;Keep the following conditions consistent:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variable&lt;/th&gt;
&lt;th&gt;Requirement&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Hardware&lt;/td&gt;
&lt;td&gt;Same machine or identical specifications&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Operating system&lt;/td&gt;
&lt;td&gt;Same OS version and kernel parameters&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Data&lt;/td&gt;
&lt;td&gt;Same volume, table structures, and indexes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SQL workload&lt;/td&gt;
&lt;td&gt;Same SQL statements and concurrency ramp&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Client&lt;/td&gt;
&lt;td&gt;Same client software and network path&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Database state&lt;/td&gt;
&lt;td&gt;Consistent initialization and cache conditions&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;One important detail is cache management.&lt;/p&gt;

&lt;p&gt;If Group A runs first and Group B runs immediately afterward, the buffer pool may still contain frequently accessed data from the first test. This can distort the comparison.&lt;/p&gt;

&lt;p&gt;Restart the instance before each test group and use a consistent warm-up procedure. Also keep the test order documented; repeating the runs with reversed order can help identify order-related bias.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Build the Layered Storage Layout
&lt;/h2&gt;

&lt;p&gt;Before creating the dbspaces for Group B, prepare the physical chunk file.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;touch /data/gbase/datachk01
chown gbasedbt:gbasedbt /data/gbase/datachk01
chmod 660 /data/gbase/datachk01
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then create the business dbspace:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;onspaces -c -d datadbs01 \
  -p /data/gbase/datachk01 \
  -o 0 \
  -s 102400 \
  -k 16
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Repeat the process for the other required storage spaces, including the historical-data and temporary-storage spaces.&lt;/p&gt;

&lt;p&gt;For the SQL layer, explicitly specify storage placement:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="n"&gt;benchdb&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="n"&gt;datadbs01&lt;/span&gt; &lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="no"&gt;LOG&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;t_order&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="kt"&gt;SERIAL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;c1&lt;/span&gt; &lt;span class="kt"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;64&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="n"&gt;datadbs01&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;t_order_hist&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="kt"&gt;SERIAL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;c1&lt;/span&gt; &lt;span class="kt"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;64&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="n"&gt;datadbs02&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Group A should omit explicit &lt;code&gt;IN&lt;/code&gt; clauses where the purpose is to test default placement.&lt;/p&gt;

&lt;p&gt;Keep the remaining DDL, indexes, and data-loading procedures as similar as possible between the groups.&lt;/p&gt;

&lt;p&gt;For large objects, configure and test the appropriate sbspace placement separately. Do not assume that ordinary table placement automatically determines where every large object is stored.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. What Should the Benchmark Measure?
&lt;/h2&gt;

&lt;p&gt;QPS alone is not enough to evaluate a database storage layout.&lt;/p&gt;

&lt;p&gt;In GBase Database(GBase 8s), different dbspace arrangements can affect I/O distribution, temporary storage consumption, capacity management, and operational complexity.&lt;/p&gt;

&lt;p&gt;Record at least four categories.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.1 Dbspace Utilization
&lt;/h3&gt;

&lt;p&gt;Use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;onstat -d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Observe the &lt;code&gt;free&lt;/code&gt; values in the Chunks section.&lt;/p&gt;

&lt;p&gt;Questions to answer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Does storage consumption match between groups at the same data volume?&lt;/li&gt;
&lt;li&gt;Which dbspaces experience the fastest capacity decline?&lt;/li&gt;
&lt;li&gt;Does separating historical and business data change the distribution of storage consumption?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Remember that &lt;code&gt;size&lt;/code&gt; and &lt;code&gt;free&lt;/code&gt; are measured in pages, not KB or MB. Interpret them using the corresponding page size.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.2 Temporary Space Behavior
&lt;/h3&gt;

&lt;p&gt;Check whether sorting operations and temporary tables use the intended temporary storage.&lt;/p&gt;

&lt;p&gt;Observe:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Whether temporary operations consume business dbspace capacity.&lt;/li&gt;
&lt;li&gt;Whether temporary space approaches its capacity limit.&lt;/li&gt;
&lt;li&gt;Whether large sorting workloads cause unexpected storage pressure.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A dedicated temp dbspace is useful only if the relevant operations actually use it.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.3 I/O Contention
&lt;/h3&gt;

&lt;p&gt;Compare the interaction between different storage workloads:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Business transaction writes.&lt;/li&gt;
&lt;li&gt;Transaction logging.&lt;/li&gt;
&lt;li&gt;Temporary sorting.&lt;/li&gt;
&lt;li&gt;Historical-data access.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If all these workloads compete for the same physical storage resources, separating logical dbspaces alone may not eliminate the underlying I/O contention.&lt;/p&gt;

&lt;p&gt;This distinction is important: logical storage separation and physical disk separation are not the same thing.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.4 Expansion and Backup Operations
&lt;/h3&gt;

&lt;p&gt;Storage architecture also affects daily operations.&lt;/p&gt;

&lt;p&gt;Record the time and complexity involved in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Adding a new chunk.&lt;/li&gt;
&lt;li&gt;Expanding an existing storage space.&lt;/li&gt;
&lt;li&gt;Managing historical-data capacity.&lt;/li&gt;
&lt;li&gt;Backing up different storage areas.&lt;/li&gt;
&lt;li&gt;Planning maintenance windows.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A layout that offers similar query performance may still provide operational advantages through clearer expansion and backup boundaries.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. How to Interpret the Results
&lt;/h2&gt;

&lt;p&gt;The objective is not to prove that layered storage always wins. It is to understand under which conditions each layout works better.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scenario A: Similar performance at low concurrency, but more stable I/O at high concurrency&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If Group B maintains more stable I/O behavior and temporary sorting no longer competes with business storage capacity, the layered layout may be providing meaningful operational benefits.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scenario B: Group B performs worse&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Investigate the underlying configuration before concluding that layering is ineffective.&lt;/p&gt;

&lt;p&gt;Possible causes include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The new dbspaces reside on slower physical disks.&lt;/li&gt;
&lt;li&gt;Too many chunks introduce additional management overhead.&lt;/li&gt;
&lt;li&gt;Storage placement does not match the actual workload.&lt;/li&gt;
&lt;li&gt;The test groups have different cache or warm-up conditions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Scenario C: Both groups perform similarly&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is also a valid result.&lt;/p&gt;

&lt;p&gt;It may indicate that the current data volume and concurrency have not reached the storage boundaries where layering provides measurable benefits.&lt;/p&gt;

&lt;p&gt;There is no reason to introduce unnecessary storage complexity simply to make the architecture look more organized.&lt;/p&gt;

&lt;p&gt;The purpose of dbspace layering in GBase Database is to establish clearer boundaries for capacity management, troubleshooting, and backup — not to maximize the number of dbspaces.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Write a Reproducible Benchmark Report
&lt;/h2&gt;

&lt;p&gt;A useful benchmark report should allow another DBA to repeat the experiment and understand the conclusion.&lt;/p&gt;

&lt;p&gt;Include at least:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Report item&lt;/th&gt;
&lt;th&gt;Information to record&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Machine specifications&lt;/td&gt;
&lt;td&gt;CPU, memory, disks, and storage configuration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Software environment&lt;/td&gt;
&lt;td&gt;OS, kernel, and GBase Database version&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Data volume&lt;/td&gt;
&lt;td&gt;Table sizes, row counts, and indexes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Group A layout&lt;/td&gt;
&lt;td&gt;Single-space configuration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Group B layout&lt;/td&gt;
&lt;td&gt;Layered-space configuration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Workload&lt;/td&gt;
&lt;td&gt;SQL statements and concurrency ramp&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Storage observations&lt;/td&gt;
&lt;td&gt;Dbspace utilization and temp space behavior&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;I/O observations&lt;/td&gt;
&lt;td&gt;Contention and workload distribution&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Operational observations&lt;/td&gt;
&lt;td&gt;Expansion and backup complexity&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Conclusion&lt;/td&gt;
&lt;td&gt;Conditions under which each layout is suitable&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Most importantly, express conclusions in reproducible terms.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Good conclusion:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;"At 200 concurrent sessions, Group A showed temporary sorting activity consuming capacity in rootdbs, while Group B directed the tested temporary workload to tempdbs01. Business-space utilization followed different growth patterns."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Weak conclusion:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;"Layered storage improved database performance by 30%."&lt;/p&gt;

&lt;p&gt;The first statement describes an observable result and its conditions. The second gives a percentage without enough context to reproduce or evaluate it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Storage layout in &lt;strong&gt;GBase Database(GBase 8s)&lt;/strong&gt; deserves careful planning, but careful planning does not mean blindly copying a recommended architecture.&lt;/p&gt;

&lt;p&gt;A single-space layout may be sufficient for a smaller workload. A layered layout may provide better operational boundaries when business data, historical records, temporary operations, and large objects grow at different rates.&lt;/p&gt;

&lt;p&gt;The right decision depends on actual workload behavior and operational requirements.&lt;/p&gt;

&lt;p&gt;Build two configurations, control the variables, measure the differences, and document the results.&lt;/p&gt;

&lt;p&gt;One reproducible comparison in your own environment is more valuable than memorizing someone else's "best layout."&lt;/p&gt;

</description>
      <category>gbase</category>
      <category>database</category>
      <category>数据库</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>GBase Database: 5 Common Causes of onspaces -c Failures</title>
      <dc:creator>mmllllzcn</dc:creator>
      <pubDate>Sat, 21 Nov 2026 01:11:42 +0000</pubDate>
      <link>https://dev.to/mmllllzcn/gbase-database-5-common-causes-of-onspaces-c-failures-2oif</link>
      <guid>https://dev.to/mmllllzcn/gbase-database-5-common-causes-of-onspaces-c-failures-2oif</guid>
      <description>&lt;p&gt;&lt;strong&gt;Summary:&lt;/strong&gt; Troubleshooting &lt;code&gt;onspaces -c&lt;/code&gt; failures in GBase Database(GBase 8s). Learn how to check file paths, Linux permissions, dbspace names, chunk size, offset, and page size before creating a new dbspace.&lt;/p&gt;

&lt;p&gt;When &lt;code&gt;onspaces -c&lt;/code&gt; fails in &lt;strong&gt;GBase Database(GBase 8s)&lt;/strong&gt;, the error message is often just one or two lines. But the actual cause may be a missing file, incorrect ownership, a duplicate dbspace name, or an invalid parameter.&lt;/p&gt;

&lt;p&gt;Instead of repeatedly modifying the command, check the five common causes below in order. Each one has a simple verification method.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The Chunk File Does Not Exist
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;onspaces&lt;/code&gt; uses an existing file as the physical storage location for a chunk. It does not create the file automatically.&lt;/p&gt;

&lt;p&gt;Check whether the specified path exists:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ls -l /data/gbase/datachk01
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the file is missing, create it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;touch /data/gbase/datachk01
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the directory does not exist, create it first:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mkdir -p /data/gbase
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two situations are particularly easy to overlook:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A typo in the file path.&lt;/li&gt;
&lt;li&gt;A storage mount point that has not been mounted.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both can cause GBase Database to report that the target file cannot be accessed.&lt;/p&gt;

&lt;p&gt;Before running &lt;code&gt;onspaces -c&lt;/code&gt;, confirm that the directory and file exist and that the underlying filesystem is mounted.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. File Ownership or Permissions Are Incorrect
&lt;/h2&gt;

&lt;p&gt;Even when the file exists, GBase Database may reject it if the database user cannot access it correctly.&lt;/p&gt;

&lt;p&gt;Check the file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ls -l /data/gbase/datachk01
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The expected ownership and permission settings in this example are:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Owner: gbasedbt
Group: gbasedbt
Mode: 660
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the file was created by root, correct its ownership and permissions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;chown gbasedbt:gbasedbt /data/gbase/datachk01
chmod 660 /data/gbase/datachk01
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The important point is that the database process must have the appropriate access to the chunk file.&lt;/p&gt;

&lt;p&gt;Both overly restrictive and unnecessarily permissive settings can cause problems, depending on the environment and security configuration.&lt;/p&gt;

&lt;p&gt;For a standard setup, verify the expected &lt;code&gt;gbasedbt:gbasedbt&lt;/code&gt; ownership and &lt;code&gt;660&lt;/code&gt; permissions before proceeding.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. The Dbspace Name Already Exists
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;-c&lt;/code&gt; option creates a new dbspace. Its name must be unique within the database instance.&lt;/p&gt;

&lt;p&gt;Check existing storage spaces:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;onstat -d &lt;span class="o"&gt;|&lt;/span&gt; grep -i datadbs01
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the dbspace already exists, creating another one with the same name will fail.&lt;/p&gt;

&lt;p&gt;First decide what you actually need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Create a new dbspace:&lt;/strong&gt; Use &lt;code&gt;onspaces -c&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Add a chunk to an existing dbspace:&lt;/strong&gt; Use &lt;code&gt;onspaces -a&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;onspaces -a datadbs01 -p /data/gbase/datachk02 -o 0 -s 512000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This distinction is important when managing storage capacity in GBase Database. Creating a new dbspace and expanding an existing one are different operations.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Chunk Size or Offset Is Invalid
&lt;/h2&gt;

&lt;p&gt;Two parameters deserve particular attention:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;-s&lt;/code&gt;: Chunk size, specified in KB.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-o&lt;/code&gt;: Offset, specified in KB.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A typical command looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;onspaces -c -d datadbs01 \
  -p /data/gbase/datachk01 \
  -o 0 \
  -s 512000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, the requested chunk size is 512,000 KB.&lt;/p&gt;

&lt;p&gt;Before executing the command, check available filesystem capacity:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;df -h /data/gbase
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Common mistakes include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Requesting more space than the filesystem can provide.&lt;/li&gt;
&lt;li&gt;Confusing KB with MB when calculating &lt;code&gt;-s&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Specifying an invalid offset.&lt;/li&gt;
&lt;li&gt;Using an offset that overlaps an existing occupied region in the target file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a new, empty chunk file, an offset of &lt;code&gt;0&lt;/code&gt; is commonly used.&lt;/p&gt;

&lt;p&gt;If the file already contains data, the offset must be selected carefully to avoid overwriting existing content.&lt;/p&gt;

&lt;p&gt;Always verify the actual available capacity and parameter units before creating the chunk.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. The Page Size Is Invalid
&lt;/h2&gt;

&lt;p&gt;The page size is another parameter that can cause dbspace creation to fail.&lt;/p&gt;

&lt;p&gt;In GBase Database(GBase 8s), supported page sizes include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;2KB&lt;/li&gt;
&lt;li&gt;4KB&lt;/li&gt;
&lt;li&gt;8KB&lt;/li&gt;
&lt;li&gt;16KB&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The page size must be a multiple of 2KB and cannot exceed 16KB.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;-k 16
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Specifies a 16KB page size.&lt;/p&gt;

&lt;p&gt;Avoid assuming that alternative unit formats such as &lt;code&gt;-k 16K&lt;/code&gt; are accepted. Check the command syntax for your installed version.&lt;/p&gt;

&lt;p&gt;There is also an important distinction between creating and expanding storage:&lt;/p&gt;

&lt;p&gt;When adding a chunk to an existing dbspace, the new chunk must use a page size compatible with that dbspace.&lt;/p&gt;

&lt;p&gt;A page-size mismatch can prevent the operation from succeeding.&lt;/p&gt;

&lt;h2&gt;
  
  
  Troubleshooting Order: Check Preconditions Before Parameters
&lt;/h2&gt;

&lt;p&gt;The five causes can be organized into a simple troubleshooting sequence:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Order&lt;/th&gt;
&lt;th&gt;What to check&lt;/th&gt;
&lt;th&gt;Verification&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;File existence&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ls -l&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Ownership and permissions&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ls -l&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Dbspace name uniqueness&lt;/td&gt;
&lt;td&gt;&lt;code&gt;onstat -d&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Size and offset&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;df -h&lt;/code&gt; and command parameters&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;Page size&lt;/td&gt;
&lt;td&gt;Verify &lt;code&gt;-k&lt;/code&gt; and existing dbspace configuration&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This sequence follows a practical principle: check the file, permissions, naming, and parameters one layer at a time.&lt;/p&gt;

&lt;p&gt;An error such as "cannot open file" may appear straightforward, but the underlying cause could be an incorrect owner, an unavailable mount point, or an invalid path.&lt;/p&gt;

&lt;p&gt;Checking each precondition independently is more effective than repeatedly changing command arguments without identifying the actual problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Five-Item Checklist Before Running onspaces -c
&lt;/h2&gt;

&lt;p&gt;Before creating a dbspace in GBase Database, verify these five items:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;File:&lt;/strong&gt; The target chunk file exists and its filesystem is mounted.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ownership:&lt;/strong&gt; The file belongs to &lt;code&gt;gbasedbt:gbasedbt&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Permissions:&lt;/strong&gt; The file has the expected &lt;code&gt;660&lt;/code&gt; mode.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Naming:&lt;/strong&gt; The dbspace name does not already exist.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Parameters:&lt;/strong&gt; Chunk size is specified in KB, offset is valid, and page size meets the supported requirements.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These checks take little time, but they can prevent unnecessary troubleshooting.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Storage creation in &lt;strong&gt;GBase Database(GBase 8s)&lt;/strong&gt; does not involve a particularly complicated command. Most failures occur because one of the prerequisites has not been satisfied.&lt;/p&gt;

&lt;p&gt;The best approach is to turn these five checks into a standard pre-creation checklist and include it in your database operations runbook.&lt;/p&gt;

&lt;p&gt;Dbspace creation may be an infrequent operation, but that is exactly why a documented procedure matters. When the command is used only occasionally, relying on memory is less reliable than following a verified checklist.&lt;/p&gt;

</description>
      <category>gbase</category>
      <category>database</category>
      <category>数据库</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>GBase Database Online Dbspace Expansion: Add a Chunk or Extend an Existing One?</title>
      <dc:creator>mmllllzcn</dc:creator>
      <pubDate>Fri, 20 Nov 2026 00:59:15 +0000</pubDate>
      <link>https://dev.to/mmllllzcn/gbase-database-online-dbspace-expansion-add-a-chunk-or-extend-an-existing-one-4mgl</link>
      <guid>https://dev.to/mmllllzcn/gbase-database-online-dbspace-expansion-add-a-chunk-or-extend-an-existing-one-4mgl</guid>
      <description>&lt;p&gt;&lt;strong&gt;Summary:&lt;/strong&gt; When a dbspace runs low on capacity, GBase Database(GBase 8s) provides two expansion approaches: adding a new chunk or extending an existing chunk. This tutorial explains both methods, their commands, prerequisites, differences, and post-expansion verification steps to help DBAs expand database storage safely.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Two Ways to Expand a Dbspace
&lt;/h2&gt;

&lt;p&gt;When database storage approaches its capacity limit, adding more disk space is not the only consideration. DBAs also need to decide how that capacity should be incorporated into the existing storage structure.&lt;/p&gt;

&lt;p&gt;In GBase Database(GBase 8s), there are two approaches:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Add a new chunk:&lt;/strong&gt; Attach another chunk file to an existing dbspace.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Extend an existing chunk:&lt;/strong&gt; Increase the capacity of an existing chunk.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both approaches can expand an existing dbspace, but they use different commands and have different prerequisites.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Route One: Add a New Chunk
&lt;/h2&gt;

&lt;p&gt;Adding a new chunk is a straightforward way to increase dbspace capacity.&lt;/p&gt;

&lt;p&gt;First, prepare a new chunk file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;touch /data/gbase/datachk01_2
chown gbasedbt:gbasedbt /data/gbase/datachk01_2
chmod 660 /data/gbase/datachk01_2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then attach it to the existing dbspace:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;onspaces -a datadbs01 \
  -p /data/gbase/datachk01_2 \
  -o 0 -s 512000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The important parameters are:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Parameter&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-a&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Add a chunk&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;datadbs01&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Target dbspace&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-p&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;New chunk file path&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-o&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Offset&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-s&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Chunk size in KB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;One important rule: the page size of a new chunk must match the page size of its target dbspace.&lt;/p&gt;

&lt;p&gt;For example, a dbspace created with a 16KB page size requires compatible 16KB chunk storage. You cannot use a different page size when adding a chunk.&lt;/p&gt;

&lt;h3&gt;
  
  
  Using the SQL Administration API
&lt;/h3&gt;

&lt;p&gt;GBase Database also supports adding a chunk through the SQL Administration API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="no"&gt;EXECUTE&lt;/span&gt; &lt;span class="k"&gt;FUNCTION&lt;/span&gt; &lt;span class="nf"&gt;task&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="s1"&gt;'add chunk'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s1"&gt;'datadbs01'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s1"&gt;'/data/gbase/datachk01_3'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s1"&gt;'512000'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s1"&gt;'0'&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both methods add a chunk to the existing dbspace.&lt;/p&gt;

&lt;h3&gt;
  
  
  Verify the New Chunk
&lt;/h3&gt;

&lt;p&gt;After execution, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;onstat -d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;nchunks&lt;/code&gt; value in the Dbspaces section should increase from 1 to 2.&lt;/li&gt;
&lt;li&gt;The Chunks section should contain the new physical file path.&lt;/li&gt;
&lt;li&gt;The available &lt;code&gt;free&lt;/code&gt; pages should reflect the additional capacity.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not stop at a successful command response. Confirm that the new chunk is actually registered and available.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Route Two: Extend an Existing Chunk
&lt;/h2&gt;

&lt;p&gt;The second approach is to extend an existing chunk rather than attach another one.&lt;/p&gt;

&lt;p&gt;In GBase Database(GBase 8s), this operation uses the SQL Administration API.&lt;/p&gt;

&lt;p&gt;First, mark the target chunk as extendable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="no"&gt;EXECUTE&lt;/span&gt; &lt;span class="k"&gt;FUNCTION&lt;/span&gt; &lt;span class="nf"&gt;task&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="s1"&gt;'modify chunk extendable on'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="mi"&gt;4&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then specify the additional capacity:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="no"&gt;EXECUTE&lt;/span&gt; &lt;span class="k"&gt;FUNCTION&lt;/span&gt; &lt;span class="nf"&gt;task&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="s1"&gt;'modify chunk extend'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="mi"&gt;512000&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are two important details here.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;First: The argument is a chunk number, not a dbspace name.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Find the chunk number in the Chunks section of &lt;code&gt;onstat -d&lt;/code&gt;. Use the actual chunk identifier shown in your instance rather than assuming that it matches the dbspace number.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Second: Check the underlying file system before extending.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The file system containing the chunk file must have enough available capacity. Otherwise, the extension cannot be completed successfully.&lt;/p&gt;

&lt;p&gt;Unlike adding a new chunk, this approach does not create another chunk entry. It increases the capacity of an existing chunk.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Preconditions Before Expanding Storage
&lt;/h2&gt;

&lt;p&gt;Regardless of which method you choose, check three things before executing the expansion command.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. File system capacity&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Confirm that the target file system has enough available space for the requested expansion.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Correct chunk identification&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For an existing chunk extension, verify the chunk number through &lt;code&gt;onstat -d&lt;/code&gt;. An incorrect chunk number means you may target the wrong storage resource.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Page size compatibility&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When adding a new chunk, confirm that its page size matches the target dbspace.&lt;/p&gt;

&lt;p&gt;Also check file ownership, permissions, and whether the target chunk path is already in use.&lt;/p&gt;

&lt;p&gt;These checks are inexpensive compared with troubleshooting a failed storage change.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Add a Chunk vs. Extend a Chunk: Which Is Better?
&lt;/h2&gt;

&lt;p&gt;The two approaches solve the same capacity problem, but their operational characteristics differ.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Comparison&lt;/th&gt;
&lt;th&gt;Add a chunk&lt;/th&gt;
&lt;th&gt;Extend a chunk&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Main command&lt;/td&gt;
&lt;td&gt;&lt;code&gt;onspaces -a&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;SQL Administration API&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Storage operation&lt;/td&gt;
&lt;td&gt;Attach a new chunk&lt;/td&gt;
&lt;td&gt;Increase existing chunk capacity&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Chunk count&lt;/td&gt;
&lt;td&gt;Increases&lt;/td&gt;
&lt;td&gt;Remains unchanged&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;File system requirement&lt;/td&gt;
&lt;td&gt;Space for a new chunk file&lt;/td&gt;
&lt;td&gt;Space for extending the existing chunk&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Storage layout&lt;/td&gt;
&lt;td&gt;Can use another disk or file system&lt;/td&gt;
&lt;td&gt;Retains the existing chunk location&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Operational consideration&lt;/td&gt;
&lt;td&gt;More chunk entries to manage&lt;/td&gt;
&lt;td&gt;Depends on existing chunk extendability&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;My default preference is adding a new chunk, particularly in production environments.&lt;/p&gt;

&lt;p&gt;It provides flexibility in storage allocation and can distribute capacity across different disks or file systems.&lt;/p&gt;

&lt;p&gt;Extending an existing chunk is useful when the underlying file system has sufficient capacity and maintaining a stable chunk count is a priority.&lt;/p&gt;

&lt;p&gt;However, neither approach should be treated as automatically risk-free or universally reversible. Check the supported rollback and recovery procedures for your GBase Database version before making production changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Verify Expansion After Execution
&lt;/h2&gt;

&lt;p&gt;A successful expansion command is not the end of the operation.&lt;/p&gt;

&lt;p&gt;There are three follow-up checks worth including in every GBase Database storage expansion runbook.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check 1: Confirm capacity changes&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;onstat -d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify the chunk count and available pages in the target dbspace.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check 2: Confirm chunk status&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Inspect the Chunks section and check the flags column.&lt;/p&gt;

&lt;p&gt;Investigate any abnormal status, especially a chunk marked with &lt;code&gt;PD&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check 3: Update the storage inventory&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Record:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dbspace name&lt;/li&gt;
&lt;li&gt;Chunk number&lt;/li&gt;
&lt;li&gt;Physical file path&lt;/li&gt;
&lt;li&gt;Chunk size&lt;/li&gt;
&lt;li&gt;Page size&lt;/li&gt;
&lt;li&gt;Expansion date&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This keeps the storage inventory consistent with the actual database configuration.&lt;/p&gt;

&lt;p&gt;Without these checks, administrators may believe a dbspace has been expanded even though the expected capacity is not available.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion: Choose the Expansion Method Before Running the Command
&lt;/h2&gt;

&lt;p&gt;GBase Database(GBase 8s) provides two practical ways to expand dbspace capacity:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add a chunk when you want more flexibility in physical storage allocation.&lt;/li&gt;
&lt;li&gt;Extend an existing chunk when you want to retain the current chunk structure and the underlying file system supports it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The commands are not particularly complicated. The real work is checking prerequisites, selecting the right target, understanding the operational impact, and verifying the result.&lt;/p&gt;

&lt;p&gt;A reliable storage expansion procedure should always follow this sequence:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check capacity → Select expansion method → Execute → Verify chunk status → Update inventory&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Online storage expansion is not complete when the command returns successfully. It is complete when the additional capacity is confirmed and the storage records reflect the actual state.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How does your team usually expand GBase Database dbspaces: adding new chunks or extending existing ones?&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Keywords:&lt;/strong&gt; GBase Database, GBase Database 8s, dbspace expansion, online storage expansion, add chunk, extend chunk, onspaces, SQL Administration API, onstat -d, database storage management&lt;/p&gt;

</description>
      <category>gbase</category>
      <category>database</category>
      <category>数据库</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>GBase Database Tutorial: Create a Business Dbspace and Place Tables Step by Step</title>
      <dc:creator>mmllllzcn</dc:creator>
      <pubDate>Fri, 20 Nov 2026 00:57:16 +0000</pubDate>
      <link>https://dev.to/mmllllzcn/gbase-database-tutorial-create-a-business-dbspace-and-place-tables-step-by-step-n89</link>
      <guid>https://dev.to/mmllllzcn/gbase-database-tutorial-create-a-business-dbspace-and-place-tables-step-by-step-n89</guid>
      <description>&lt;p&gt;&lt;strong&gt;Summary:&lt;/strong&gt; Learn how to create a dedicated business dbspace in GBase Database(GBase 8s), configure a 16KB page size, create a database inside that space, explicitly place tables, and verify storage allocation with &lt;code&gt;onstat -d&lt;/code&gt;. This step-by-step guide also covers chunk file permissions, default storage placement, and BLOB/CLOB storage considerations.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Understand the Storage Structure Before Starting
&lt;/h2&gt;

&lt;p&gt;A dbspace in GBase Database(GBase 8s) is a logical storage container backed by one or more chunk files.&lt;/p&gt;

&lt;p&gt;In this tutorial, we will build a complete storage workflow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Prepare a chunk file.&lt;/li&gt;
&lt;li&gt;Create a business dbspace.&lt;/li&gt;
&lt;li&gt;Verify the dbspace.&lt;/li&gt;
&lt;li&gt;Create a database inside that dbspace.&lt;/li&gt;
&lt;li&gt;Create tables and control their storage placement.&lt;/li&gt;
&lt;li&gt;Verify the actual storage allocation.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The goal is to create a business dbspace named &lt;code&gt;datadbs01&lt;/code&gt; with a 16KB page size and ensure that the new database and its tables use the intended storage space instead of relying on &lt;code&gt;rootdbs&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Step 1: Prepare the Chunk File and Permissions
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;onspaces&lt;/code&gt; utility does not create the operating system file for you. The chunk file must exist before creating the dbspace.&lt;/p&gt;

&lt;p&gt;First, create the directory and an empty file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mkdir -p /data/gbase
touch /data/gbase/datachk01
chown gbasedbt:gbasedbt /data/gbase/datachk01
chmod 660 /data/gbase/datachk01
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These commands perform three essential operations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;touch&lt;/code&gt;: Create an empty chunk file.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;chown&lt;/code&gt;: Assign ownership to &lt;code&gt;gbasedbt:gbasedbt&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;chmod 660&lt;/code&gt;: Grant read and write permissions to the owner and group.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Before continuing, verify the file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ls -l /data/gbase/datachk01
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected permissions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-rw-rw---- gbasedbt gbasedbt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the file is created as root but ownership is not corrected, dbspace creation may fail when GBase Database attempts to open the chunk file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Checkpoint:&lt;/strong&gt; Confirm that the file exists and has the correct owner and permissions before running &lt;code&gt;onspaces&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Step 2: Create a 16KB Business Dbspace
&lt;/h2&gt;

&lt;p&gt;Now create the dbspace:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;onspaces -c -d datadbs01 \
  -p /data/gbase/datachk01 \
  -o 0 -s 102400 -k 16
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Understand the parameters:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Parameter&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-c&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Create a dbspace&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-d&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Dbspace name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-p&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Chunk file path&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-o&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Offset&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-s&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Chunk size in KB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-k&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Page size in KB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;In this example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dbspace: &lt;code&gt;datadbs01&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Chunk file: &lt;code&gt;/data/gbase/datachk01&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Offset: &lt;code&gt;0&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Chunk size: &lt;code&gt;102400&lt;/code&gt; KB&lt;/li&gt;
&lt;li&gt;Page size: &lt;code&gt;16&lt;/code&gt; KB&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The page size is a creation-time decision. It cannot be changed afterward.&lt;/p&gt;

&lt;p&gt;Also, size the dbspace according to current data requirements and expected growth rather than simply allocating enough space for the initial tables.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Step 3: Verify the Dbspace
&lt;/h2&gt;

&lt;p&gt;After creation, check the database storage configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;onstat -d &lt;span class="o"&gt;|&lt;/span&gt; grep -i datadbs01
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a more complete inspection, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;onstat -d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pay attention to two sections:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dbspaces&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Check whether &lt;code&gt;datadbs01&lt;/code&gt; appears and confirm its page size and chunk count.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Chunks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Check the physical file path, chunk size, free pages, and status flags.&lt;/p&gt;

&lt;p&gt;A &lt;code&gt;nchunks&lt;/code&gt; value of 1 indicates that the dbspace currently contains one chunk. Additional chunks can be added as storage requirements grow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Checkpoint:&lt;/strong&gt; Do not proceed until the dbspace and its chunk are correctly reported.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Step 4: Create the Database in the Business Dbspace
&lt;/h2&gt;

&lt;p&gt;Now create the database:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="n"&gt;mesdb&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="n"&gt;datadbs01&lt;/span&gt; &lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="no"&gt;LOG&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;IN datadbs01&lt;/code&gt; clause specifies the dbspace in which the database is created.&lt;/p&gt;

&lt;p&gt;This is important because it establishes the default storage location for database objects that do not explicitly specify another dbspace.&lt;/p&gt;

&lt;p&gt;Without an explicit storage plan, business objects may end up in &lt;code&gt;rootdbs&lt;/code&gt;, making future capacity management more difficult.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Step 5: Create Tables and Control Their Placement
&lt;/h2&gt;

&lt;p&gt;Once the database exists, create business tables.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;prod_order&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;order_id&lt;/span&gt;   &lt;span class="kt"&gt;SERIAL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;prod_code&lt;/span&gt;  &lt;span class="kt"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;created_at&lt;/span&gt; &lt;span class="kt"&gt;DATETIME&lt;/span&gt; &lt;span class="no"&gt;YEAR&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="no"&gt;SECOND&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="n"&gt;datadbs01&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also explicitly place another table in a different dbspace:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;prod_order_hist&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;order_id&lt;/span&gt;   &lt;span class="kt"&gt;SERIAL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;prod_code&lt;/span&gt;  &lt;span class="kt"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;created_at&lt;/span&gt; &lt;span class="kt"&gt;DATETIME&lt;/span&gt; &lt;span class="no"&gt;YEAR&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="no"&gt;SECOND&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="n"&gt;datadbs02&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This illustrates a simple hot/cold storage separation strategy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;datadbs01&lt;/code&gt;: Current business data.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;datadbs02&lt;/code&gt;: Historical business data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The key rule is that an explicit &lt;code&gt;IN&lt;/code&gt; clause takes precedence over the database's default dbspace.&lt;/p&gt;

&lt;p&gt;If the table creation statement does not specify &lt;code&gt;IN&lt;/code&gt;, the database-level default determines its placement.&lt;/p&gt;

&lt;p&gt;This is why storage planning must be included in both database creation scripts and application DDL templates.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Step 6: Verify Actual Storage Placement
&lt;/h2&gt;

&lt;p&gt;A successful &lt;code&gt;CREATE TABLE&lt;/code&gt; statement does not necessarily mean the intended storage layout has been implemented correctly.&lt;/p&gt;

&lt;p&gt;Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;onstat -d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check the &lt;code&gt;free&lt;/code&gt; pages in the target dbspaces.&lt;/p&gt;

&lt;p&gt;After inserting data, you can compare the free space before and after the operation to observe storage consumption.&lt;/p&gt;

&lt;p&gt;For more detailed verification, GBase Database's &lt;code&gt;sysmaster&lt;/code&gt; database provides system catalog information through tables such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;sysdbspaces&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;syschunks&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These can help inspect dbspace and chunk metadata.&lt;/p&gt;

&lt;p&gt;One important distinction: &lt;code&gt;onstat -d&lt;/code&gt; verifies space-level allocation, not the exact table-to-dbspace mapping. For object-level verification, use the appropriate catalog metadata for your GBase Database version.&lt;/p&gt;

&lt;p&gt;The storage plan is only complete when the actual object placement matches the design.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Step 7: Automate the Creation Process
&lt;/h2&gt;

&lt;p&gt;Once the manual procedure works, turn it into a reusable deployment script.&lt;/p&gt;

&lt;p&gt;At minimum, the function should accept:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Chunk file path&lt;/li&gt;
&lt;li&gt;Dbspace name&lt;/li&gt;
&lt;li&gt;Chunk size&lt;/li&gt;
&lt;li&gt;Page size&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It should also verify:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The target directory exists.&lt;/li&gt;
&lt;li&gt;The chunk file is created successfully.&lt;/li&gt;
&lt;li&gt;Ownership is &lt;code&gt;gbasedbt:gbasedbt&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Permissions are set correctly.&lt;/li&gt;
&lt;li&gt;The dbspace does not already exist.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;onspaces&lt;/code&gt; command completes successfully.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This turns a sequence of manual operations into a repeatable deployment process.&lt;/p&gt;

&lt;p&gt;In database administration, automation is not simply about executing commands faster. It is about ensuring that every deployment follows the same prerequisites and verification steps.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. Important: BLOB and CLOB Need a Separate Storage Path
&lt;/h2&gt;

&lt;p&gt;There is one more storage rule worth remembering.&lt;/p&gt;

&lt;p&gt;If a table contains BLOB or CLOB columns, placing the table in an ordinary dbspace does not determine where its smart large objects are stored.&lt;/p&gt;

&lt;p&gt;In GBase Database(GBase 8s), BLOB and CLOB are smart large objects and must use an sbspace.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;prod_image&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;id&lt;/span&gt;  &lt;span class="kt"&gt;SERIAL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;img&lt;/span&gt; &lt;span class="kt"&gt;BLOB&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="n"&gt;datadbs01&lt;/span&gt;
  &lt;span class="no"&gt;PUT&lt;/span&gt; &lt;span class="n"&gt;img&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sbspace01&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;datadbs01&lt;/code&gt; stores the ordinary table data.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;sbspace01&lt;/code&gt; stores the BLOB data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Table placement and smart large object placement are separate storage decisions.&lt;/p&gt;

&lt;p&gt;Make sure the sbspace exists and is usable before creating tables that depend on it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion: Storage Planning Is More Than Creating a Dbspace
&lt;/h2&gt;

&lt;p&gt;Creating a business dbspace is only the first step in GBase Database storage management.&lt;/p&gt;

&lt;p&gt;A complete deployment must connect four operations:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create space → Create database → Place tables → Verify allocation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The most important principles are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Prepare chunk files with the correct ownership and permissions.&lt;/li&gt;
&lt;li&gt;Choose page size before dbspace creation.&lt;/li&gt;
&lt;li&gt;Create databases in the intended business dbspace.&lt;/li&gt;
&lt;li&gt;Use explicit &lt;code&gt;IN&lt;/code&gt; clauses when table placement matters.&lt;/li&gt;
&lt;li&gt;Verify actual allocation instead of relying only on successful SQL execution.&lt;/li&gt;
&lt;li&gt;Give BLOB/CLOB their own sbspace storage configuration.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;GBase Database provides the commands and administration tools. A well-designed deployment process ensures those tools produce a predictable and maintainable storage architecture.&lt;/p&gt;

&lt;p&gt;The difference between creating a database and building a reliable database environment is whether the storage plan is actually reflected in the objects running inside it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Keywords:&lt;/strong&gt; GBase Database, GBase Database 8s, dbspace creation, database storage management, onspaces, chunk file permissions, table placement, sbspace, database deployment&lt;/p&gt;

</description>
      <category>gbase</category>
      <category>database</category>
      <category>数据库</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>GBase Database Page Size: Why 2KB to 16KB Must Be Decided Before Creation</title>
      <dc:creator>mmllllzcn</dc:creator>
      <pubDate>Fri, 20 Nov 2026 00:55:26 +0000</pubDate>
      <link>https://dev.to/mmllllzcn/gbase-database-page-size-why-2kb-to-16kb-must-be-decided-before-creation-29li</link>
      <guid>https://dev.to/mmllllzcn/gbase-database-page-size-why-2kb-to-16kb-must-be-decided-before-creation-29li</guid>
      <description>&lt;p&gt;&lt;strong&gt;Summary:&lt;/strong&gt; Page size is one of the most important storage decisions in GBase Database(GBase 8s). It is configured when a dbspace is created and cannot be changed afterward. This guide explains how to configure page size, choose the right value for your workload, understand its relationship with BUFFERPOOL, and avoid costly storage migrations.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Page Size Is a One-Time Storage Decision
&lt;/h2&gt;

&lt;p&gt;Page size is one of the few database storage parameters that cannot be adjusted after a dbspace has been created.&lt;/p&gt;

&lt;p&gt;In GBase Database(GBase 8s), the default page size is 2KB, with four supported options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;2KB&lt;/li&gt;
&lt;li&gt;4KB&lt;/li&gt;
&lt;li&gt;8KB&lt;/li&gt;
&lt;li&gt;16KB&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The maximum supported page size is 16KB, and each option is a multiple of 2KB.&lt;/p&gt;

&lt;p&gt;You specify the page size during dbspace creation using the &lt;code&gt;-k&lt;/code&gt; parameter of &lt;code&gt;onspaces&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;touch /data/gbase/datachk01
chown gbasedbt:gbasedbt /data/gbase/datachk01
chmod 660 /data/gbase/datachk01

onspaces -c -d datadbs01 \
  -p /data/gbase/datachk01 \
  -o 0 -s 102400 -k 16
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The final parameter, &lt;code&gt;-k 16&lt;/code&gt;, specifies a page size of 16KB.&lt;/p&gt;

&lt;p&gt;The SQL Administration API provides an alternative:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="no"&gt;EXECUTE&lt;/span&gt; &lt;span class="k"&gt;FUNCTION&lt;/span&gt; &lt;span class="nf"&gt;task&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="s1"&gt;'create dbspace'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s1"&gt;'datadbs02'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s1"&gt;'/data/gbase/datachk02'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s1"&gt;'1024000'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s1"&gt;'0'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s1"&gt;'16'&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, the final argument also specifies the page size in KB.&lt;/p&gt;

&lt;p&gt;Both methods establish the page size when the dbspace is created. It cannot be modified afterward.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. How to Choose the Right Page Size
&lt;/h2&gt;

&lt;p&gt;There is no universally optimal page size. The decision should reflect the application's data structure and access patterns.&lt;/p&gt;

&lt;p&gt;Two workload characteristics are particularly important.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Small pages: Short rows and random access&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Smaller pages can reduce unnecessary data reads when workloads frequently access individual short rows.&lt;/p&gt;

&lt;p&gt;For example, if an application frequently retrieves small records, reading a much larger page may bring more data into memory than the query actually needs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Large pages: Wide rows and sequential scans&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Larger pages can improve I/O efficiency for wide rows and workloads involving batch scans.&lt;/p&gt;

&lt;p&gt;When rows are large, a small page may require multiple page reads to retrieve one row, increasing I/O operations.&lt;/p&gt;

&lt;p&gt;A practical comparison:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Workload characteristic&lt;/th&gt;
&lt;th&gt;Consideration&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Short rows&lt;/td&gt;
&lt;td&gt;Smaller pages&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Frequent random access&lt;/td&gt;
&lt;td&gt;Smaller pages may help&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Wide rows&lt;/td&gt;
&lt;td&gt;Larger pages may help&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Batch scans&lt;/td&gt;
&lt;td&gt;Larger pages may reduce I/O operations&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mixed workloads&lt;/td&gt;
&lt;td&gt;Benchmark with representative data&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These are starting points, not universal performance rules. Actual results depend on row width, access patterns, buffer pool configuration, and storage characteristics.&lt;/p&gt;

&lt;p&gt;The important thing is to evaluate these factors before creating the dbspace.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Page Size Also Affects BUFFERPOOL
&lt;/h2&gt;

&lt;p&gt;Page size is not only a storage configuration parameter. It is also closely related to memory configuration.&lt;/p&gt;

&lt;p&gt;In GBase Database(GBase 8s), the &lt;code&gt;BUFFERPOOL&lt;/code&gt; configuration in &lt;code&gt;onconfig&lt;/code&gt; includes a &lt;code&gt;size&lt;/code&gt; parameter that must match the page size of the corresponding dbspace.&lt;/p&gt;

&lt;p&gt;The total buffer pool memory can be understood as:&lt;/p&gt;

&lt;p&gt;[&lt;br&gt;
\text{Memory} = \text{buffers} \times \text{page size}&lt;br&gt;
]&lt;/p&gt;

&lt;p&gt;For example, assuming the same number of buffers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;2KB pages consume 2KB per buffer.&lt;/li&gt;
&lt;li&gt;4KB pages consume 4KB per buffer.&lt;/li&gt;
&lt;li&gt;8KB pages consume 8KB per buffer.&lt;/li&gt;
&lt;li&gt;16KB pages consume 16KB per buffer.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Doubling the page size while keeping the buffer count unchanged doubles the memory consumed by that buffer pool.&lt;/p&gt;

&lt;p&gt;Conversely, if memory allocation remains fixed, doubling page size means the buffer pool can hold only half as many pages.&lt;/p&gt;

&lt;p&gt;This affects cache capacity and potentially the buffer hit rate.&lt;/p&gt;

&lt;p&gt;Therefore, page size selection and BUFFERPOOL planning should be reviewed together rather than treated as independent configuration tasks.&lt;/p&gt;
&lt;h2&gt;
  
  
  4. How to Verify Page Size After Creation
&lt;/h2&gt;

&lt;p&gt;After creating a dbspace, use &lt;code&gt;onstat -d&lt;/code&gt; to verify its actual page size.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;onstat -d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check the &lt;code&gt;pgsize&lt;/code&gt; column in the Dbspaces section.&lt;/p&gt;

&lt;p&gt;Then compare the value with the corresponding &lt;code&gt;BUFFERPOOL size&lt;/code&gt; setting in &lt;code&gt;onconfig&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For example, a 16KB dbspace should have a corresponding 16KB buffer pool configuration.&lt;/p&gt;

&lt;p&gt;This verification should be included in the database deployment checklist.&lt;/p&gt;

&lt;p&gt;It is much easier to identify a configuration mismatch during deployment than during an instance startup or performance incident.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. What If You Already Chose the Wrong Page Size?
&lt;/h2&gt;

&lt;p&gt;There is no direct command to change an existing dbspace from 2KB to 16KB.&lt;/p&gt;

&lt;p&gt;If the original page size no longer fits the workload, the migration path generally involves:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a new dbspace with the required page size.&lt;/li&gt;
&lt;li&gt;Prepare the necessary chunk files and permissions.&lt;/li&gt;
&lt;li&gt;Migrate tables and other database objects.&lt;/li&gt;
&lt;li&gt;Update storage assignments and defaults.&lt;/li&gt;
&lt;li&gt;Validate application behavior and performance.&lt;/li&gt;
&lt;li&gt;Complete the migration and retire the old space when safe.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is not a simple configuration adjustment.&lt;/p&gt;

&lt;p&gt;It involves additional storage capacity, data migration, application validation, maintenance windows, and rollback planning.&lt;/p&gt;

&lt;p&gt;That is why page size belongs in the initial database design review, not in a troubleshooting discussion after the application starts experiencing I/O problems.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Put Page Size on the Database Build Checklist
&lt;/h2&gt;

&lt;p&gt;A reliable GBase Database deployment should document page size alongside other storage decisions.&lt;/p&gt;

&lt;p&gt;My recommended checklist includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Business dbspace page size&lt;/li&gt;
&lt;li&gt;Temporary dbspace allocation&lt;/li&gt;
&lt;li&gt;Smart large object storage&lt;/li&gt;
&lt;li&gt;Chunk file paths and permissions&lt;/li&gt;
&lt;li&gt;BUFFERPOOL configuration&lt;/li&gt;
&lt;li&gt;Storage expansion strategy&lt;/li&gt;
&lt;li&gt;Post-creation verification&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;GBase Database(GBase 8s) provides page sizes from 2KB to 16KB, but the database cannot determine which one is best for your application.&lt;/p&gt;

&lt;p&gt;That decision requires understanding the workload before the storage space exists.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The takeaway:&lt;/strong&gt; Page size is not a runtime tuning parameter. It is a storage design decision with long-term consequences. One additional review before dbspace creation can save an entire data migration later.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Keywords:&lt;/strong&gt; GBase Database, GBase Database 8s, database page size, dbspace management, onspaces, BUFFERPOOL, database performance tuning, database storage configuration&lt;/p&gt;

</description>
      <category>gbase</category>
      <category>database</category>
      <category>数据库</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>GBase Database: Why BLOB and CLOB Must Be Stored in an sbspace</title>
      <dc:creator>mmllllzcn</dc:creator>
      <pubDate>Thu, 19 Nov 2026 01:33:40 +0000</pubDate>
      <link>https://dev.to/mmllllzcn/gbase-database-why-blob-and-clob-must-be-stored-in-an-sbspace-3j05</link>
      <guid>https://dev.to/mmllllzcn/gbase-database-why-blob-and-clob-must-be-stored-in-an-sbspace-3j05</guid>
      <description>&lt;p&gt;&lt;strong&gt;Summary:&lt;/strong&gt; Learn why BLOB and CLOB columns in GBase Database(GBase 8s) require an sbspace, how to configure the default sbspace, and how smart large objects differ from simple large objects such as TEXT and BYTE.&lt;/p&gt;

&lt;p&gt;When designing storage for large objects in &lt;strong&gt;GBase Database(GBase 8s)&lt;/strong&gt;, one distinction is easy to overlook: BLOB and CLOB are smart large objects, and they must be stored in an sbspace rather than an ordinary business dbspace.&lt;/p&gt;

&lt;p&gt;This is not just a naming convention. It affects table creation, storage planning, backup, and database recovery.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Why BLOB and CLOB Cannot Use an Ordinary Dbspace
&lt;/h2&gt;

&lt;p&gt;A common mistake is to create a BLOB column and place the table directly in a regular business dbspace.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- Wrong: an ordinary dbspace cannot store smart large objects&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;prod_image&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;id&lt;/span&gt;  &lt;span class="kt"&gt;INT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;img&lt;/span&gt; &lt;span class="kt"&gt;BLOB&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="n"&gt;datadbs01&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The problem is the storage type. BLOB and CLOB are smart large objects, which require dedicated sbspace storage.&lt;/p&gt;

&lt;p&gt;The correct approach is to specify an sbspace for the large object column:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;prod_image&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;id&lt;/span&gt;  &lt;span class="kt"&gt;INT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;img&lt;/span&gt; &lt;span class="kt"&gt;BLOB&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="no"&gt;PUT&lt;/span&gt; &lt;span class="n"&gt;img&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sbspace01&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, &lt;code&gt;datadbs01&lt;/code&gt; and &lt;code&gt;sbspace01&lt;/code&gt; serve different purposes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;datadbs01&lt;/code&gt; stores ordinary table data.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;sbspace01&lt;/code&gt; stores the smart large object.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This separation is fundamental to &lt;strong&gt;GBase Database sbspace management&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. How to Configure the Default sbspace
&lt;/h2&gt;

&lt;p&gt;You do not have to specify a &lt;code&gt;PUT&lt;/code&gt; clause for every smart large object column.&lt;/p&gt;

&lt;p&gt;If a usable default sbspace is configured, GBase Database can use it for smart large objects without an explicit storage destination.&lt;/p&gt;

&lt;p&gt;The relevant configuration parameter is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SBSPACENAME sbspace01
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check &lt;code&gt;SBSPACENAME&lt;/code&gt; in the instance's &lt;code&gt;onconfig&lt;/code&gt; file and verify that the referenced sbspace actually exists and is available.&lt;/p&gt;

&lt;p&gt;Do not assume that every newly initialized instance already has a usable default sbspace.&lt;/p&gt;

&lt;p&gt;If no suitable sbspace exists, creating a table with a BLOB or CLOB column can fail.&lt;/p&gt;

&lt;p&gt;For production environments, explicitly defining the sbspace or verifying the default configuration before table creation is a safer approach.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. An sbspace Stores More Than Large Object Data
&lt;/h2&gt;

&lt;p&gt;An sbspace is not simply another location for large files.&lt;/p&gt;

&lt;p&gt;It also maintains metadata associated with smart large objects.&lt;/p&gt;

&lt;p&gt;Each BLOB or CLOB has its own metadata and storage allocation within the sbspace. This is why smart large objects are managed differently from ordinary table rows.&lt;/p&gt;

&lt;p&gt;For database administrators, this distinction has practical implications:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Smart large object storage needs independent capacity planning.&lt;/li&gt;
&lt;li&gt;Metadata and storage allocation must be considered together.&lt;/li&gt;
&lt;li&gt;Backup and recovery procedures should account for sbspaces separately.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In other words, a BLOB column is not merely an attachment stored alongside an ordinary table.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. TEXT Is Not CLOB: Understand the Difference
&lt;/h2&gt;

&lt;p&gt;Another common misconception is treating TEXT and CLOB as equivalent because both can contain large amounts of character data.&lt;/p&gt;

&lt;p&gt;In &lt;strong&gt;GBase Database(GBase 8s)&lt;/strong&gt;, they belong to different large object storage categories.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Data type&lt;/th&gt;
&lt;th&gt;Large object category&lt;/th&gt;
&lt;th&gt;Storage space&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;BLOB&lt;/td&gt;
&lt;td&gt;Smart large object&lt;/td&gt;
&lt;td&gt;sbspace&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CLOB&lt;/td&gt;
&lt;td&gt;Smart large object&lt;/td&gt;
&lt;td&gt;sbspace&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;TEXT&lt;/td&gt;
&lt;td&gt;Simple large object&lt;/td&gt;
&lt;td&gt;blobspace or applicable table storage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;BYTE&lt;/td&gt;
&lt;td&gt;Simple large object&lt;/td&gt;
&lt;td&gt;blobspace or applicable table storage&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The distinction matters because the storage rules are different.&lt;/p&gt;

&lt;p&gt;For example, a TEXT column can be assigned to a blobspace:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;prod_doc&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;id&lt;/span&gt;  &lt;span class="kt"&gt;INT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;txt&lt;/span&gt; &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="n"&gt;blobdbs01&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do not assume that the rules for TEXT automatically apply to CLOB.&lt;/p&gt;

&lt;p&gt;Similar names do not mean identical storage behavior.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Plan Backup and Capacity by Storage Type
&lt;/h2&gt;

&lt;p&gt;Storage separation also affects operational planning.&lt;/p&gt;

&lt;p&gt;An sbspace and an ordinary dbspace should not automatically be treated as interchangeable backup targets.&lt;/p&gt;

&lt;p&gt;For &lt;strong&gt;GBase Database storage management&lt;/strong&gt;, maintain a space inventory that identifies:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Space name and type&lt;/li&gt;
&lt;li&gt;Storage purpose&lt;/li&gt;
&lt;li&gt;Initial capacity&lt;/li&gt;
&lt;li&gt;Current utilization&lt;/li&gt;
&lt;li&gt;Associated database objects&lt;/li&gt;
&lt;li&gt;Backup and recovery requirements&lt;/li&gt;
&lt;li&gt;Expansion strategy&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is especially important when applications store images, documents, multimedia content, or other large objects.&lt;/p&gt;

&lt;p&gt;Separating smart and simple large object storage makes it easier to estimate growth independently and understand which storage resources need attention during backup and recovery.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. A Simple Checklist Before Creating Large Object Tables
&lt;/h2&gt;

&lt;p&gt;Before creating a table containing large object columns in GBase Database(GBase 8s), check the column type first.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For BLOB and CLOB:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Confirm that the required sbspace exists.&lt;/li&gt;
&lt;li&gt;Verify that the sbspace is usable.&lt;/li&gt;
&lt;li&gt;Check the &lt;code&gt;SBSPACENAME&lt;/code&gt; setting if relying on the instance default.&lt;/li&gt;
&lt;li&gt;Specify an explicit &lt;code&gt;PUT&lt;/code&gt; clause when the column requires a dedicated sbspace.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;For TEXT and BYTE:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Confirm whether a blobspace is required.&lt;/li&gt;
&lt;li&gt;Decide whether to use a dedicated blobspace or applicable table storage.&lt;/li&gt;
&lt;li&gt;Include the selected space in capacity and backup planning.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The earlier you make this distinction, the less likely you are to encounter storage migration and recovery problems later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Why does &lt;strong&gt;GBase Database(GBase 8s)&lt;/strong&gt; distinguish between smart and simple large objects?&lt;/p&gt;

&lt;p&gt;Because they have different storage management requirements.&lt;/p&gt;

&lt;p&gt;BLOB and CLOB use sbspaces, while TEXT and BYTE follow different storage rules and can use blobspaces or applicable table storage.&lt;/p&gt;

&lt;p&gt;The practical lesson is simple:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check the data type before creating the table.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A few minutes spent confirming the correct storage space is much cheaper than discovering the wrong storage design during production expansion or database recovery.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Keywords:&lt;/strong&gt; GBase Database, GBase Database 8s, sbspace, blobspace, BLOB vs CLOB, TEXT vs BYTE, Smart Large Objects, Database Storage Management&lt;/p&gt;

</description>
      <category>gbase</category>
      <category>database</category>
      <category>数据库</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>GBase Database: How to Read Both Sections of onstat -d for Storage Monitoring</title>
      <dc:creator>mmllllzcn</dc:creator>
      <pubDate>Thu, 19 Nov 2026 01:30:35 +0000</pubDate>
      <link>https://dev.to/mmllllzcn/gbase-database-how-to-read-both-sections-of-onstat-d-for-storage-monitoring-4f96</link>
      <guid>https://dev.to/mmllllzcn/gbase-database-how-to-read-both-sections-of-onstat-d-for-storage-monitoring-4f96</guid>
      <description>&lt;p&gt;&lt;strong&gt;Summary:&lt;/strong&gt; Learn how to interpret both sections of &lt;code&gt;onstat -d&lt;/code&gt; in GBase Database(GBase 8s), understand the relationship between dbspaces and chunks, calculate actual storage utilization, and identify unavailable chunks before making capacity decisions.&lt;/p&gt;

&lt;p&gt;Today I'm documenting a command that is easy to misread: &lt;code&gt;onstat -d&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In &lt;strong&gt;GBase Database(GBase 8s)&lt;/strong&gt;, this command displays two sections: Dbspaces first, Chunks second. Many engineers look at the &lt;code&gt;free&lt;/code&gt; column in the second section, conclude that storage capacity is sufficient, and overlook the structural information in the first section.&lt;/p&gt;

&lt;p&gt;The correct reading order is important: check chunk availability first, understand the dbspace structure second, and evaluate free space last.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Dbspaces: Understand Which Storage Spaces Exist
&lt;/h2&gt;

&lt;p&gt;The first section of &lt;code&gt;onstat -d&lt;/code&gt; lists the dbspaces configured in the instance.&lt;/p&gt;

&lt;p&gt;Example output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;address          number   flags      fchunk   nchunks  pgsize   flags    owner    name
4550b028         1        0x70001    1        1        2048     N  BA    gbasedbt rootdbs
47805258         6        0x60001    6        1        16384    N  BA    gbasedbt datadbs01
 6 active, 2047 maximum
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For &lt;strong&gt;GBase Database dbspace monitoring&lt;/strong&gt;, pay particular attention to four fields:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;number&lt;/code&gt;: The dbspace number.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;fchunk&lt;/code&gt;: The first chunk number belonging to the dbspace.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;nchunks&lt;/code&gt;: The number of chunks associated with the dbspace.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;pgsize&lt;/code&gt;: The page size used by the dbspace.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;code&gt;name&lt;/code&gt; column identifies the dbspace, such as &lt;code&gt;rootdbs&lt;/code&gt; or &lt;code&gt;datadbs01&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;nchunks&lt;/code&gt; value tells you how many physical storage units belong to a logical dbspace. The &lt;code&gt;pgsize&lt;/code&gt; value tells you the page size.&lt;/p&gt;

&lt;p&gt;An important detail: dbspaces with different page sizes cannot simply be mixed. Page size is a design decision that should be verified when creating storage spaces.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Chunks: Find Physical Files and Available Capacity
&lt;/h2&gt;

&lt;p&gt;The second section lists the physical chunks associated with dbspaces.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;address          chunk/dbs     offset     size       free       bpages     flags pathname
4786f028         6      6      0          246366     178082                PO-BE- /opt/gbase/data/datachk01
 6 active, 32766 maximum
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This section answers two practical questions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Where is the physical storage located?&lt;/li&gt;
&lt;li&gt;How much capacity remains available?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The important fields are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;chunk/dbs&lt;/code&gt;: Identifies the chunk number and its owning dbspace number.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;size&lt;/code&gt;: Total chunk size, measured in pages.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;free&lt;/code&gt;: Available space, measured in pages.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;pathname&lt;/code&gt;: Physical file or device path.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Do not read &lt;code&gt;size&lt;/code&gt; and &lt;code&gt;free&lt;/code&gt; as KB.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Both values are expressed in pages. To calculate actual capacity, multiply the page count by the page size of the owning dbspace.&lt;/p&gt;

&lt;p&gt;For example, if the page size is 16 KB and &lt;code&gt;free&lt;/code&gt; is 178082:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;178082 × 16 KB = 2,849,312 KB
                 ≈ 2.72 GiB
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The utilization formula is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Utilization = (size - free) / size × 100%
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This gives you the actual percentage of allocated chunk capacity currently in use.&lt;/p&gt;

&lt;p&gt;Getting the unit wrong can lead to serious mistakes in &lt;strong&gt;GBase Database storage capacity planning&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Understand the Relationship Between Dbspaces and Chunks
&lt;/h2&gt;

&lt;p&gt;The two sections are not independent. They describe different levels of the same storage structure.&lt;/p&gt;

&lt;p&gt;In the Dbspaces section:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;fchunk&lt;/code&gt; identifies the first chunk number.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;nchunks&lt;/code&gt; indicates how many chunks belong to the dbspace.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the Chunks section:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The first number in &lt;code&gt;chunk/dbs&lt;/code&gt; is the chunk number.&lt;/li&gt;
&lt;li&gt;The second number is the owning dbspace number.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Dbspaces:
number = 6
fchunk = 6
nchunks = 1
name = datadbs01

Chunks:
chunk = 6
dbs = 6
pathname = /opt/gbase/data/datachk01
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Following these identifiers lets you move in either direction:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;From a dbspace to its physical chunk.&lt;/li&gt;
&lt;li&gt;From a physical chunk back to its owning dbspace.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This relationship is essential when investigating storage growth or unavailable chunks in GBase Database.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. A Falling Free Value Does Not Always Mean Business Data Is Growing
&lt;/h2&gt;

&lt;p&gt;Another common troubleshooting mistake is assuming that every reduction in free space comes from business table writes.&lt;/p&gt;

&lt;p&gt;Different workloads consume different storage areas:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Business table and index writes consume their assigned dbspaces.&lt;/li&gt;
&lt;li&gt;Temporary sorting operations use temporary storage.&lt;/li&gt;
&lt;li&gt;Physical and logical logging consume their respective log spaces.&lt;/li&gt;
&lt;li&gt;Large object writes consume their designated storage spaces.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With a properly layered storage architecture, engineers can identify which category of workload is consuming capacity.&lt;/p&gt;

&lt;p&gt;When everything is placed in &lt;code&gt;rootdbs&lt;/code&gt;, storage attribution becomes much harder.&lt;/p&gt;

&lt;p&gt;This is why &lt;strong&gt;GBase Database dbspace management&lt;/strong&gt; should be considered part of the initial architecture design rather than an afterthought.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Automate Basic Chunk and Capacity Checks
&lt;/h2&gt;

&lt;p&gt;The text-based output of &lt;code&gt;onstat -d&lt;/code&gt; makes basic storage monitoring straightforward.&lt;/p&gt;

&lt;p&gt;A simple health-check workflow can include three steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Check for unavailable chunks.&lt;/li&gt;
&lt;li&gt;Extract free-space information for each dbspace.&lt;/li&gt;
&lt;li&gt;Record the results in a monitoring log.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Start with this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;onstat -d &lt;span class="o"&gt;|&lt;/span&gt; grep PD
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Any matching output should trigger immediate investigation of the affected chunk.&lt;/p&gt;

&lt;p&gt;An unavailable chunk can make the data stored on it inaccessible and may affect the availability of dependent objects. This should take priority over routine capacity warnings.&lt;/p&gt;

&lt;p&gt;For production monitoring, do not rely on a single &lt;code&gt;grep&lt;/code&gt; result alone. Check the complete chunk status and investigate the associated dbspace before determining the impact.&lt;/p&gt;

&lt;p&gt;Because &lt;code&gt;onstat -d&lt;/code&gt; reports instance storage information directly, it does not require an application database connection. This makes it useful during connection failures and other unhealthy-instance scenarios, provided the instance is still responsive to the command.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. My Recommended onstat -d Reading Order
&lt;/h2&gt;

&lt;p&gt;When troubleshooting storage in &lt;strong&gt;GBase Database(GBase 8s)&lt;/strong&gt;, I follow this sequence:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Check chunk availability&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;onstat -d &lt;span class="o"&gt;|&lt;/span&gt; grep PD
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Rule out unavailable chunks before investigating ordinary capacity issues.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Read the Dbspaces section&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Check &lt;code&gt;pgsize&lt;/code&gt;, &lt;code&gt;fchunk&lt;/code&gt;, and &lt;code&gt;nchunks&lt;/code&gt; to understand the storage structure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Read the Chunks section&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Check &lt;code&gt;size&lt;/code&gt;, &lt;code&gt;free&lt;/code&gt;, and &lt;code&gt;pathname&lt;/code&gt; to identify physical capacity and storage locations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Calculate utilization&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Convert pages into actual storage units and calculate the utilization percentage before making expansion decisions.&lt;/p&gt;

&lt;p&gt;The principle is simple: &lt;strong&gt;check availability before capacity, and understand structure before interpreting numbers.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;onstat -d&lt;/code&gt; may look dense at first, but once you understand the relationship between dbspaces and chunks, storage diagnosis becomes much faster.&lt;/p&gt;

&lt;p&gt;For GBase Database administrators, it is one of the most useful commands to keep at the beginning of a storage troubleshooting workflow.&lt;/p&gt;

</description>
      <category>gbase</category>
      <category>database</category>
      <category>数据库</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>GBase Database Initialization Parameters: Default vs. Baseline Configuration Testing</title>
      <dc:creator>mmllllzcn</dc:creator>
      <pubDate>Thu, 19 Nov 2026 01:23:11 +0000</pubDate>
      <link>https://dev.to/mmllllzcn/gbase-database-initialization-parameters-default-vs-baseline-configuration-testing-6mg</link>
      <guid>https://dev.to/mmllllzcn/gbase-database-initialization-parameters-default-vs-baseline-configuration-testing-6mg</guid>
      <description>&lt;p&gt;&lt;strong&gt;Summary:&lt;/strong&gt; Should you keep the default initialization parameters or apply a predefined configuration baseline? Instead of relying on experience or copying someone else's settings, this guide shows how to run a reproducible comparison test for GBase Database(GBase 8s), measure the results, and determine whether parameter tuning actually benefits your workload.&lt;/p&gt;

&lt;p&gt;Initialization parameter discussions in &lt;strong&gt;GBase Database(GBase 8s)&lt;/strong&gt; often turn into a debate: some engineers believe the defaults are sufficient, while others prefer tuning parameters before production deployment.&lt;/p&gt;

&lt;p&gt;Neither approach is universally correct.&lt;/p&gt;

&lt;p&gt;A better way to decide is to run a controlled comparison between the default &lt;code&gt;onconfig&lt;/code&gt; and a predefined parameter baseline.&lt;/p&gt;

&lt;p&gt;This article focuses on the testing methodology, not a universal performance conclusion. Results will vary depending on hardware, data volume, operating system configuration, and workload characteristics.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Design a Reproducible Configuration Test
&lt;/h2&gt;

&lt;p&gt;The objective is to compare two configurations while keeping all other variables as consistent as possible.&lt;/p&gt;

&lt;p&gt;Prepare two identical machines, or initialize the same machine twice using the same environment and test procedure.&lt;/p&gt;

&lt;p&gt;Keep the following conditions consistent:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Operating system:&lt;/strong&gt; Same OS version and kernel parameters.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data:&lt;/strong&gt; Same data volume, table structures, and indexes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SQL workload:&lt;/strong&gt; Same SQL statements and execution sequence.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Concurrency:&lt;/strong&gt; Same connection ramp and workload duration.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Network:&lt;/strong&gt; Same client machines and network path.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The two test groups are defined as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Group A:&lt;/strong&gt; Default &lt;code&gt;onconfig&lt;/code&gt; configuration.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Group B:&lt;/strong&gt; A predefined initialization parameter baseline.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is an example baseline for GBase Database(GBase 8s):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;VPCLASS              cpu,num=16,noage
MULTIPROCESSOR       1
NETTYPE              soctcp,10,300,NET
BUFFERPOOL           &lt;span class="nv"&gt;size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;16K,buffers=1000000
SHMVIRTSIZE          2048000
SHMADD               1024000
LOCKS                10000000
DEF_TABLE_LOCKMODE   row
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These values are test inputs, not universal recommendations. Before applying them, verify that they are supported by the target GBase Database version and appropriate for the available hardware resources.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. What Metrics Should You Measure?
&lt;/h2&gt;

&lt;p&gt;A common mistake in database benchmarking is recording only QPS or TPS.&lt;/p&gt;

&lt;p&gt;Initialization parameters can also affect connection handling, lock contention, buffer pool behavior, and memory consumption. A meaningful &lt;strong&gt;GBase Database performance test&lt;/strong&gt; should cover at least four categories.&lt;/p&gt;

&lt;h3&gt;
  
  
  2.1 Connection Establishment
&lt;/h3&gt;

&lt;p&gt;Observe whether connection establishment becomes slower as concurrency increases.&lt;/p&gt;

&lt;p&gt;Record:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Connection establishment latency&lt;/li&gt;
&lt;li&gt;Connection queueing&lt;/li&gt;
&lt;li&gt;Connection timeouts&lt;/li&gt;
&lt;li&gt;Failed connection attempts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This helps identify whether the instance can handle the target connection load.&lt;/p&gt;

&lt;h3&gt;
  
  
  2.2 Lock Waits
&lt;/h3&gt;

&lt;p&gt;Record lock wait counts and the longest observed wait.&lt;/p&gt;

&lt;p&gt;Application-side instrumentation can help identify how lock contention affects actual request latency.&lt;/p&gt;

&lt;p&gt;Compare both groups under the same SQL workload and concurrency levels.&lt;/p&gt;

&lt;h3&gt;
  
  
  2.3 Buffer Pool Behavior
&lt;/h3&gt;

&lt;p&gt;Use the &lt;code&gt;onstat&lt;/code&gt; command family to observe buffer pool statistics.&lt;/p&gt;

&lt;p&gt;Pay particular attention to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Buffer pool hit ratio&lt;/li&gt;
&lt;li&gt;Read and write activity&lt;/li&gt;
&lt;li&gt;Dirty page proportion&lt;/li&gt;
&lt;li&gt;Changes in buffer utilization under increasing concurrency&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A larger buffer pool does not automatically guarantee better performance. Its effectiveness depends on the working set and available physical memory.&lt;/p&gt;

&lt;h3&gt;
  
  
  2.4 Memory Consumption and Paging
&lt;/h3&gt;

&lt;p&gt;Monitor shared memory consumption and operating system memory usage.&lt;/p&gt;

&lt;p&gt;The key question is whether the larger buffer pool and other memory allocations cause the operating system to start swapping.&lt;/p&gt;

&lt;p&gt;Record:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Physical memory utilization&lt;/li&gt;
&lt;li&gt;Shared memory allocation&lt;/li&gt;
&lt;li&gt;Swap usage&lt;/li&gt;
&lt;li&gt;Paging activity&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A configuration that improves buffer pool statistics but triggers memory pressure may perform worse overall.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Execute the Comparison Test
&lt;/h2&gt;

&lt;p&gt;Before running each group, confirm that the database instance is in the expected state.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Confirm instance state before each group&lt;/span&gt;
onstat -
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use the same concurrency ramp for both groups:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Test stage&lt;/th&gt;
&lt;th&gt;Concurrent sessions&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Stage 1&lt;/td&gt;
&lt;td&gt;50&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Stage 2&lt;/td&gt;
&lt;td&gt;100&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Stage 3&lt;/td&gt;
&lt;td&gt;200&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Stage 4&lt;/td&gt;
&lt;td&gt;400&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Hold each stage long enough to collect stable measurements across all four observation categories.&lt;/p&gt;

&lt;p&gt;After each group, record the effective configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;grep -E &lt;span class="s1"&gt;'^(VPCLASS|NETTYPE|BUFFERPOOL|SHMVIRTSIZE|SHMADD|LOCKS|DEF_TABLE_LOCKMODE)'&lt;/span&gt; \
&lt;span class="nv"&gt;$GBASEDBTDIR&lt;/span&gt;/etc/onconfig.gbaseserver
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do not assume the configuration file alone proves which parameters were effective at runtime. Where applicable, verify the actual instance settings through the relevant GBase Database monitoring commands.&lt;/p&gt;

&lt;h3&gt;
  
  
  Repeat Each Test at Least Three Times
&lt;/h3&gt;

&lt;p&gt;A single benchmark run can be distorted by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Buffer cache state&lt;/li&gt;
&lt;li&gt;Background database activity&lt;/li&gt;
&lt;li&gt;Concurrent operating system tasks&lt;/li&gt;
&lt;li&gt;Network jitter&lt;/li&gt;
&lt;li&gt;Uneven workload distribution&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Run each test stage at least three times and compare the stable ranges rather than relying on one result.&lt;/p&gt;

&lt;p&gt;If repeated results differ significantly, investigate environmental instability before drawing conclusions.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. How to Interpret the Results
&lt;/h2&gt;

&lt;p&gt;The objective is not to prove that the baseline is always faster. It is to understand how each configuration behaves under the target workload.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scenario A: Group A and Group B perform similarly at low concurrency, but Group A queues connections earlier at high concurrency.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This suggests that configuration-related resource limits may be contributing to the bottleneck. Investigate connection handling, CPU availability, and network configuration before attributing the result to a single parameter.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scenario B: Both groups remain stable at high concurrency.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The default configuration may already be sufficient for this particular workload.&lt;/p&gt;

&lt;p&gt;There is little value in changing parameters simply to make the configuration look more sophisticated.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scenario C: Group B performs worse than Group A.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Check memory sizing first.&lt;/p&gt;

&lt;p&gt;The buffer pool, shared memory segments, and lock structures all consume system resources. Oversizing one or more of them can create memory pressure and paging.&lt;/p&gt;

&lt;p&gt;This is an important principle in &lt;strong&gt;GBase Database parameter tuning&lt;/strong&gt;: overall resource balance matters more than maximizing individual parameter values.&lt;/p&gt;

&lt;p&gt;Also remember that connection queueing or lock waits do not automatically prove that instance configuration is the root cause. SQL execution plans, application behavior, CPU saturation, and storage I/O should remain part of the investigation.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Build a Test Report That Others Can Reproduce
&lt;/h2&gt;

&lt;p&gt;A useful comparison report should contain enough information for another engineer to repeat the experiment.&lt;/p&gt;

&lt;p&gt;At a minimum, include:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Report section&lt;/th&gt;
&lt;th&gt;Information to record&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Machine specifications&lt;/td&gt;
&lt;td&gt;CPU, memory, storage, OS, kernel&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Data environment&lt;/td&gt;
&lt;td&gt;Data volume, table structures, indexes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Configuration&lt;/td&gt;
&lt;td&gt;Default and baseline parameter differences&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Workload&lt;/td&gt;
&lt;td&gt;SQL statements and execution sequence&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Concurrency&lt;/td&gt;
&lt;td&gt;50, 100, 200, and 400 sessions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Measurements&lt;/td&gt;
&lt;td&gt;Connection, lock, buffer pool, memory&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Anomalies&lt;/td&gt;
&lt;td&gt;Errors, timeouts, unstable runs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Conclusion&lt;/td&gt;
&lt;td&gt;Observed differences and applicable workload&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Avoid statements such as "performance improved by 30%" without explaining the test environment.&lt;/p&gt;

&lt;p&gt;A more useful conclusion is specific and verifiable:&lt;/p&gt;

&lt;p&gt;"At 200 concurrent sessions, Group A began queuing connections, while Group B completed the same workload without connection queueing."&lt;/p&gt;

&lt;p&gt;The conclusion should describe what happened under the tested conditions, not promise the same result in another environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Configuration Tuning Should Be Evidence-Based
&lt;/h2&gt;

&lt;p&gt;Initialization parameters in &lt;strong&gt;GBase Database(GBase 8s)&lt;/strong&gt; deserve serious attention, especially before production deployment.&lt;/p&gt;

&lt;p&gt;But serious configuration management does not mean copying a parameter set from another project.&lt;/p&gt;

&lt;p&gt;The right approach is to establish a reproducible baseline, compare it against the defaults, measure the actual workload, and document the results.&lt;/p&gt;

&lt;p&gt;A configuration that works well for one hardware environment may be unsuitable for another.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One controlled comparison test that explains your own environment is more valuable than a remembered collection of supposedly optimal parameter values.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That is the foundation of evidence-based GBase Database initialization and performance tuning.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Keywords:&lt;/strong&gt; GBase Database, GBase Database 8s, Database Initialization Parameters, Database Parameter Benchmark, onconfig Configuration, Database Performance Testing, Database Performance Tuning&lt;/p&gt;

</description>
      <category>gbase</category>
      <category>database</category>
      <category>数据库</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>GBase Database Startup Failure: 5 Common Causes and How to Troubleshoot Them</title>
      <dc:creator>mmllllzcn</dc:creator>
      <pubDate>Wed, 18 Nov 2026 01:19:34 +0000</pubDate>
      <link>https://dev.to/mmllllzcn/gbase-database-startup-failure-5-common-causes-and-how-to-troubleshoot-them-3pdi</link>
      <guid>https://dev.to/mmllllzcn/gbase-database-startup-failure-5-common-causes-and-how-to-troubleshoot-them-3pdi</guid>
      <description>&lt;p&gt;&lt;strong&gt;Meta Description:&lt;/strong&gt; Troubleshoot GBase Database(GBase 8s) instance startup failures with five practical checks covering rootdbs permissions, ROOTPATH, sqlhosts, environment variables, and character set configuration.&lt;/p&gt;

&lt;p&gt;When a GBase Database instance fails to initialize, the error message is often only one or two lines long. The actual cause may be hidden in a directory, file permission, network configuration, or environment variable.&lt;/p&gt;

&lt;p&gt;For &lt;strong&gt;GBase Database(GBase 8s)&lt;/strong&gt;, troubleshooting becomes much easier when you check the environment layer by layer instead of repeatedly running initialization commands.&lt;/p&gt;

&lt;p&gt;This guide covers five common causes of instance initialization failures, explains their symptoms, and provides commands to verify each one.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Incorrect rootdbs Ownership or Permissions
&lt;/h2&gt;

&lt;p&gt;One common cause of GBase Database initialization failure is incorrect ownership or permissions on the root database space file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Typical symptom:&lt;/strong&gt; &lt;code&gt;oninit -ivy&lt;/code&gt; hangs or exits unexpectedly during initialization.&lt;/p&gt;

&lt;p&gt;Check the file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ls -l /opt/GBASE/gbase/dbs/rootdbs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The expected configuration is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Owner: &lt;code&gt;gbasedbt&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Group: &lt;code&gt;gbasedbt&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Permission: &lt;code&gt;660&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the file was created by &lt;code&gt;root&lt;/code&gt; and ownership was never changed, the database process may not have sufficient permissions to write the required reserved page.&lt;/p&gt;

&lt;p&gt;Correct it with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;chown gbasedbt:gbasedbt /opt/GBASE/gbase/dbs/rootdbs
chmod 660 /opt/GBASE/gbase/dbs/rootdbs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Also verify the parent directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ls -ld /opt/GBASE/gbase/dbs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Troubleshooting principle:&lt;/strong&gt; Check file ownership and permissions before investigating more complicated initialization errors.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. ROOTPATH Points to a Nonexistent File
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;ROOTPATH&lt;/code&gt; parameter in &lt;code&gt;onconfig&lt;/code&gt; specifies the location of the root database space.&lt;/p&gt;

&lt;p&gt;If the configured file does not exist, initialization cannot proceed correctly.&lt;/p&gt;

&lt;p&gt;Check the configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;grep &lt;span class="s1"&gt;'^ROOTPATH'&lt;/span&gt; &lt;span class="nv"&gt;$GBASEDBTDIR&lt;/span&gt;/etc/onconfig.gbaseserver
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then verify that the referenced file exists:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ls -l /opt/GBASE/gbase/dbs/rootdbs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Common causes include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A typo in the configured path&lt;/li&gt;
&lt;li&gt;A missing directory&lt;/li&gt;
&lt;li&gt;An incorrect mount point&lt;/li&gt;
&lt;li&gt;A storage volume that was not mounted before startup&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not assume that a valid configuration line means the underlying file is available.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Troubleshooting principle:&lt;/strong&gt; Verify the actual file and its storage location, not just the &lt;code&gt;ROOTPATH&lt;/code&gt; value.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. sqlhosts Uses localhost or an Incorrect Port
&lt;/h2&gt;

&lt;p&gt;Sometimes the GBase Database instance starts successfully, but remote applications cannot connect.&lt;/p&gt;

&lt;p&gt;The problem may be in the &lt;code&gt;sqlhosts&lt;/code&gt; configuration.&lt;/p&gt;

&lt;p&gt;Check the file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cat &lt;span class="nv"&gt;$GBASEDBTSQLHOSTS&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A typical entry looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gbaseserver  onsoctcp  192.168.127.101  9088
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The fields represent:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;gbaseserver&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Instance name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;onsoctcp&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Connection protocol&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;192.168.127.101&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Server IP address&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;9088&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Connection port&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two mistakes are particularly common.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Using localhost&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When remote clients need to connect, using &lt;code&gt;localhost&lt;/code&gt; can cause the connection to resolve to the client's own machine rather than the database server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Port mismatch&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The port configured for the database connection must be consistent with the client connection settings and firewall rules.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Troubleshooting principle:&lt;/strong&gt; Verify the external server address and connection port before investigating application-level authentication.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Environment Variables Point to Another Instance
&lt;/h2&gt;

&lt;p&gt;On servers running multiple GBase Database instances, incorrect environment variables can make administrative commands operate against the wrong instance.&lt;/p&gt;

&lt;p&gt;A typical symptom is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;shared memory not initialized
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Yet database processes may still exist on the host.&lt;/p&gt;

&lt;p&gt;Check the three key environment variables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$GBASEDBTSERVER&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$ONCONFIG&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$GBASEDBTSQLHOSTS&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For the target instance, they should consistently reference:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variable&lt;/th&gt;
&lt;th&gt;Expected value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GBASEDBTSERVER&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;gbaseserver&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ONCONFIG&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;onconfig.gbaseserver&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GBASEDBTSQLHOSTS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The corresponding sqlhosts file&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If only one variable points to another instance, the current shell environment may not match the instance you intend to manage.&lt;/p&gt;

&lt;p&gt;This is particularly important on multi-instance hosts, where similar configuration files can make the mistake difficult to notice.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Troubleshooting principle:&lt;/strong&gt; Confirm all three environment variables together. Checking only one is not enough.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Character Set Does Not Match the Site Requirements
&lt;/h2&gt;

&lt;p&gt;Not every initialization problem causes the instance to fail to start.&lt;/p&gt;

&lt;p&gt;A character set mismatch may only become visible after importing data or connecting applications.&lt;/p&gt;

&lt;p&gt;For example, a script-based initialization may use &lt;code&gt;zh_CN.utf8&lt;/code&gt; as its default character set, while the target environment requires a different setting.&lt;/p&gt;

&lt;p&gt;The result can be garbled text or incorrect character representation.&lt;/p&gt;

&lt;p&gt;Before initialization, confirm the character set required by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Existing business data&lt;/li&gt;
&lt;li&gt;Application clients&lt;/li&gt;
&lt;li&gt;Data migration sources&lt;/li&gt;
&lt;li&gt;Operating environment&lt;/li&gt;
&lt;li&gt;Regional language requirements&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Character set selection should be treated as an initialization decision rather than a parameter to postpone until production launch.&lt;/p&gt;

&lt;p&gt;Before going live, perform a real data import and verify that the stored and displayed text is correct.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Troubleshooting principle:&lt;/strong&gt; Validate character set compatibility with actual application data before production deployment.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. A More Efficient GBase Database Troubleshooting Order
&lt;/h2&gt;

&lt;p&gt;The five problems above belong to different layers. Checking them in a consistent order helps reduce unnecessary investigation.&lt;/p&gt;

&lt;p&gt;A practical sequence is:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Order&lt;/th&gt;
&lt;th&gt;What to check&lt;/th&gt;
&lt;th&gt;Command or file&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Existing instance state&lt;/td&gt;
&lt;td&gt;&lt;code&gt;onstat -&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Instance environment&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;GBASEDBTSERVER&lt;/code&gt;, &lt;code&gt;ONCONFIG&lt;/code&gt;, &lt;code&gt;GBASEDBTSQLHOSTS&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Root database space&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;ROOTPATH&lt;/code&gt; in &lt;code&gt;onconfig&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;File ownership and permissions&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ls -l rootdbs&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;Network configuration&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;sqlhosts&lt;/code&gt; IP and port&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;Character set&lt;/td&gt;
&lt;td&gt;Initialization configuration and data import test&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This sequence answers several questions in order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Does the target instance already exist and what is its current state?&lt;/li&gt;
&lt;li&gt;Is the current shell pointing to the correct instance?&lt;/li&gt;
&lt;li&gt;Can the configured root database space be accessed?&lt;/li&gt;
&lt;li&gt;Are remote connections configured correctly?&lt;/li&gt;
&lt;li&gt;Does the character set meet application requirements?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Each check can be verified independently.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Prevent Initialization Failures Before Running oninit
&lt;/h2&gt;

&lt;p&gt;The five common problems have something in common: they can all be identified before or during the initial startup process.&lt;/p&gt;

&lt;p&gt;Instead of memorizing error messages, move the checks earlier in the deployment workflow.&lt;/p&gt;

&lt;p&gt;Before running &lt;code&gt;oninit&lt;/code&gt;, verify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] The &lt;code&gt;rootdbs&lt;/code&gt; directory and file exist.&lt;/li&gt;
&lt;li&gt;[ ] Ownership and permissions are correct.&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;ROOTPATH&lt;/code&gt; points to the intended file.&lt;/li&gt;
&lt;li&gt;[ ] All three environment variables reference the target instance.&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;sqlhosts&lt;/code&gt; contains the correct server address and port.&lt;/li&gt;
&lt;li&gt;[ ] The character set matches the site requirements.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Initialization should be a controlled operation, not an experiment repeated until it succeeds.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion: Check the Environment Before Repeating Initialization
&lt;/h2&gt;

&lt;p&gt;Troubleshooting GBase Database(GBase 8s) startup failures is often less about understanding complicated error messages and more about checking basic configuration details in the correct order.&lt;/p&gt;

&lt;p&gt;Incorrect file permissions, invalid &lt;code&gt;ROOTPATH&lt;/code&gt;, inconsistent &lt;code&gt;sqlhosts&lt;/code&gt;, wrong environment variables, and character set mismatches can all create avoidable deployment problems.&lt;/p&gt;

&lt;p&gt;The most effective approach is to turn these checks into a standard pre-initialization checklist.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GBase Database initialization happens once, but the configuration baseline should be verified before that first startup.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A few minutes of upfront validation can save much more time than repeatedly troubleshooting a failed initialization.&lt;/p&gt;

</description>
      <category>gbase</category>
      <category>database</category>
      <category>数据库</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>GBase Database Initialization: How to Configure CPU, Connections, Memory, and Locks</title>
      <dc:creator>mmllllzcn</dc:creator>
      <pubDate>Wed, 18 Nov 2026 01:18:07 +0000</pubDate>
      <link>https://dev.to/mmllllzcn/gbase-database-initialization-how-to-configure-cpu-connections-memory-and-locks-hb7</link>
      <guid>https://dev.to/mmllllzcn/gbase-database-initialization-how-to-configure-cpu-connections-memory-and-locks-hb7</guid>
      <description>&lt;p&gt;&lt;strong&gt;Meta Description:&lt;/strong&gt; Learn how to configure CPU, network connections, buffer pools, shared memory, and locks during GBase Database(GBase 8s) initialization. A practical guide to onconfig parameter planning and database performance tuning.&lt;/p&gt;

&lt;p&gt;Configuring a database instance is not just about getting it started. The initial parameter settings determine how much CPU capacity, connection concurrency, memory, and locking resources are available to the workload.&lt;/p&gt;

&lt;p&gt;In &lt;strong&gt;GBase Database(GBase 8s)&lt;/strong&gt;, the &lt;code&gt;onconfig&lt;/code&gt; file contains many configuration parameters. However, four parameter groups deserve particular attention during instance initialization:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;CPU configuration&lt;/li&gt;
&lt;li&gt;Network connections&lt;/li&gt;
&lt;li&gt;Memory allocation&lt;/li&gt;
&lt;li&gt;Lock management&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These groups jointly influence the instance's concurrency and resource capacity. Many changes also require an instance restart before they take effect.&lt;/p&gt;

&lt;p&gt;This guide explains how to establish an initial configuration baseline using actual server resources rather than arbitrary default values.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Collect Hardware and Workload Information First
&lt;/h2&gt;

&lt;p&gt;Before editing &lt;code&gt;onconfig&lt;/code&gt;, collect three essential numbers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Physical CPU cores&lt;/li&gt;
&lt;li&gt;Total physical memory&lt;/li&gt;
&lt;li&gt;Expected peak concurrent connections&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On Linux, use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lscpu &lt;span class="o"&gt;|&lt;/span&gt; grep -E &lt;span class="s1"&gt;'^CPU\(s\)|Core|Socket|Thread'&lt;/span&gt;
free -g
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do not size database parameters using CPU and memory figures alone. Peak concurrency and workload characteristics are equally important.&lt;/p&gt;

&lt;p&gt;The objective is to establish a reasonable starting point that can be validated under actual workloads.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. CPU Configuration: Plan Virtual Processors
&lt;/h2&gt;

&lt;p&gt;Example configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;VPCLASS          cpu,num=16,noage
MULTIPROCESSOR   1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;VPCLASS&lt;/code&gt; controls the configuration of CPU virtual processors.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;num&lt;/code&gt; value should be planned against available physical CPU capacity and the expected workload. For this example, 16 CPU VPs are configured.&lt;/p&gt;

&lt;p&gt;A useful distinction is that logical CPUs and physical cores are not necessarily equivalent. Hyperthreading does not provide the same processing capacity as an additional physical core.&lt;/p&gt;

&lt;p&gt;Blindly treating every logical CPU as an independent physical core can lead to excessive CPU VP allocation and increased scheduling overhead.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;noage&lt;/code&gt; option controls CPU VP aging behavior.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Configuration principle:&lt;/strong&gt; Start with physical CPU resources, then validate VP utilization and workload concurrency. Do not assume that increasing the number of VPs always improves performance.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Connection Configuration: Plan for Peak Concurrency
&lt;/h2&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NETTYPE  soctcp,10,300,NET
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The parameters describe:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;soctcp&lt;/code&gt;: Network protocol.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;10&lt;/code&gt;: Number of polling threads.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;300&lt;/code&gt;: Connections per polling thread.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;NET&lt;/code&gt;: Network VP class.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ten polling threads can serve as an initial example, but the appropriate value depends on CPU capacity and connection workload.&lt;/p&gt;

&lt;p&gt;Connection planning should focus on peak concurrency rather than average connections.&lt;/p&gt;

&lt;p&gt;For example, if an application normally maintains 200 connections but can reach 800 during business peaks, sizing the network configuration only for the average creates an avoidable capacity risk.&lt;/p&gt;

&lt;p&gt;Also account for connection headroom and the associated session memory requirements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Configuration principle:&lt;/strong&gt; Plan connection capacity against peak demand, not the normal operating average.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Memory Configuration: Size BUFFERPOOL and Shared Memory Together
&lt;/h2&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;BUFFERPOOL   size=16K,buffers=1000000,lrus=32,lru_min_dirty=50,lru_max_dirty=60
SHMVIRTSIZE  2048000
SHMADD       1024000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The buffer pool is one of the most important memory components in GBase Database(GBase 8s).&lt;/p&gt;

&lt;p&gt;Its configured size is determined by:&lt;/p&gt;

&lt;p&gt;[&lt;br&gt;
\text{Buffer Pool Size} =&lt;br&gt;
\text{buffers} \times \text{page size}&lt;br&gt;
]&lt;/p&gt;

&lt;p&gt;For the example above:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Page size: 16KB&lt;/li&gt;
&lt;li&gt;Number of buffers: 1,000,000&lt;/li&gt;
&lt;li&gt;Approximate buffer pool size: 16GB&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;code&gt;size&lt;/code&gt; value must match the page size of the corresponding database space.&lt;/p&gt;

&lt;p&gt;Page-size selection is an initialization decision. It should be considered together with the database storage design rather than treated as a parameter that can be changed casually later.&lt;/p&gt;
&lt;h3&gt;
  
  
  Understanding the Shared Memory Parameters
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Parameter&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;BUFFERPOOL&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Configures database buffer pool memory&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SHMVIRTSIZE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Sets the initial virtual shared memory segment size&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SHMADD&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Specifies the additional shared memory segment allocation size&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The buffer pool is not the only consumer of shared memory.&lt;/p&gt;

&lt;p&gt;Session memory, dictionary caches, lock structures, and other internal components also require memory.&lt;/p&gt;

&lt;p&gt;Therefore, avoid allocating nearly all physical memory to the buffer pool.&lt;/p&gt;

&lt;p&gt;An initial capacity plan should reserve sufficient memory for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Database sessions&lt;/li&gt;
&lt;li&gt;Sorting and query execution&lt;/li&gt;
&lt;li&gt;Lock structures&lt;/li&gt;
&lt;li&gt;Other shared memory consumers&lt;/li&gt;
&lt;li&gt;Operating system processes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A buffer pool allocation around 50% of physical memory may be a starting reference in some environments, but it is not a universal recommendation. The appropriate allocation depends on workload, connection count, and total memory demand.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Configuration principle:&lt;/strong&gt; Size the buffer pool and shared memory as one budget, leaving sufficient headroom for other database processes and the operating system.&lt;/p&gt;
&lt;h2&gt;
  
  
  5. Lock Configuration: Prepare for Concurrent Transactions
&lt;/h2&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;LOCKS                10000000
DEF_TABLE_LOCKMODE   row
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The two parameters serve different purposes.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;LOCKS&lt;/code&gt; defines the number of global lock structures available to the instance.&lt;/p&gt;

&lt;p&gt;Write-intensive workloads and high transaction concurrency may require more lock capacity. The initial value should be validated against actual lock consumption and transaction patterns.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;DEF_TABLE_LOCKMODE row&lt;/code&gt; sets the default table lock mode to row level.&lt;/p&gt;

&lt;p&gt;This can reduce unnecessary contention between transactions accessing different rows in the same table.&lt;/p&gt;

&lt;p&gt;However, row-level locking also introduces lock-management overhead. It should be evaluated against the application's access patterns and transaction behavior.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Configuration principle:&lt;/strong&gt; Size lock resources for concurrent transactions, not just the number of database connections.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Why the Four Parameter Groups Must Be Tuned Together
&lt;/h2&gt;

&lt;p&gt;CPU, connections, memory, and locks are closely related.&lt;/p&gt;

&lt;p&gt;Changing one group can affect resource requirements elsewhere.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Increasing CPU VPs can increase processing concurrency and memory requirements.&lt;/li&gt;
&lt;li&gt;Increasing connection capacity can increase session memory consumption.&lt;/li&gt;
&lt;li&gt;More concurrent transactions can increase lock consumption.&lt;/li&gt;
&lt;li&gt;A larger buffer pool reduces the memory available for other shared memory consumers if total memory remains unchanged.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is why GBase Database initialization should be treated as a coordinated capacity planning exercise.&lt;/p&gt;

&lt;p&gt;Configuring each parameter group independently can create an imbalance even when every individual value appears reasonable.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Apply the Configuration and Verify the Instance
&lt;/h2&gt;

&lt;p&gt;After reviewing and updating the &lt;code&gt;onconfig&lt;/code&gt; file, apply the configuration through an appropriate maintenance window.&lt;/p&gt;

&lt;p&gt;For a controlled instance restart, the example commands are:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;onmode -ky
oninit -vy
onstat -
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the instance returns to &lt;code&gt;On-Line&lt;/code&gt;, verify its operating state.&lt;/p&gt;

&lt;p&gt;Do not stop at startup success.&lt;/p&gt;

&lt;p&gt;Run connection tests at the expected concurrency and observe:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CPU utilization&lt;/li&gt;
&lt;li&gt;Memory consumption&lt;/li&gt;
&lt;li&gt;Buffer pool behavior&lt;/li&gt;
&lt;li&gt;Connection capacity&lt;/li&gt;
&lt;li&gt;Lock usage and contention&lt;/li&gt;
&lt;li&gt;Swap activity&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The configuration values are a starting point, not the final performance baseline.&lt;/p&gt;

&lt;p&gt;Read/write ratios, row width, transaction duration, and application connection behavior all affect the results.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Avoid Oversizing: More Resources Do Not Always Mean Better Performance
&lt;/h2&gt;

&lt;p&gt;There is one important warning when configuring GBase Database(GBase 8s): all four parameter groups ultimately compete for finite physical resources.&lt;/p&gt;

&lt;p&gt;An oversized buffer pool or excessive lock allocation can leave insufficient memory for sessions and other database operations.&lt;/p&gt;

&lt;p&gt;If memory pressure pushes active workloads into swap, the resulting performance may be worse than a more conservative configuration.&lt;/p&gt;

&lt;p&gt;Always compare actual memory consumption with the configured values.&lt;/p&gt;

&lt;p&gt;A configuration file tells you what you requested. Runtime monitoring tells you what the instance actually needs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion: Initialization Is the First Performance Tuning Opportunity
&lt;/h2&gt;

&lt;p&gt;A reliable GBase Database initialization baseline starts with four coordinated decisions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CPU:&lt;/strong&gt; Configure virtual processors according to physical CPU capacity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Connections:&lt;/strong&gt; Plan network capacity around peak concurrency.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory:&lt;/strong&gt; Balance buffer pool allocation with total shared memory requirements.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Locks:&lt;/strong&gt; Allocate sufficient lock resources for concurrent transactions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The objective is not to maximize every parameter. It is to balance them against the hardware and workload.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GBase Database provides a flexible configuration framework, but the right initialization parameters must ultimately be validated in your own production environment.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>gbase</category>
      <category>database</category>
      <category>数据库</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>GBase Database Manual Instance Initialization: A Five-Step Guide</title>
      <dc:creator>mmllllzcn</dc:creator>
      <pubDate>Wed, 18 Nov 2026 01:15:22 +0000</pubDate>
      <link>https://dev.to/mmllllzcn/gbase-database-manual-instance-initialization-a-five-step-guide-148</link>
      <guid>https://dev.to/mmllllzcn/gbase-database-manual-instance-initialization-a-five-step-guide-148</guid>
      <description>&lt;p&gt;&lt;strong&gt;Meta Description:&lt;/strong&gt; Learn how to manually initialize a GBase Database(GBase 8s) instance in five steps, from creating the rootdbs file and configuring onconfig to setting up sqlhosts and verifying startup.&lt;/p&gt;

&lt;p&gt;Script-based initialization is convenient for quick validation. But when deploying &lt;strong&gt;GBase Database(GBase 8s)&lt;/strong&gt; in a production environment, manual instance initialization offers more control over directory permissions, configuration files, instance naming, network settings, and startup verification.&lt;/p&gt;

&lt;p&gt;This guide walks through the manual initialization process in five steps, with executable commands and checkpoints for each stage.&lt;/p&gt;

&lt;p&gt;The goal is not simply to get a database instance running. It is to establish a configuration baseline that can be checked, reproduced, and maintained.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before starting, make sure the following conditions are met:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GBase Database(GBase 8s) installation is complete.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;gbasedbt&lt;/code&gt; operating system user already exists.&lt;/li&gt;
&lt;li&gt;The installation directory is &lt;code&gt;/opt/GBASE/gbase&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;You have the required permissions to create directories and configure files.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The example uses the following instance settings:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Item&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Installation directory&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/opt/GBASE/gbase&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Database user&lt;/td&gt;
&lt;td&gt;&lt;code&gt;gbasedbt&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Instance name&lt;/td&gt;
&lt;td&gt;&lt;code&gt;gbaseserver&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Server port&lt;/td&gt;
&lt;td&gt;&lt;code&gt;9088&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Root database space&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/opt/GBASE/gbase/dbs/rootdbs&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Step 1: Create the Data Directory and rootdbs
&lt;/h2&gt;

&lt;p&gt;The first step is to prepare the directory and root database space file.&lt;/p&gt;

&lt;p&gt;Run the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mkdir -p /opt/GBASE/gbase/dbs
chown gbasedbt:gbasedbt /opt/GBASE/gbase/dbs
chmod 755 /opt/GBASE/gbase/dbs

touch /opt/GBASE/gbase/dbs/rootdbs
chown gbasedbt:gbasedbt /opt/GBASE/gbase/dbs/rootdbs
chmod 660 /opt/GBASE/gbase/dbs/rootdbs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Checkpoint:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Confirm that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;dbs&lt;/code&gt; directory belongs to &lt;code&gt;gbasedbt&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;rootdbs&lt;/code&gt; file belongs to &lt;code&gt;gbasedbt&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;rootdbs&lt;/code&gt; permission is &lt;code&gt;660&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can verify the result with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ls -ld /opt/GBASE/gbase/dbs
ls -l /opt/GBASE/gbase/dbs/rootdbs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why does permission &lt;code&gt;660&lt;/code&gt; matter?&lt;/p&gt;

&lt;p&gt;The database process needs read and write access to &lt;code&gt;rootdbs&lt;/code&gt;. The file should not be accessible to unrelated users.&lt;/p&gt;

&lt;p&gt;A common initialization failure occurs when the file is created by &lt;code&gt;root&lt;/code&gt; but its ownership is never changed. The database process then cannot write the required reserved page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Configure the Instance Environment
&lt;/h2&gt;

&lt;p&gt;Next, define the environment variables required by the GBase Database instance.&lt;/p&gt;

&lt;p&gt;Create or edit the instance profile:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;GBASEDBTSERVER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;gbaseserver
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;GBASEDBTDIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/opt/GBASE/gbase
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;ONCONFIG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;onconfig.gbaseserver
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;GBASEDBTSQLHOSTS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$GBASEDBTDIR&lt;/span&gt;/etc/sqlhosts.gbaseserver
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$GBASEDBTDIR&lt;/span&gt;/bin:&lt;span class="nv"&gt;$PATH&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These variables define:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;GBASEDBTSERVER&lt;/code&gt;: The target instance name.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;GBASEDBTDIR&lt;/code&gt;: The GBase Database installation directory.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ONCONFIG&lt;/code&gt;: The configuration file used by the instance.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;GBASEDBTSQLHOSTS&lt;/code&gt;: The network connectivity configuration file.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;PATH&lt;/code&gt;: The executable search path.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Checkpoint:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Verify the instance name:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$GBASEDBTSERVER&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gbaseserver
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make sure the instance name is consistent across the environment configuration, &lt;code&gt;onconfig&lt;/code&gt;, and &lt;code&gt;sqlhosts&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Create the onconfig File
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;onconfig&lt;/code&gt; file defines the main configuration parameters for a GBase Database instance.&lt;/p&gt;

&lt;p&gt;Create:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/opt/GBASE/gbase/etc/onconfig.gbaseserver
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For the initial configuration, start with these essential parameters:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ROOTPATH     /opt/GBASE/gbase/dbs/rootdbs
SERVERNUM    1
DBSERVERNAME gbaseserver
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The three parameters serve different purposes:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Parameter&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ROOTPATH&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Specifies the root database space file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SERVERNUM&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Defines the server number&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DBSERVERNAME&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Defines the database server name&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For production environments, this minimal configuration is only a starting point.&lt;/p&gt;

&lt;p&gt;Additional parameter groups should be planned according to CPU resources, memory capacity, connection requirements, and locking demand.&lt;/p&gt;

&lt;p&gt;These performance and capacity parameters deserve a separate tuning exercise rather than being added without workload analysis.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Configure sqlhosts
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;sqlhosts&lt;/code&gt; file defines how clients connect to the database instance.&lt;/p&gt;

&lt;p&gt;Create:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/opt/GBASE/gbase/etc/sqlhosts.gbaseserver
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the following entry:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gbaseserver  onsoctcp  192.168.127.101  9088
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The fields represent:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;gbaseserver&lt;/code&gt;: The instance name.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;onsoctcp&lt;/code&gt;: The connection protocol.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;192.168.127.101&lt;/code&gt;: The server IP address.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;9088&lt;/code&gt;: The listening port.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Checkpoint:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before initialization, verify that:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The IP address is the actual server address reachable by clients.&lt;/li&gt;
&lt;li&gt;The port is consistent with the network and firewall plan.&lt;/li&gt;
&lt;li&gt;The instance name matches &lt;code&gt;GBASEDBTSERVER&lt;/code&gt; and &lt;code&gt;DBSERVERNAME&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Avoid using &lt;code&gt;localhost&lt;/code&gt; when the instance needs to accept remote client connections.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Initialize and Verify the Instance
&lt;/h2&gt;

&lt;p&gt;With the directory, environment, and configuration files ready, proceed with the first initialization.&lt;/p&gt;

&lt;p&gt;Run the following commands as the &lt;code&gt;gbasedbt&lt;/code&gt; user:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;oninit -ivy
onstat -
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first command initializes the instance. The second checks its current status.&lt;/p&gt;

&lt;p&gt;An example of successful output is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gbaseserver: On-Line -- Up 00:00:13 -- 1121592 Kbytes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;On-Line&lt;/code&gt; status indicates that the instance has entered normal operating mode.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Checkpoint:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Verify that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The instance name is &lt;code&gt;gbaseserver&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The instance status is &lt;code&gt;On-Line&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The uptime is increasing.&lt;/li&gt;
&lt;li&gt;The reported memory usage is reasonable for the configured environment.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What If Initialization Fails?
&lt;/h3&gt;

&lt;p&gt;Do not immediately repeat &lt;code&gt;oninit -ivy&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;First, inspect the current instance state:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;onstat -
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then investigate according to the reported condition.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Case 1: Shared memory not initialized&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Check whether the &lt;code&gt;ROOTPATH&lt;/code&gt; file exists and whether its ownership and permissions are correct.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ls -l /opt/GBASE/gbase/dbs/rootdbs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Also verify that the current shell environment points to the intended instance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Case 2: Port or network error&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Return to the &lt;code&gt;sqlhosts&lt;/code&gt; configuration and verify the server address, port, and network access rules.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Case 3: Instance does not reach On-Line&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Check the instance configuration and startup diagnostics before attempting another initialization.&lt;/p&gt;

&lt;p&gt;Initialization should be performed only after confirming the existing instance state. Repeatedly running initialization commands without understanding the failure can make troubleshooting more difficult.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two Additional Tasks After Initialization
&lt;/h2&gt;

&lt;p&gt;Completing the five steps does not mean the environment is fully ready for long-term operations.&lt;/p&gt;

&lt;p&gt;Two additional tasks help make the deployment reproducible.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Persist the Environment Variables
&lt;/h3&gt;

&lt;p&gt;Add the environment variables from Step 2 to the &lt;code&gt;gbasedbt&lt;/code&gt; user's shell startup file.&lt;/p&gt;

&lt;p&gt;This avoids manually exporting the variables every time the user logs in.&lt;/p&gt;

&lt;p&gt;For example, depending on the user's shell:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vi ~/.bash_profile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the required exports and reload the profile:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;source&lt;/span&gt; ~/.bash_profile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify that the environment points to the correct instance before running administrative commands.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Preserve the Configuration Baseline
&lt;/h3&gt;

&lt;p&gt;Keep the following files together as part of the deployment baseline:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;onconfig.gbaseserver&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;sqlhosts.gbaseserver&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;The instance environment profile&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If your configuration management process supports version control, use it to track changes and compare configurations across rebuilds.&lt;/p&gt;

&lt;p&gt;This makes it easier to identify configuration differences during migration, recovery, and future maintenance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion: Manual Initialization Creates a Reproducible Baseline
&lt;/h2&gt;

&lt;p&gt;Manual initialization of &lt;strong&gt;GBase Database(GBase 8s)&lt;/strong&gt; is more than an alternative to script-based deployment.&lt;/p&gt;

&lt;p&gt;It provides an opportunity to verify every important decision before the instance starts:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create the data directory and &lt;code&gt;rootdbs&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Configure the instance environment.&lt;/li&gt;
&lt;li&gt;Define the essential &lt;code&gt;onconfig&lt;/code&gt; parameters.&lt;/li&gt;
&lt;li&gt;Configure network connectivity through &lt;code&gt;sqlhosts&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Initialize the instance and verify its state with &lt;code&gt;onstat -&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Finally, archive the configuration files, initialization results, and server specifications together.&lt;/p&gt;

&lt;p&gt;The extra effort spent on manual initialization creates a reference baseline for future scaling, rebuilding, and recovery.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A successfully initialized GBase Database instance is the starting point. A reproducible configuration is what makes it maintainable.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>gbase</category>
      <category>database</category>
      <category>数据库</category>
    </item>
  </channel>
</rss>
