monitor.xml 96.6 KB
Newer Older
1 2 3 4 5
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
  PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<topic id="topic1" xml:lang="en">
  <title id="kj138244">Monitoring a Greenplum System</title>
6 7 8
  <shortdesc>You can monitor a Greenplum Database system using a variety of tools included with the
    system or available as add-ons. SNMP support allows Greenplum to be integrated with popular
    system management frameworks. </shortdesc>
9 10 11 12 13 14 15
  <body>
    <p>Observing the Greenplum Database system day-to-day performance helps administrators
      understand the system behavior, plan workflow, and troubleshoot problems. This chapter
      discusses tools for monitoring database performance and activity.</p>
    <p>Also, be sure to review <xref href="../monitoring/monitoring.dita#topic_kmz_lbg_rp"/> for
      monitoring activities you can script to quickly detect problems in the system. </p>
  </body>
C
Chuck Litzell 已提交
16
  <topic id="topic2" xml:lang="en">
17 18
    <title id="kj157177">Monitoring Database Activity and Performance</title>
    <body>
C
Chuck Litzell 已提交
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
      <p>Greenplum Database includes an optional system monitoring and management database,
          <codeph>gpperfmon</codeph>, that administrators can enable. The
          <codeph>gpperfmon_install</codeph> command-line utility creates the
          <codeph>gpperfmon</codeph> database and enables data collection agents that collect and
        store query and system metrics in the database. Administrators can query metrics in the
          <codeph>gpperfmon</codeph> database. See the documentation for the
          <codeph>gpperfmon</codeph> database in the <cite>Greenplum Database Reference
        Guide</cite>.</p>
      <p otherprops="pivotal">Pivotal Greenplum Command Center, an optional web-based interface,
        graphically displays the metrics collected in the <codeph>gpperfmon</codeph> database and
        provides additional system management tools. Download the Greenplum Command Center package
        from <xref href="https://network.pivotal.io" scope="external" format="html">Pivotal
          Network</xref> and view the documentation at the <xref href="http://gpcc.docs.pivotal.io"
          scope="external" format="html">Greenplum Command Center Documentation</xref> web site.
      </p>
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
    </body>
  </topic>
  <topic id="topic3" xml:lang="en">
    <title id="kj155080">Monitoring System State</title>
    <body>
      <p>As a Greenplum Database administrator, you must monitor the system for problem events such
        as a segment going down or running out of disk space on a segment host. The following topics
        describe how to monitor the health of a Greenplum Database system and examine certain state
        information for a Greenplum Database system.</p>
      <ul>
        <li id="kj166984">
          <xref href="#topic4" type="topic" format="dita"/>
        </li>
        <li id="kj167000">
          <xref href="#topic12" type="topic" format="dita"/>
        </li>
        <li id="kj167035">
          <xref href="#topic15" type="topic" format="dita"/>
        </li>
        <li id="kj167040">
          <xref href="#topic20" type="topic" format="dita"/>
        </li>
        <li id="kj184001">
          <xref href="#topic24" type="topic" format="dita"/>
        </li>
        <li>
          <xref href="#topic_slt_ddv_1q" format="dita"/>
        </li>
        <li id="kj185839">
          <xref href="#topic27" type="topic" format="dita"/>
        </li>
      </ul>
    </body>
    <topic id="topic4" xml:lang="en">
      <title id="kj184004">Enabling System Alerts and Notifications</title>
      <body>
C
Chuck Litzell 已提交
70 71 72
        <p>You can configure a Greenplum Database system to trigger SNMP (Simple Network Management
          Protocol) alerts or send email notifications to system administrators if certain database
          events occur. These events include:</p>
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
        <ul>
          <li id="kj180639">All <codeph>PANIC</codeph>-level error conditions</li>
          <li id="kj180640">All <codeph>FATAL</codeph>-level error conditions</li>
          <li id="kj180641"><codeph>ERROR</codeph>-level conditions that are "internal errors" (for
            example, SIGSEGV errors)</li>
          <li id="kj180643">Database system shutdown and restart</li>
          <li id="kj180887">Segment failure and recovery</li>
          <li id="kj180644">Standby master out-of-sync conditions</li>
          <li id="kj180755">Master host manual shutdown or other software problem (in certain
            failure scenarios, Greenplum Database cannot send an alert or notification)</li>
        </ul>
        <p>This topic includes the following sub-topics:<ul id="ul_ttv_3xv_kr">
            <li id="kj168831">
              <xref href="#topic5" type="topic" format="dita"/>
            </li>
            <li id="kj168835">
              <xref href="#topic10" type="topic" format="dita"/>
            </li>
          </ul></p>
C
Chuck Litzell 已提交
92 93 94
        <p>Note that SNMP alerts and email notifications report the same event information. There is
          no difference in the event information that either tool reports. For information about the
          SNMP event information, see <xref href="#topic_jx2_rqg_kp" format="dita"/>.</p>
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
      </body>
      <topic id="topic5" xml:lang="en">
        <title id="kj168804">Using SNMP with a Greenplum Database System</title>
        <body>
          <p>Greenplum Database supports SNMP to monitor the state of a Greenplum Database system
            using MIBs (Management Information Bases). MIBs are collections of objects that describe
            an SNMP-manageable entity — in this case, a Greenplum Database system.</p>
          <p>The Greenplum Database SNMP support allows a Network Management System to obtain
            information about the hardware, operating system, and Greenplum Database from the same
            port (161) and IP address. It also enables the auto-discovery of Greenplum Database
            instances.</p>
        </body>
        <topic id="topic6" xml:lang="en">
          <title id="kj169056">Prerequisites</title>
          <body>
            <p>Before setting up SNMP support on Greenplum Database, ensure SNMP is installed on the
              master host. If the <codeph>snmpd</codeph> file is not present in the
                <codeph>/usr/sbin</codeph> directory, then SNMP is not installed on the system.
              Depending on the platform on which you are running Greenplum Database, install the
              following: </p>
            <table id="kj172177">
              <title>SNMP Prerequisites</title>
              <tgroup cols="2">
                <colspec colnum="1" colname="col1" colwidth="2*"/>
                <colspec colnum="2" colname="col2" colwidth="2*"/>
                <thead>
                  <row>
                    <entry colname="col1">Operating System</entry>
                    <entry colname="col2">Packages<sup>1</sup></entry>
                  </row>
                </thead>
                <tbody>
                  <row>
                    <entry colname="col1">Red Hat Enterprise</entry>
                    <entry colname="col2">net-snmp<p>net-snmp-libs</p><p>net-snmp-utils</p></entry>
                  </row>
                  <row>
                    <entry colname="col1">CentOS</entry>
                    <entry colname="col2">net-snmp</entry>
                  </row>
                  <row>
136
                    <entry colname="col1">SUSE</entry>
137 138 139 140 141 142
                    <entry colname="col2">N/A</entry>
                  </row>
                </tbody>
              </tgroup>
            </table>
            <ol id="ol_hn4_3qb_kp">
143
              <li>SNMP is installed by default on SUSE platforms.</li>
144 145 146 147 148 149 150 151 152 153
            </ol>
            <p>The <codeph>snmp.conf</codeph> configuration file is located in
                <codeph>/etc/snmp/</codeph>. </p>
          </body>
        </topic>
        <topic id="topic8" xml:lang="en">
          <title id="kj178202">Pre-installation Tasks</title>
          <body>
            <p>After you establish that SNMP is on the master host, log in as <codeph>root</codeph>,
              open a text editor, and edit the
154 155
                <codeph><varname>path_to</varname>/snmp/snmpd.conf</codeph> file. To use SNMP with
              Greenplum Database, the minimum configuration change required to the
156 157 158 159 160
                <codeph>snmpd.conf</codeph> file is specifying a community name. For example:</p>
            <p>
              <codeblock>rocommunity public</codeblock>
            </p>
            <note type="note">Replace <codeph>public</codeph> with the name of your SNMP community.
161 162 163
              You should also configure <codeph>syslocation</codeph> and
              <codeph>syscontact</codeph>. Configure other SNMP settings as required for your
              environment and save the file. </note>
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
            <p>For more information about the <codeph>snmpd.conf</codeph> file, enter: </p>
            <codeblock>man snmpd.conf</codeblock>
            <note type="note">On SUSE Linux platforms, make sure to review and configure security
              settings in the <codeph>snmp.conf</codeph> file so <codeph>snmpd</codeph> accepts
              connections from sub-agents and returns all available Object IDs (OIDs).</note>
            <p>After you finish configuring the <codeph>snmpd.conf</codeph> file, start the system
                <codeph>snmpd</codeph> daemon:</p>
            <codeblock># /sbin/chkconfig snmpd on</codeblock>
            <p>Then, verify the system <codeph>snmpd</codeph> daemon is running. Enter:</p>
            <codeblock># snmpwalk -v 1 -c <i>community_name</i> localhost .1.3.6.1.2.1.1.1.0</codeblock>
            <p>For example:</p>
            <codeblock># snmpwalk -v 1 -c public localhost .1.3.6.1.2.1.1.1.0</codeblock>
            <p>If this command returns "<codeph>Timeout: No Response from localhost</codeph>", then
              the system <codeph>snmpd</codeph> daemon is not running. If the daemon is running,
              output similar to the following displays:</p>
179
            <screen>SNMPv2-MIB::sysDescr.0 = STRING: Linux <i>hostname</i> 
180
2.6.18-92.el5 #1 SMP Tue Jun 10 18:51:06 EDT 2016 x86_64</screen>
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
          </body>
        </topic>
        <topic id="topic9" xml:lang="en">
          <title id="kj169986">Setting up SNMP Notifications</title>
          <body>
            <ol>
              <li id="kj170901">To configure a Greenplum Database system to send SNMP notifications
                when alerts occur, set the following parameters on the Greenplum Database master
                host with the <codeph>gpconfig</codeph> utility:<ul id="ul_fjw_kvp_34">
                  <li id="kj170918"><codeph>gp_snmp_community</codeph>: Set this parameter to the
                    community name you specified for your environment.</li>
                  <li id="kj173656"><codeph>gp_snmp_monitor_address</codeph>: Enter the
                      <codeph>hostname:port</codeph> of your network monitor application. Typically,
                    the port number is <codeph>162</codeph>. If there are multiple monitor
                    addresses, separate them with a comma.</li>
                  <li id="kj171054"><codeph>gp_snmp_use_inform_or_trap</codeph>: Enter either
                      <codeph>trap</codeph> or <codeph>inform</codeph>. Trap notifications are SNMP
                    messages sent from one application to another (for example, between Greenplum
                    Database and a network monitoring application). These messages are
                    unacknowledged by the monitoring application, but generate less network
                      overhead.<p>Inform notifications are the same as trap messages, except the
                      application sends an acknowledgement to the application that generated the
                      alert. In this case, the monitoring application sends acknowledgement messages
                      to Greenplum Database-generated trap notifications. While inform messages
                      create more overhead, they inform Greenplum Database the monitoring
                      application has received the traps.</p><p>The following example commands set
                      the server configuration parameters with the Greenplum Database gpconfig
208 209
                      utility:<codeblock>$ gpconfig -c gp_snmp_community -v public --masteronly 
$ gpconfig -c gp_snmp_monitor_address -v mdw:162 --masteronly 
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
$ gpconfig -c gp_snmp_use_inform_or_trap -v trap --masteronly </codeblock></p></li>
                </ul></li>
              <li id="kj170864">To test SNMP notifications, you can use the
                  <codeph>snmptrapd</codeph> trap receiver. As root, enter:<p>
                  <codeblock># /usr/sbin/snmptrapd -m ALL -Lf ~/<i>filename</i>.log
</codeblock>
                </p><p><codeph>-Lf</codeph> indicates that traps are logged to a file.
                    <codeph>-Le</codeph> indicates that traps are logged to <codeph>stderr</codeph>
                  instead. <codeph>-m ALL</codeph> loads all available MIBs (you can also specify
                  individual MIBs if required).</p></li>
            </ol>
          </body>
        </topic>
      </topic>
      <topic id="topic10" xml:lang="en">
        <title id="kj168836">Enabling Email Notifications</title>
        <body>
          <p>Complete the following steps to enable Greenplum Database to send email notifications
            to system administrators whenever certain database events occur.</p>
          <ol>
            <li id="kj168962">Open <codeph>$MASTER_DATA_DIRECTORY/postgresql.conf</codeph> in a text
              editor.</li>
            <li id="kj168963">In the <codeph>EMAIL ALERTS</codeph> section, uncomment the following
              parameters and enter the appropriate values for your email server and domain. For example:<p>
234
                <codeblock>gp_email_smtp_server='smtp.company.com:25'
235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262
gp_email_smtp_userid='gpadmin@example.com'
gp_email_smtp_password='mypassword'
gp_email_from='Greenplum Database &lt;gpadmin@example.com&gt;'
gp_email_to='dba@example.com;John Smith &lt;jsmith@example.com&gt;'
</codeblock>
              </p><p>You may create specific email accounts or groups in your email system that send
                and receive email alerts from the Greenplum Database system. For example:</p><p>
                <codeblock>gp_email_from='GPDB Production Instance &lt;gpdb@example.com&gt;'
gp_email_to='gpdb_dba_group@example.com'
</codeblock>
              </p><p>You can also specify multiple email addresses for both
                  <codeph>gp_email</codeph> parameters. Use a semi-colon ( ; ) to separate each
                email address. For example:</p><p>
                <codeblock>gp_email_to='gpdb_dba_group@example.com;admin@example.com'
</codeblock>
              </p></li>
            <li id="kj168975">Save and close the <codeph>postgresql.conf</codeph> file.</li>
            <li id="kj168979">Reload the Greenplum Database <codeph>postgresql.conf</codeph> file:<p>
                <codeblock>$ gpstop -u
</codeblock>
              </p></li>
          </ol>
        </body>
      </topic>
      <topic id="topic11" xml:lang="en">
        <title id="kj168981">Testing Email Notifications</title>
        <body>
          <p>The Greenplum Database master host must be able to connect to the SMTP email server you
263 264
            specify for the <codeph>gp_email_smtp_server</codeph> parameter. To test connectivity,
            use the <codeph>ping</codeph> command:</p>
265
          <p>
266
            <codeblock>$ ping &lt;<varname>my_email_server</varname>></codeblock>
267
          </p>
268 269 270
          <p>If the master host can contact the SMTP server, run this <codeph>psql</codeph> command
            to log into a database and test email notification with the <codeph>gp_elog</codeph>
            function:</p>
271
          <p>
272
            <codeblock>$ psql -d &lt;<varname>testdb</varname>> -U gpadmin -c "SELECT gp_elog('Test GPDB Email',true);"</codeblock>
273
          </p>
274 275
          <p>The address you specified for the <codeph>gp_email_to</codeph> parameter should receive
            an email with <codeph>Test GPDB Email</codeph> in the subject line.</p>
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299
          <note type="note">If you have difficulty sending and receiving email notifications, verify
            the security settings for you organization's email server and firewall. </note>
        </body>
      </topic>
    </topic>
    <topic id="topic12" xml:lang="en">
      <title id="kj169037">Checking System State</title>
      <body>
        <p>A Greenplum Database system is comprised of multiple PostgreSQL instances (the master and
          segments) spanning multiple machines. To monitor a Greenplum Database system, you need to
          know information about the system as a whole, as well as status information of the
          individual instances. The <codeph>gpstate</codeph> utility provides status information
          about a Greenplum Database system. </p>
      </body>
      <topic id="topic13" xml:lang="en">
        <title>Viewing Master and Segment Status and Configuration </title>
        <body>
          <p>The default <codeph>gpstate</codeph> action is to check segment instances and show a
            brief status of the valid and failed segments. For example, to see a quick status of
            your Greenplum Database system: </p>
          <p>
            <codeblock>$ gpstate
</codeblock>
          </p>
300
          <p>To see more detailed information about your Greenplum Database array configuration, use
301 302 303 304 305 306 307 308 309 310 311 312 313 314
              <codeph>gpstate</codeph> with the <codeph>-s</codeph> option:</p>
          <p>
            <codeblock>$ gpstate -s
</codeblock>
          </p>
        </body>
      </topic>
      <topic id="topic14" xml:lang="en">
        <title id="kj156031">Viewing Your Mirroring Configuration and Status</title>
        <body>
          <p>If you are using mirroring for data redundancy, you may want to see the list of mirror
            segment instances in the system, their current synchronization status, and the mirror to
            primary mapping. For example, to see the mirror segments in the system and their status: </p>
          <p>
315
            <codeblock>$ gpstate -m 
316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342
</codeblock>
          </p>
          <p>To see the primary to mirror segment mappings: </p>
          <p>
            <codeblock>$ gpstate -c
</codeblock>
          </p>
          <p>To see the status of the standby master mirror:</p>
          <p>
            <codeblock>$ gpstate -f
</codeblock>
          </p>
        </body>
      </topic>
    </topic>
    <topic id="topic15" xml:lang="en">
      <title id="kj155115">Checking Disk Space Usage</title>
      <body>
        <p>A database administrator's most important monitoring task is to make sure the file
          systems where the master and segment data directories reside do not grow to more than 70
          percent full. A filled data disk will not result in data corruption, but it may prevent
          normal database activity from continuing. If the disk grows too full, it can cause the
          database server to shut down.</p>
        <p>You can use the <codeph>gp_disk_free</codeph> external table in the
            <codeph>gp_toolkit</codeph> administrative schema to check for remaining free space (in
          kilobytes) on the segment host file systems. For example:</p>
        <p>
343
          <codeblock>=# SELECT * FROM gp_toolkit.gp_disk_free 
344 345 346 347 348 349 350
   ORDER BY dfsegment;
</codeblock>
        </p>
      </body>
      <topic id="topic16" xml:lang="en">
        <title>Checking Sizing of Distributed Databases and Tables</title>
        <body>
351 352 353
          <p>The <codeph>gp_toolkit</codeph> administrative schema contains several views that you
            can use to determine the disk space usage for a distributed Greenplum Database database,
            schema, table, or index. </p>
C
Chuck Litzell 已提交
354 355
          <p>For a list of the available sizing views for checking database object sizes and disk
            space, see the <i>Greenplum Database Reference Guide</i>.</p>
356 357 358 359
        </body>
        <topic id="topic17" xml:lang="en">
          <title id="kj155338">Viewing Disk Space Usage for a Database </title>
          <body>
360 361
            <p>To see the total size of a database (in bytes), use the <i>gp_size_of_database</i>
              view in the <i>gp_toolkit</i> administrative schema. For example: </p>
362
            <p>
363
              <codeblock>=&gt; SELECT * FROM gp_toolkit.gp_size_of_database 
364
   ORDER BY sodddatname;
365 366 367 368 369 370 371
</codeblock>
            </p>
          </body>
        </topic>
        <topic id="topic18" xml:lang="en">
          <title id="kj155347">Viewing Disk Space Usage for a Table </title>
          <body>
372 373 374 375
            <p>The <i>gp_toolkit</i> administrative schema contains several views for checking the
              size of a table. The table sizing views list the table by object ID (not by name). To
              check the size of a table by name, you must look up the relation name
                (<codeph>relname</codeph>) in the <i>pg_class</i> table. For example:</p>
376
            <p>
377 378
              <codeblock>=&gt; SELECT relname AS name, sotdsize AS size, sotdtoastsize 
   AS toast, sotdadditionalsize AS other 
379
   FROM gp_toolkit.gp_size_of_table_disk as sotd, pg_class 
380 381 382
   WHERE sotd.sotdoid=pg_class.oid ORDER BY relname;
</codeblock>
            </p>
C
Chuck Litzell 已提交
383 384
            <p>For a list of the available table sizing views, see the <i>Greenplum Database
                Reference Guide</i>.</p>
385 386 387 388 389
          </body>
        </topic>
        <topic id="topic19" xml:lang="en">
          <title id="kj176079">Viewing Disk Space Usage for Indexes </title>
          <body>
390 391 392 393 394 395 396
            <p>The <i>gp_toolkit</i> administrative schema contains a number of views for checking
              index sizes. To see the total size of all index(es) on a table, use the
                <i>gp_size_of_all_table_indexes</i> view. To see the size of a particular index, use
              the <i>gp_size_of_index</i> view. The index sizing views list tables and indexes by
              object ID (not by name). To check the size of an index by name, you must look up the
              relation name (<codeph>relname</codeph>) in the <i>pg_class</i> table. For
              example:</p>
397 398
            <p>
              <codeblock>=&gt; SELECT soisize, relname as indexname
399
   FROM pg_class, gp_toolkit.gp_size_of_index
400
   WHERE pg_class.oid=gp_size_of_index.soioid 
401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456
   AND pg_class.relkind='i';
</codeblock>
            </p>
          </body>
        </topic>
      </topic>
    </topic>
    <topic id="topic20" xml:lang="en">
      <title id="kj155117">Checking for Data Distribution Skew</title>
      <body>
        <p>All tables in Greenplum Database are distributed, meaning their data is divided evenly
          across all of the segments in the system. Unevenly distributed data may diminish query
          processing performance. A table's distribution policy is determined at table creation
          time. For information about choosing the table distribution policy, see the following
          topics:</p>
        <ul>
          <li id="kj191663">
            <xref href="#topic21" type="topic" format="dita"/>
          </li>
          <li id="kj191667">
            <xref href="#topic22" type="topic" format="dita"/>
          </li>
          <li id="kj167462">
            <xref href="#topic23" type="topic" format="dita"/>
          </li>
        </ul>
        <p>The <i>gp_toolkit</i> administrative schema also contains a number of views for checking
          data distribution skew on a table. For information about how to check for uneven data
          distribution, see the <cite>Greenplum Database Reference Guide</cite>.</p>
      </body>
      <topic id="topic21" xml:lang="en">
        <title id="kj155907">Viewing a Table's Distribution Key</title>
        <body>
          <p>To see the columns used as the data distribution key for a table, you can use the
              <codeph>\d+</codeph> meta-command in <codeph>psql</codeph> to examine the definition
            of a table. For example:</p>
          <p>
            <codeblock>=# <codeph>\d+ sales
</codeph>                Table "retail.sales"
 Column      |     Type     | Modifiers | Description
-------------+--------------+-----------+-------------
 sale_id     | integer      |           |
 amt         | float        |           |
 date        | date         |           |
Has OIDs: no
Distributed by: (sale_id)
</codeblock>
          </p>
        </body>
      </topic>
      <topic id="topic22" xml:lang="en">
        <title id="kj155842">Viewing Data Distribution</title>
        <body>
          <p>To see the data distribution of a table's rows (the number of rows on each segment),
            you can run a query such as:</p>
          <p>
457
            <codeblock>=# SELECT gp_segment_id, count(*) 
458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530
   FROM <i>table_name</i> GROUP BY gp_segment_id;
</codeblock>
          </p>
          <p>A table is considered to have a balanced distribution if all segments have roughly the
            same number of rows.</p>
        </body>
      </topic>
      <topic id="topic23" xml:lang="en">
        <title id="kj155974">Checking for Query Processing Skew</title>
        <body>
          <p>When a query is being processed, all segments should have equal workloads to ensure the
            best possible performance. If you identify a poorly-performing query, you may need to
            investigate further using the <codeph>EXPLAIN</codeph> command. For information about
            using the <codeph>EXPLAIN</codeph> command and query profiling, see <xref
              href="../query/topics/query-profiling.xml#topic39"/>.</p>
          <p>Query processing workload can be skewed if the table's data distribution policy and the
            query predicates are not well matched. To check for processing skew, you can run a query
            such as:</p>
          <p>
            <codeblock>=# SELECT gp_segment_id, count(*) FROM <i>table_name</i>
   WHERE <i>column</i>='<i>value</i>' GROUP BY gp_segment_id;
</codeblock>
          </p>
          <p>This will show the number of rows returned by segment for the given
              <codeph>WHERE</codeph> predicate.</p>
          <section>
            <title>Avoiding an Extreme Skew Warning</title>
            <p>You may receive the following warning message while executing a query that performs a
              hash join operation:</p>
            <p>
              <codeph>Extreme skew in the innerside of Hashjoin</codeph>
            </p>
            <p>This occurs when the input to a hash join operator is skewed. It does not prevent the
              query from completing successfully. You can follow these steps to avoid skew in the
                plan:<ol id="ol_nwc_tyx_bq">
                <li>Ensure that all fact tables are analyzed.</li>
                <li>Verify that any populated temporary table used by the query is analyzed.</li>
                <li>View the <codeph>EXPLAIN ANALYZE</codeph> plan for the query and look for the
                    following:<ul id="ul_kph_zyx_bq">
                    <li>If there are scans with multi-column filters that are producing more rows
                      than estimated, then set the <codeph>gp_selectivity_damping_factor</codeph>
                      server configuration parameter to 2 or higher and retest the query.</li>
                    <li>If the skew occurs while joining a single fact table that is relatively
                      small (less than 5000 rows), set the <codeph>gp_segments_for_planner</codeph>
                      server configuration parameter to 1 and retest the query.</li>
                  </ul></li>
                <li>Check whether the filters applied in the query match distribution keys of the
                  base tables. If the filters and distribution keys are the same, consider
                  redistributing some of the base tables with different distribution keys. </li>
                <li> Check the cardinality of the join keys. If they have low cardinality, try to
                  rewrite the query with different joining columns or or additional filters on the
                  tables to reduce the number of rows. These changes could change the query
                  semantics.</li>
              </ol></p>
          </section>
        </body>
      </topic>
    </topic>
    <topic id="topic24" xml:lang="en">
      <title id="kj164952">Viewing Metadata Information about Database Objects</title>
      <body>
        <p>Greenplum Database tracks various metadata information in its system catalogs about the
          objects stored in a database, such as tables, views, indexes and so on, as well as global
          objects such as roles and tablespaces. </p>
      </body>
      <topic id="topic25" xml:lang="en">
        <title>Viewing the Last Operation Performed</title>
        <body>
          <p>You can use the system views <i>pg_stat_operations</i> and
              <i>pg_stat_partition_operations</i> to look up actions performed on an object, such as
            a table. For example, to see the actions performed on a table, such as when it was
            created and when it was last vacuumed and analyzed:</p>
          <p>
531 532 533 534
            <codeblock>=&gt; SELECT schemaname as schema, objname as table, 
   usename as role, actionname as action, 
   subtype as type, statime as time 
   FROM pg_stat_operations 
535 536 537
   WHERE objname='cust';
 schema | table | role | action  | type  | time
--------+-------+------+---------+-------+--------------------------
538 539 540
  sales | cust  | main | CREATE  | TABLE | 2016-02-09 18:10:07.867977-08
  sales | cust  | main | VACUUM  |       | 2016-02-10 13:32:39.068219-08
  sales | cust  | main | ANALYZE |       | 2016-02-25 16:07:01.157168-08
541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589
(3 rows)
</codeblock>
          </p>
        </body>
      </topic>
      <topic id="topic26" xml:lang="en">
        <title>Viewing the Definition of an Object</title>
        <body>
          <p>To see the definition of an object, such as a table or view, you can use the
              <codeph>\d+</codeph> meta-command when working in <codeph>psql</codeph>. For example,
            to see the definition of a table:</p>
          <p>
            <codeblock>=&gt; \d+ <i>mytable</i>
</codeblock>
          </p>
        </body>
      </topic>
    </topic>
    <topic id="topic_slt_ddv_1q">
      <title>Viewing Session Memory Usage Information</title>
      <body>
        <p>You can create and use the <i>session_level_memory_consumption</i> view that provides
          information about the current memory utilization for sessions that are running queries on
          Greenplum Database. The view contains session information and information such as the
          database that the session is connected to, the query that the session is currently
          running, and memory consumed by the session processes. </p>
        <ul id="ul_hwv_bbb_dq" otherprops="op-help">
          <li>
            <xref href="#topic_nby_j1b_dq" format="dita"/>
          </li>
          <li>
            <xref href="#topic7" format="dita"/>
          </li>
        </ul>
      </body>
      <topic id="topic_nby_j1b_dq">
        <title>Creating the session_level_memory_consumption View</title>
        <body>
          <p>To create the <i>session_level_memory_consumption</i> view in a Greenplum Database, run
            the script <codeph>$GPHOME/share/postgresql/contrib/gp_session_state.sql</codeph> once
            for each database. For example, to install the view in the database
              <codeph>testdb</codeph>, use this
            command:<codeblock>$ psql -d testdb -f $GPHOME/share/postgresql/contrib/gp_session_state.sql</codeblock></p>
        </body>
      </topic>
      <topic id="topic7" xml:lang="en">
        <title id="ff142493">The session_level_memory_consumption View</title>
        <body>
          <p>The <i>session_level_memory_consumption</i> view provides information about memory
590
            consumption and idle time for sessions that are running SQL queries. </p>
591 592
          <p>When resource queue-based resource management is active, the column
            <codeph>is_runaway</codeph> indicates whether Greenplum
593
            Database considers the session a runaway session based on the vmem memory consumption of
594 595 596 597 598 599 600
            the session's queries. Under the resource queue-based resource management scheme, Greenplum
            Database considers the session a runaway when the queries consume an excessive amount of
            memory. The Greenplum Database server configuration
            parameter <codeph>runaway_detector_activation_percent</codeph> governs the
            conditions under which Greenplum Database considers a session a runaway session. </p>
          <p>The <codeph>is_runaway</codeph>, <codeph>runaway_vmem_mb</codeph>, and
            <codeph>runaway_command_cnt</codeph> columns are not applicable when resource group-based resource management is active.</p>
601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717
          <table id="session_level_memory_consumption_table">
            <title>session_level_memory_consumption</title>
            <tgroup cols="4">
              <colspec colnum="1" colname="col1" colwidth="131pt"/>
              <colspec colnum="2" colname="col2" colwidth="86pt"/>
              <colspec colnum="3" colname="col3" colwidth="85pt"/>
              <colspec colnum="4" colname="col4" colwidth="147pt"/>
              <thead>
                <row>
                  <entry colname="col1">column</entry>
                  <entry colname="col2">type</entry>
                  <entry colname="col3">references</entry>
                  <entry colname="col4">description</entry>
                </row>
              </thead>
              <tbody>
                <row>
                  <entry colname="col1">
                    <codeph>datname</codeph>
                  </entry>
                  <entry colname="col2">name</entry>
                  <entry colname="col3"/>
                  <entry colname="col4">Name of the database that the session is connected
                    to.</entry>
                </row>
                <row>
                  <entry colname="col1">
                    <codeph>sess_id</codeph>
                  </entry>
                  <entry colname="col2">integer</entry>
                  <entry colname="col3"/>
                  <entry colname="col4">Session ID.</entry>
                </row>
                <row>
                  <entry colname="col1">
                    <codeph>usename</codeph>
                  </entry>
                  <entry colname="col2">name</entry>
                  <entry colname="col3"/>
                  <entry colname="col4">Name of the session user.</entry>
                </row>
                <row>
                  <entry colname="col1">
                    <codeph>current_query</codeph>
                  </entry>
                  <entry colname="col2">text</entry>
                  <entry colname="col3"/>
                  <entry colname="col4">Current SQL query that the session is running.</entry>
                </row>
                <row>
                  <entry colname="col1">
                    <codeph>segid</codeph>
                  </entry>
                  <entry colname="col2">integer</entry>
                  <entry colname="col3"/>
                  <entry colname="col4">Segment ID.</entry>
                </row>
                <row>
                  <entry colname="col1">
                    <codeph>vmem_mb</codeph>
                  </entry>
                  <entry colname="col2">integer</entry>
                  <entry colname="col3"/>
                  <entry colname="col4">Total vmem memory usage for the session in MB.</entry>
                </row>
                <row>
                  <entry colname="col1">
                    <codeph>is_runaway</codeph>
                  </entry>
                  <entry colname="col2">boolean</entry>
                  <entry colname="col3"/>
                  <entry colname="col4">Session is marked as runaway on the segment.</entry>
                </row>
                <row>
                  <entry colname="col1">
                    <codeph>qe_count</codeph>
                  </entry>
                  <entry colname="col2">integer</entry>
                  <entry colname="col3"/>
                  <entry colname="col4">Number of query processes for the session.</entry>
                </row>
                <row>
                  <entry colname="col1">
                    <codeph>active_qe_count</codeph>
                  </entry>
                  <entry colname="col2">integer</entry>
                  <entry colname="col3"/>
                  <entry colname="col4">Number of active query processes for the session.</entry>
                </row>
                <row>
                  <entry colname="col1">
                    <codeph>dirty_qe_count</codeph>
                  </entry>
                  <entry colname="col2">integer</entry>
                  <entry colname="col3"/>
                  <entry colname="col4">Number of query processes that have not yet released their
                      memory.<p>The value is <codeph>-1</codeph> for sessions that are not
                      running.</p></entry>
                </row>
                <row>
                  <entry colname="col1">
                    <codeph>runaway_vmem_mb</codeph>
                  </entry>
                  <entry colname="col2">integer</entry>
                  <entry colname="col3"/>
                  <entry colname="col4">Amount of vmem memory that the session was consuming when it
                    was marked as a runaway session.</entry>
                </row>
                <row>
                  <entry colname="col1">
                    <codeph>runaway_command_cnt</codeph>
                  </entry>
                  <entry colname="col2">integer</entry>
                  <entry colname="col3"/>
                  <entry colname="col4">Command count for the session when it was marked as a
                    runaway session.</entry>
                </row>
718 719
                <row>
                  <entry colname="col1">
720
                    <codeph>idle_start</codeph>
721 722 723
                  </entry>
                  <entry colname="col2">timestamptz</entry>
                  <entry colname="col3"/>
724 725
                  <entry colname="col4">The last time a query process in this session became
                    idle.</entry>
726
                </row>
727 728 729 730 731 732 733 734 735
              </tbody>
            </tgroup>
          </table>
        </body>
      </topic>
    </topic>
    <topic id="topic27" xml:lang="en">
      <title id="kj185498">Viewing Query Workfile Usage Information</title>
      <body>
736 737 738 739 740 741 742
        <p>The Greenplum Database administrative schema <i>gp_toolkit</i> contains views that
          display information about Greenplum Database workfiles. Greenplum Database creates
          workfiles on disk if it does not have sufficient memory to execute the query in memory.
          This information can be used for troubleshooting and tuning queries. The information in
          the views can also be used to specify the values for the Greenplum Database configuration
          parameters <codeph>gp_workfile_limit_per_query</codeph> and
            <codeph>gp_workfile_limit_per_segment</codeph>. </p>
743 744
        <p>These are the views in the schema <i>gp_toolkit</i>:</p>
        <ul>
745 746 747 748 749 750 751
          <li id="kj191083">The gp_workfile_entries view contains one row for each operator using
            disk space for workfiles on a segment at the current time.</li>
          <li id="kj191084">The gp_workfile_usage_per_query view contains one row for each query
            using disk space for workfiles on a segment at the current time. </li>
          <li id="kj191085">The gp_workfile_usage_per_segment view contains one row for each
            segment. Each row displays the total amount of disk space used for workfiles on the
            segment at the current time.</li>
752
        </ul>
753 754
        <p>For information about using <i>gp_toolkit</i>, see <xref href="#topic31" format="dita"
          />.</p>
755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986
      </body>
    </topic>
  </topic>
  <topic id="topic28" xml:lang="en">
    <title id="kj166926">Viewing the Database Server Log Files</title>
    <body>
      <p>Every database instance in Greenplum Database (master and segments) runs a PostgreSQL
        database server with its own server log file. Daily log files are created in the
          <codeph>pg_log</codeph> directory of the master and each segment data directory.</p>
    </body>
    <topic id="topic29" xml:lang="en">
      <title id="kj165340">Log File Format</title>
      <body>
        <p>The server log files are written in comma-separated values (CSV) format. Some log entries
          will not have values for all log fields. For example, only log entries associated with a
          query worker process will have the <codeph>slice_id</codeph> populated. You can identify
          related log entries of a particular query by the query's session identifier
            (<codeph>gp_session_id</codeph>) and command identifier
            (<codeph>gp_command_count</codeph>).</p>
        <p>The following fields are written to the log:</p>
        <table id="kj165707">
          <title>Greenplum Database Server Log Format</title>
          <tgroup cols="4">
            <colspec colnum="1" colname="col1" colwidth="28*"/>
            <colspec colnum="2" colname="col2" colwidth="90*"/>
            <colspec colnum="3" colname="col3" colwidth="89*"/>
            <colspec colnum="4" colname="col4" colwidth="241*"/>
            <thead>
              <row>
                <entry colname="col1">#</entry>
                <entry colname="col2">Field Name</entry>
                <entry colname="col3">Data Type</entry>
                <entry colname="col4">Description</entry>
              </row>
            </thead>
            <tbody>
              <row>
                <entry colname="col1">1</entry>
                <entry colname="col2">event_time</entry>
                <entry colname="col3">timestamp with time zone</entry>
                <entry colname="col4">Time that the log entry was written to the log</entry>
              </row>
              <row>
                <entry colname="col1">2</entry>
                <entry colname="col2">user_name</entry>
                <entry colname="col3">varchar(100)</entry>
                <entry colname="col4">The database user name</entry>
              </row>
              <row>
                <entry colname="col1">3</entry>
                <entry colname="col2">database_name</entry>
                <entry colname="col3">varchar(100)</entry>
                <entry colname="col4">The database name</entry>
              </row>
              <row>
                <entry colname="col1">4</entry>
                <entry colname="col2">process_id</entry>
                <entry colname="col3">varchar(10)</entry>
                <entry colname="col4">The system process ID (prefixed with "p")</entry>
              </row>
              <row>
                <entry colname="col1">5</entry>
                <entry colname="col2">thread_id</entry>
                <entry colname="col3">varchar(50)</entry>
                <entry colname="col4">The thread count (prefixed with "th")</entry>
              </row>
              <row>
                <entry colname="col1">6</entry>
                <entry colname="col2">remote_host</entry>
                <entry colname="col3">varchar(100)</entry>
                <entry colname="col4">On the master, the hostname/address of the client machine. On
                  the segment, the hostname/address of the master.</entry>
              </row>
              <row>
                <entry colname="col1">7</entry>
                <entry colname="col2">remote_port</entry>
                <entry colname="col3">varchar(10)</entry>
                <entry colname="col4">The segment or master port number</entry>
              </row>
              <row>
                <entry colname="col1">8</entry>
                <entry colname="col2">session_start_time</entry>
                <entry colname="col3">timestamp with time zone</entry>
                <entry colname="col4">Time session connection was opened</entry>
              </row>
              <row>
                <entry colname="col1">9</entry>
                <entry colname="col2">transaction_id </entry>
                <entry colname="col3">int</entry>
                <entry colname="col4">Top-level transaction ID on the master. This ID is the parent
                  of any subtransactions.</entry>
              </row>
              <row>
                <entry colname="col1">10</entry>
                <entry colname="col2">gp_session_id</entry>
                <entry colname="col3">text</entry>
                <entry colname="col4">Session identifier number (prefixed with "con")</entry>
              </row>
              <row>
                <entry colname="col1">11</entry>
                <entry colname="col2">gp_command_count</entry>
                <entry colname="col3">text</entry>
                <entry colname="col4">The command number within a session (prefixed with
                  "cmd")</entry>
              </row>
              <row>
                <entry colname="col1">12</entry>
                <entry colname="col2">gp_segment</entry>
                <entry colname="col3">text</entry>
                <entry colname="col4">The segment content identifier (prefixed with "seg" for
                  primaries or "mir" for mirrors). The master always has a content ID of -1.</entry>
              </row>
              <row>
                <entry colname="col1">13</entry>
                <entry colname="col2">slice_id</entry>
                <entry colname="col3">text</entry>
                <entry colname="col4">The slice ID (portion of the query plan being
                  executed)</entry>
              </row>
              <row>
                <entry colname="col1">14</entry>
                <entry colname="col2">distr_tranx_id</entry>
                <entry colname="col3">text</entry>
                <entry colname="col4">Distributed transaction ID</entry>
              </row>
              <row>
                <entry colname="col1">15</entry>
                <entry colname="col2">local_tranx_id</entry>
                <entry colname="col3">text</entry>
                <entry colname="col4">Local transaction ID</entry>
              </row>
              <row>
                <entry colname="col1">16</entry>
                <entry colname="col2">sub_tranx_id</entry>
                <entry colname="col3">text</entry>
                <entry colname="col4">Subtransaction ID</entry>
              </row>
              <row>
                <entry colname="col1">17</entry>
                <entry colname="col2">event_severity</entry>
                <entry colname="col3">varchar(10)</entry>
                <entry colname="col4">Values include: LOG, ERROR, FATAL, PANIC, DEBUG1,
                  DEBUG2</entry>
              </row>
              <row>
                <entry colname="col1">18</entry>
                <entry colname="col2">sql_state_code</entry>
                <entry colname="col3">varchar(10)</entry>
                <entry colname="col4">SQL state code associated with the log message</entry>
              </row>
              <row>
                <entry colname="col1">19</entry>
                <entry colname="col2">event_message </entry>
                <entry colname="col3">text</entry>
                <entry colname="col4">Log or error message text</entry>
              </row>
              <row>
                <entry colname="col1">20</entry>
                <entry colname="col2">event_detail</entry>
                <entry colname="col3">text</entry>
                <entry colname="col4">Detail message text associated with an error or warning
                  message</entry>
              </row>
              <row>
                <entry colname="col1">21</entry>
                <entry colname="col2">event_hint</entry>
                <entry colname="col3">text</entry>
                <entry colname="col4">Hint message text associated with an error or warning
                  message</entry>
              </row>
              <row>
                <entry colname="col1">22</entry>
                <entry colname="col2">internal_query</entry>
                <entry colname="col3">text</entry>
                <entry colname="col4">The internally-generated query text</entry>
              </row>
              <row>
                <entry colname="col1">23</entry>
                <entry colname="col2">internal_query_pos</entry>
                <entry colname="col3">int</entry>
                <entry colname="col4">The cursor index into the internally-generated query
                  text</entry>
              </row>
              <row>
                <entry colname="col1">24</entry>
                <entry colname="col2">event_context</entry>
                <entry colname="col3">text</entry>
                <entry colname="col4">The context in which this message gets generated</entry>
              </row>
              <row>
                <entry colname="col1">25</entry>
                <entry colname="col2">debug_query_string</entry>
                <entry colname="col3">text</entry>
                <entry colname="col4">User-supplied query string with full detail for debugging.
                  This string can be modified for internal use. </entry>
              </row>
              <row>
                <entry colname="col1">26</entry>
                <entry colname="col2">error_cursor_pos</entry>
                <entry colname="col3">int</entry>
                <entry colname="col4">The cursor index into the query string</entry>
              </row>
              <row>
                <entry colname="col1">27</entry>
                <entry colname="col2">func_name</entry>
                <entry colname="col3">text</entry>
                <entry colname="col4">The function in which this message is generated</entry>
              </row>
              <row>
                <entry colname="col1">28</entry>
                <entry colname="col2">file_name</entry>
                <entry colname="col3">text</entry>
                <entry colname="col4">The internal code file where the message originated</entry>
              </row>
              <row>
                <entry colname="col1">29</entry>
                <entry colname="col2">file_line</entry>
                <entry colname="col3">int</entry>
                <entry colname="col4">The line of the code file where the message originated</entry>
              </row>
              <row>
                <entry colname="col1">30</entry>
                <entry colname="col2">stack_trace</entry>
                <entry colname="col3">text</entry>
                <entry colname="col4">Stack trace text associated with this message</entry>
              </row>
            </tbody>
          </tgroup>
        </table>
      </body>
    </topic>
    <topic id="topic30" xml:lang="en">
987
      <title>Searching the Greenplum Server Log Files</title>
988
      <body>
989 990 991 992 993
        <p>Greenplum Database provides a utility called <codeph>gplogfilter</codeph> can search
          through a Greenplum Database log file for entries matching the specified criteria. By
          default, this utility searches through the Greenplum Database master log file in the
          default logging location. For example, to display the last three lines of the master log
          file:</p>
994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012
        <p>
          <codeblock>$ gplogfilter -n 3
</codeblock>
        </p>
        <p>To search through all segment log files simultaneously, run <codeph>gplogfilter</codeph>
          through the <codeph>gpssh</codeph> utility. For example, to display the last three lines
          of each segment log file:</p>
        <p>
          <codeblock>$ gpssh -f seg_host_file
</codeblock>
        </p>
        <codeblock>=&gt; source /usr/local/greenplum-db/greenplum_path.sh
=&gt; gplogfilter -n 3 /gpdata/gp*/pg_log/gpdb*.log</codeblock>
      </body>
    </topic>
  </topic>
  <topic id="topic31" xml:lang="en">
    <title id="kj168900">Using gp_toolkit</title>
    <body>
1013 1014 1015 1016 1017 1018
      <p>Use the Greenplum Database administrative schema <i>gp_toolkit</i> to query the system
        catalogs, log files, and operating environment for system status information. The
          <codeph>gp_toolkit</codeph> schema contains several views you can access using SQL
        commands. The <i>gp_toolkit</i> schema is accessible to all database users. Some objects
        require superuser permissions. Use a command similar to the following to add the
          <i>gp_toolkit</i> schema to your schema search path:</p>
1019
      <codeblock>=&gt; ALTER ROLE myrole SET search_path TO myschema,gp_toolkit;</codeblock>
C
Chuck Litzell 已提交
1020 1021
      <p>For a description of the available administrative schema views and their usages, see the
          <cite>Greenplum Database Reference Guide</cite>.</p>
1022 1023 1024
    </body>
  </topic>
  <topic id="topic_jx2_rqg_kp">
1025
    <title>Greenplum Database SNMP OIDs and Error Codes</title>
1026
    <body>
1027 1028 1029
      <p>When a Greenplum Database system is configured to trigger SNMP alerts or send email
        notifications to system administrators if certain database events occur, the alerts and
        notifications contain<ph> Object IDs (OIDs) and</ph> SQL error codes.</p>
1030 1031 1032 1033 1034 1035 1036 1037 1038 1039
      <p>
        <ul id="ul_qxx_xrg_kp">
          <li>
            <xref href="#topic_xk1_grg_kp" format="dita"/>
          </li>
          <li>
            <xref href="#topic_pyh_sqg_kp" format="dita"/>
          </li>
        </ul>
      </p>
C
Chuck Litzell 已提交
1040 1041
      <p>For information about enabling Greenplum Database to use SNMP, see <xref href="#topic4"
          format="dita"/></p>
1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199
    </body>
    <topic id="topic_xk1_grg_kp">
      <title>Greenplum Database SNMP OIDs</title>
      <body>
        <p>This is the Greenplum Database OID hierarchy structure:</p>
        <codeblock>iso(1)
identified-organization(3)
dod(6)
internet(1)
private(4)
enterprises(1)
gpdbMIB(31327)
gpdbObjects(1)
gpdbAlertMsg(1)</codeblock>
        <parml>
          <plentry>
            <pt>gpdbAlertMsg</pt>
            <pd>
              <codeblock>1.3.6.1.4.1.31327.1.1: STRING: alert message text</codeblock>
            </pd>
          </plentry>
          <plentry>
            <pt>gpdbAlertSeverity</pt>
            <pd>
              <codeblock>1.3.6.1.4.1.31327.1.2: INTEGER: severity level</codeblock>
              <p>gpdbAlertSeverity can have one of the following values:</p>
              <codeblock>gpdbSevUnknown(0)
gpdbSevOk(1)
gpdbSevWarning(2)
gpdbSevError(3)
gpdbSevFatal(4)
gpdbSevPanic(5)
gpdbSevSystemDegraded(6)
gpdbSevSystemDown(7)</codeblock>
            </pd>
          </plentry>
          <plentry>
            <pt>gpdbAlertSqlstate</pt>
            <pd>
              <codeblock>1.3.6.1.4.1.31327.1.3: STRING: SQL standard error codes</codeblock>
              <p>For a list of codes, see SQL Standard Error Codes.</p>
            </pd>
          </plentry>
          <plentry>
            <pt>gpdbAlertDetail</pt>
            <pd>
              <codeblock>1.3.6.1.4.1.31327.1.4: STRING: detailed alert message text</codeblock>
            </pd>
          </plentry>
          <plentry>
            <pt>gpdbAlertSqlStmt</pt>
            <pd>
              <codeblock>1.3.6.1.4.1.31327.1.5: STRING: SQL statement generating this alert if applicable</codeblock>
            </pd>
          </plentry>
          <plentry>
            <pt>gpdbAlertSystemName</pt>
            <pd>
              <codeblock>1.3.6.1.4.1.31327.1.6: STRING: hostname</codeblock>
            </pd>
          </plentry>
        </parml>
      </body>
    </topic>
    <topic id="topic_pyh_sqg_kp">
      <title>SQL Standard Error Codes</title>
      <body>
        <p>The following table lists all the defined error codes. Some are not used, but are defined
          by the SQL standard. The error classes are also shown. For each error class there is a
          standard error code having the last three characters 000. This code is used only for error
          conditions that fall within the class but do not have any more-specific code assigned. </p>
        <p>The PL/pgSQL condition name for each error code is the same as the phrase shown in the
          table, with underscores substituted for spaces. For example, code 22012, DIVISION BY ZERO,
          has condition name DIVISION_BY_ZERO. Condition names can be written in either upper or
          lower case.</p>
        <note>PL/pgSQL does not recognize warning, as opposed to error, condition names; those are
          classes 00, 01, and 02.</note>
        <table frame="all" id="table_m1k_sqg_kp">
          <title>SQL Codes</title>
          <tgroup cols="3">
            <colspec colnum="1" colname="col1" colwidth=".8*"/>
            <colspec colnum="2" colname="col2" colwidth="2.5*"/>
            <colspec colnum="3" colname="col3" colwidth="3*"/>
            <thead>
              <row>
                <entry>Error Code</entry>
                <entry>Meaning</entry>
                <entry>Constant</entry>
              </row>
            </thead>
            <tbody>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 00 </b>— Successful Completion</entry>
              </row>
              <row>
                <entry>00000</entry>
                <entry>SUCCESSFUL COMPLETION</entry>
                <entry>successful_completion</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3">Class 01 — Warning</entry>
              </row>
              <row>
                <entry>01000</entry>
                <entry>WARNING</entry>
                <entry>warning</entry>
              </row>
              <row>
                <entry>0100C</entry>
                <entry>DYNAMIC RESULT SETS RETURNED</entry>
                <entry>dynamic_result_sets_returned</entry>
              </row>
              <row>
                <entry>01008</entry>
                <entry>IMPLICIT ZERO BIT PADDING</entry>
                <entry>implicit_zero_bit_padding</entry>
              </row>
              <row>
                <entry>01003</entry>
                <entry>NULL VALUE ELIMINATED IN SET FUNCTION</entry>
                <entry>null_value_eliminated_in_set_function</entry>
              </row>
              <row>
                <entry>01007</entry>
                <entry>PRIVILEGE NOT GRANTED</entry>
                <entry>privilege_not_granted</entry>
              </row>
              <row>
                <entry>01006</entry>
                <entry>PRIVILEGE NOT REVOKED</entry>
                <entry>privilege_not_revoked</entry>
              </row>
              <row>
                <entry>01004</entry>
                <entry>STRING DATA RIGHT TRUNCATION</entry>
                <entry>string_data_right_truncation</entry>
              </row>
              <row>
                <entry>01P01</entry>
                <entry>DEPRECATED FEATURE</entry>
                <entry>deprecated_feature</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 02</b> — No Data (this is also a
                  warning class per the SQL standard)</entry>
              </row>
              <row>
                <entry>02000</entry>
                <entry>NO DATA</entry>
                <entry>no_data</entry>
              </row>
              <row>
                <entry>02001</entry>
                <entry>NO ADDITIONAL DYNAMIC RESULT SETS RETURNED</entry>
                <entry>no_additional_dynamic_result_sets_returned</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 03</b> — SQL Statement Not Yet
                  Complete</entry>
              </row>
              <row>
                <entry>03000</entry>
                <entry>SQL STATEMENT NOT YET COMPLETE</entry>
                <entry>sql_statement_not_yet_complete</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 08</b> — Connection Exception</entry>
              </row>
              <row>
                <entry>08000</entry>
                <entry>CONNECTION EXCEPTION</entry>
                <entry>connection_exception</entry>
              </row>
              <row>
                <entry>08003</entry>
                <entry>CONNECTION DOES NOT EXIST</entry>
                <entry>connection_does_not_exist</entry>
              </row>
              <row>
                <entry>08006</entry>
                <entry>CONNECTION FAILURE</entry>
                <entry>connection_failure</entry>
              </row>
              <row>
                <entry>08001</entry>
                <entry>SQLCLIENT UNABLE TO ESTABLISH SQLCONNECTION</entry>
                <entry>sqlclient_unable_to_establish_sqlconnection</entry>
              </row>
              <row>
                <entry>08004</entry>
                <entry>SQLSERVER REJECTED ESTABLISHMENT OF SQLCONNECTION</entry>
                <entry>sqlserver_rejected_establishment_of_sqlconnection</entry>
              </row>
              <row>
                <entry>08007</entry>
                <entry>TRANSACTION RESOLUTION UNKNOWN</entry>
                <entry>transaction_resolution_unknown</entry>
              </row>
              <row>
                <entry>08P01</entry>
                <entry>PROTOCOL VIOLATION</entry>
                <entry>protocol_violation</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 09</b> — Triggered Action
                  Exception</entry>
              </row>
              <row>
                <entry>09000</entry>
                <entry>TRIGGERED ACTION EXCEPTION</entry>
                <entry>triggered_action_exception</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 0A</b> — Feature Not Supported</entry>
              </row>
              <row>
                <entry>0A000</entry>
                <entry>FEATURE NOT SUPPORTED</entry>
                <entry>feature_not_supported</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 0B</b> — Invalid Transaction
                  Initiation</entry>
              </row>
              <row>
                <entry>0B000</entry>
                <entry>INVALID TRANSACTION INITIATION</entry>
                <entry>invalid_transaction_initiation</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 0F</b> — Locator Exception</entry>
              </row>
              <row>
                <entry>0F000</entry>
                <entry>LOCATOR EXCEPTION</entry>
                <entry>locator_exception</entry>
              </row>
              <row>
                <entry>0F001</entry>
                <entry>INVALID LOCATOR SPECIFICATION</entry>
                <entry>invalid_locator_specification</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 0L</b> — Invalid Grantor</entry>
              </row>
              <row>
                <entry>0L000</entry>
                <entry>INVALID GRANTOR</entry>
                <entry>invalid_grantor</entry>
              </row>
              <row>
                <entry>0LP01</entry>
                <entry>INVALID GRANT OPERATION</entry>
                <entry>invalid_grant_operation</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 0P</b> — Invalid Role
                  Specification</entry>
              </row>
              <row>
                <entry>0P000</entry>
                <entry>INVALID ROLE SPECIFICATION</entry>
                <entry>invalid_role_specification</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 21</b> — Cardinality Violation</entry>
              </row>
              <row>
                <entry>21000</entry>
                <entry>CARDINALITY VIOLATION</entry>
                <entry>cardinality_violation</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 22</b> — Data Exception</entry>
              </row>
              <row>
                <entry>22000</entry>
                <entry>DATA EXCEPTION</entry>
                <entry>data_exception</entry>
              </row>
              <row>
                <entry>2202E</entry>
                <entry>ARRAY SUBSCRIPT ERROR</entry>
                <entry>array_subscript_error</entry>
              </row>
              <row>
                <entry>22021</entry>
                <entry>CHARACTER NOT IN REPERTOIRE</entry>
                <entry>character_not_in_repertoire</entry>
              </row>
              <row>
                <entry>22008</entry>
                <entry>DATETIME FIELD OVERFLOW</entry>
                <entry>datetime_field_overflow</entry>
              </row>
              <row>
                <entry>22012</entry>
                <entry>DIVISION BY ZERO</entry>
                <entry>division_by_zero</entry>
              </row>
              <row>
                <entry>22005</entry>
                <entry>ERROR IN ASSIGNMENT</entry>
                <entry>error_in_assignment</entry>
              </row>
              <row>
                <entry>2200B</entry>
                <entry>ESCAPE CHARACTER CONFLICT</entry>
                <entry>escape_character_conflict</entry>
              </row>
              <row>
                <entry>22022</entry>
                <entry>INDICATOR OVERFLOW</entry>
                <entry>indicator_overflow</entry>
              </row>
              <row>
                <entry>22015</entry>
                <entry>INTERVAL FIELD OVERFLOW</entry>
                <entry>interval_field_overflow</entry>
              </row>
              <row>
                <entry>2201E</entry>
                <entry>INVALID ARGUMENT FOR LOGARITHM</entry>
                <entry>invalid_argument_for_logarithm</entry>
              </row>
              <row>
                <entry>2201F</entry>
                <entry>INVALID ARGUMENT FOR POWER FUNCTION</entry>
                <entry>invalid_argument_for_power_function</entry>
              </row>
              <row>
                <entry>2201G</entry>
                <entry>INVALID ARGUMENT FOR WIDTH BUCKET FUNCTION</entry>
                <entry>invalid_argument_for_width_bucket_function</entry>
              </row>
              <row>
                <entry>22018</entry>
                <entry>INVALID CHARACTER VALUE FOR CAST</entry>
                <entry>invalid_character_value_for_cast</entry>
              </row>
              <row>
                <entry>22007</entry>
                <entry>INVALID DATETIME FORMAT</entry>
                <entry>invalid_datetime_format</entry>
              </row>
              <row>
                <entry>22019</entry>
                <entry>INVALID ESCAPE CHARACTER</entry>
                <entry>invalid_escape_character</entry>
              </row>
              <row>
                <entry>2200D</entry>
                <entry>INVALID ESCAPE OCTET</entry>
                <entry>invalid_escape_octet</entry>
              </row>
              <row>
                <entry>22025</entry>
                <entry>INVALID ESCAPE SEQUENCE</entry>
                <entry>invalid_escape_sequence</entry>
              </row>
              <row>
                <entry>22P06</entry>
                <entry>NONSTANDARD USE OF ESCAPE CHARACTER</entry>
                <entry>nonstandard_use_of_escape_character</entry>
              </row>
              <row>
                <entry>22010</entry>
                <entry>INVALID INDICATOR PARAMETER VALUE</entry>
                <entry>invalid_indicator_parameter_value</entry>
              </row>
              <row>
                <entry>22020</entry>
                <entry>INVALID LIMIT VALUE</entry>
                <entry>invalid_limit_value</entry>
              </row>
              <row>
                <entry>22023</entry>
                <entry>INVALID PARAMETER VALUE</entry>
                <entry>invalid_parameter_value</entry>
              </row>
              <row>
                <entry>2201B</entry>
                <entry>INVALID REGULAR EXPRESSION</entry>
                <entry>invalid_regular_expression</entry>
              </row>
              <row>
                <entry>22009</entry>
                <entry>INVALID TIME ZONE DISPLACEMENT VALUE</entry>
                <entry>invalid_time_zone_displacement_value</entry>
              </row>
              <row>
                <entry>2200C</entry>
                <entry>INVALID USE OF ESCAPE CHARACTER</entry>
                <entry>invalid_use_of_escape_character</entry>
              </row>
              <row>
                <entry>2200G</entry>
                <entry>MOST SPECIFIC TYPE MISMATCH</entry>
                <entry>most_specific_type_mismatch</entry>
              </row>
              <row>
                <entry>22004</entry>
                <entry>NULL VALUE NOT ALLOWED</entry>
                <entry>null_value_not_allowed</entry>
              </row>
              <row>
                <entry>22002</entry>
                <entry>NULL VALUE NO INDICATOR PARAMETER</entry>
                <entry>null_value_no_indicator_parameter</entry>
              </row>
              <row>
                <entry>22003</entry>
                <entry>NUMERIC VALUE OUT OF RANGE</entry>
                <entry>numeric_value_out_of_range</entry>
              </row>
              <row>
                <entry>22026</entry>
                <entry>STRING DATA LENGTH MISMATCH</entry>
                <entry>string_data_length_mismatch</entry>
              </row>
              <row>
                <entry>22001</entry>
                <entry>STRING DATA RIGHT TRUNCATION</entry>
                <entry>string_data_right_truncation</entry>
              </row>
              <row>
                <entry>22011</entry>
                <entry>SUBSTRING ERROR</entry>
                <entry>substring_error</entry>
              </row>
              <row>
                <entry>22027</entry>
                <entry>TRIM ERROR</entry>
                <entry>trim_error</entry>
              </row>
              <row>
                <entry>22024</entry>
                <entry>UNTERMINATED C STRING</entry>
                <entry>unterminated_c_string</entry>
              </row>
              <row>
                <entry>2200F</entry>
                <entry>ZERO LENGTH CHARACTER STRING</entry>
                <entry>zero_length_character_string</entry>
              </row>
              <row>
                <entry>22P01</entry>
                <entry>FLOATING POINT EXCEPTION</entry>
                <entry>floating_point_exception</entry>
              </row>
              <row>
                <entry>22P02</entry>
                <entry>INVALID TEXT REPRESENTATION</entry>
                <entry>invalid_text_representation</entry>
              </row>
              <row>
                <entry>22P03</entry>
                <entry>INVALID BINARY REPRESENTATION</entry>
                <entry>invalid_binary_representation</entry>
              </row>
              <row>
                <entry>22P04</entry>
                <entry>BAD COPY FILE FORMAT</entry>
                <entry>bad_copy_file_format</entry>
              </row>
              <row>
                <entry>22P05</entry>
                <entry>UNTRANSLATABLE CHARACTER</entry>
                <entry>untranslatable_character</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 23</b> — Integrity Constraint
                  Violation</entry>
              </row>
              <row>
                <entry>23000</entry>
                <entry>INTEGRITY CONSTRAINT VIOLATION</entry>
                <entry>integrity_constraint_violation</entry>
              </row>
              <row>
                <entry>23001</entry>
                <entry>RESTRICT VIOLATION</entry>
                <entry>restrict_violation</entry>
              </row>
              <row>
                <entry>23502</entry>
                <entry>NOT NULL VIOLATION</entry>
                <entry>not_null_violation</entry>
              </row>
              <row>
                <entry>23503</entry>
                <entry>FOREIGN KEY VIOLATION</entry>
                <entry>foreign_key_violation</entry>
              </row>
              <row>
                <entry>23505</entry>
                <entry>UNIQUE VIOLATION</entry>
                <entry>unique_violation</entry>
              </row>
              <row>
                <entry>23514</entry>
                <entry>CHECK VIOLATION</entry>
                <entry>check_violation</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 24</b> — Invalid Cursor State</entry>
              </row>
              <row>
                <entry>24000</entry>
                <entry>INVALID CURSOR STATE</entry>
                <entry>invalid_cursor_state</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 25</b> — Invalid Transaction
                  State</entry>
              </row>
              <row>
                <entry>25000</entry>
                <entry>INVALID TRANSACTION STATE</entry>
                <entry>invalid_transaction_state</entry>
              </row>
              <row>
                <entry>25001</entry>
                <entry>ACTIVE SQL TRANSACTION</entry>
                <entry>active_sql_transaction</entry>
              </row>
              <row>
                <entry>25002</entry>
                <entry>BRANCH TRANSACTION ALREADY ACTIVE</entry>
                <entry>branch_transaction_already_active</entry>
              </row>
              <row>
                <entry>25008</entry>
                <entry>HELD CURSOR REQUIRES SAME ISOLATION LEVEL</entry>
                <entry>held_cursor_requires_same_isolation_level</entry>
              </row>
              <row>
                <entry>25003</entry>
                <entry>INAPPROPRIATE ACCESS MODE FOR BRANCH TRANSACTION</entry>
                <entry>inappropriate_access_mode_for_branch_transaction</entry>
              </row>
              <row>
                <entry>25004</entry>
                <entry>INAPPROPRIATE ISOLATION LEVEL FOR BRANCH TRANSACTION</entry>
                <entry>inappropriate_isolation_level_for_branch_transaction</entry>
              </row>
              <row>
                <entry>25005</entry>
                <entry>NO ACTIVE SQL TRANSACTION FOR BRANCH TRANSACTION</entry>
                <entry>no_active_sql_transaction_for_branch_transaction</entry>
              </row>
              <row>
                <entry>25006</entry>
                <entry>READ ONLY SQL TRANSACTION</entry>
                <entry>read_only_sql_transaction</entry>
              </row>
              <row>
                <entry>25007</entry>
                <entry>SCHEMA AND DATA STATEMENT MIXING NOT SUPPORTED</entry>
                <entry>schema_and_data_statement_mixing_not_supported</entry>
              </row>
              <row>
                <entry>25P01</entry>
                <entry>NO ACTIVE SQL TRANSACTION</entry>
                <entry>no_active_sql_transaction</entry>
              </row>
              <row>
                <entry>25P02</entry>
                <entry>IN FAILED SQL TRANSACTION</entry>
                <entry>in_failed_sql_transaction</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 26</b> — Invalid SQL Statement
                  Name</entry>
              </row>
              <row>
                <entry>26000</entry>
                <entry>INVALID SQL STATEMENT NAME</entry>
                <entry>invalid_sql_statement_name</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 27</b> — Triggered Data Change
                  Violation</entry>
              </row>
              <row>
                <entry>27000</entry>
                <entry>TRIGGERED DATA CHANGE VIOLATION</entry>
                <entry>triggered_data_change_violation</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 28</b> — Invalid Authorization
                  Specification</entry>
              </row>
              <row>
                <entry>28000</entry>
                <entry>INVALID AUTHORIZATION SPECIFICATION</entry>
                <entry>invalid_authorization_specification</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 2B</b> — Dependent Privilege
                  Descriptors Still Exist</entry>
              </row>
              <row>
                <entry>2B000</entry>
                <entry>DEPENDENT PRIVILEGE DESCRIPTORS STILL EXIST</entry>
                <entry>dependent_privilege_descriptors_still_exist</entry>
              </row>
              <row>
                <entry>2BP01</entry>
                <entry>DEPENDENT OBJECTS STILL EXIST</entry>
                <entry>dependent_objects_still_exist</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 2D</b> — Invalid Transaction
                  Termination</entry>
              </row>
              <row>
                <entry>2D000</entry>
                <entry>INVALID TRANSACTION TERMINATION</entry>
                <entry>invalid_transaction_termination</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 2F</b> — SQL Routine Exception</entry>
              </row>
              <row>
                <entry>2F000</entry>
                <entry>SQL ROUTINE EXCEPTION</entry>
                <entry>sql_routine_exception</entry>
              </row>
              <row>
                <entry>2F005</entry>
                <entry>FUNCTION EXECUTED NO RETURN STATEMENT</entry>
                <entry>function_executed_no_return_statement</entry>
              </row>
              <row>
                <entry>2F002</entry>
                <entry>MODIFYING SQL DATA NOT PERMITTED</entry>
                <entry>modifying_sql_data_not_permitted</entry>
              </row>
              <row>
                <entry>2F003</entry>
                <entry>PROHIBITED SQL STATEMENT ATTEMPTED</entry>
                <entry>prohibited_sql_statement_attempted</entry>
              </row>
              <row>
                <entry>2F004</entry>
                <entry>READING SQL DATA NOT PERMITTED</entry>
                <entry>reading_sql_data_not_permitted</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 34</b> — Invalid Cursor Name</entry>
              </row>
              <row>
                <entry>34000</entry>
                <entry>INVALID CURSOR NAME</entry>
                <entry>invalid_cursor_name</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 38</b> — External Routine
                  Exception</entry>
              </row>
              <row>
                <entry>38000</entry>
                <entry>EXTERNAL ROUTINE EXCEPTION</entry>
                <entry>external_routine_exception</entry>
              </row>
              <row>
                <entry>38001</entry>
                <entry>CONTAINING SQL NOT PERMITTED</entry>
                <entry>containing_sql_not_permitted</entry>
              </row>
              <row>
                <entry>38002</entry>
                <entry>MODIFYING SQL DATA NOT PERMITTED</entry>
                <entry>modifying_sql_data_not_permitted</entry>
              </row>
              <row>
                <entry>38003</entry>
                <entry>PROHIBITED SQL STATEMENT ATTEMPTED</entry>
                <entry>prohibited_sql_statement_attempted</entry>
              </row>
              <row>
                <entry>38004</entry>
                <entry>READING SQL DATA NOT PERMITTED</entry>
                <entry>reading_sql_data_not_permitted</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 39</b> — External Routine Invocation
                  Exception</entry>
              </row>
              <row>
                <entry>39000</entry>
                <entry>EXTERNAL ROUTINE INVOCATION EXCEPTION</entry>
                <entry>external_routine_invocation_exception</entry>
              </row>
              <row>
                <entry>39001</entry>
                <entry>INVALID SQLSTATE RETURNED</entry>
                <entry>invalid_sqlstate_returned</entry>
              </row>
              <row>
                <entry>39004</entry>
                <entry>NULL VALUE NOT ALLOWED</entry>
                <entry>null_value_not_allowed</entry>
              </row>
              <row>
                <entry>39P01</entry>
                <entry>TRIGGER PROTOCOL VIOLATED</entry>
                <entry>trigger_protocol_violated</entry>
              </row>
              <row>
                <entry>39P02</entry>
                <entry>SRF PROTOCOL VIOLATED</entry>
                <entry>srf_protocol_violated</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 3B</b> — Savepoint Exception</entry>
              </row>
              <row>
                <entry>3B000</entry>
                <entry>SAVEPOINT EXCEPTION</entry>
                <entry>savepoint_exception</entry>
              </row>
              <row>
                <entry>3B001</entry>
                <entry>INVALID SAVEPOINT SPECIFICATION</entry>
                <entry>invalid_savepoint_specification</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 3D</b> — Invalid Catalog Name</entry>
              </row>
              <row>
                <entry>3D000</entry>
                <entry>INVALID CATALOG NAME</entry>
                <entry>invalid_catalog_name</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 3F</b> — Invalid Schema Name</entry>
              </row>
              <row>
                <entry>3F000</entry>
                <entry>INVALID SCHEMA NAME</entry>
                <entry>invalid_schema_name</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 40</b> — Transaction Rollback</entry>
              </row>
              <row>
                <entry>40000</entry>
                <entry>TRANSACTION ROLLBACK</entry>
                <entry>transaction_rollback</entry>
              </row>
              <row>
                <entry>40002</entry>
                <entry>TRANSACTION INTEGRITY CONSTRAINT VIOLATION</entry>
                <entry>transaction_integrity_constraint_violation</entry>
              </row>
              <row>
                <entry>40001</entry>
                <entry>SERIALIZATION FAILURE</entry>
                <entry>serialization_failure</entry>
              </row>
              <row>
                <entry>40003</entry>
                <entry>STATEMENT COMPLETION UNKNOWN</entry>
                <entry>statement_completion_unknown</entry>
              </row>
              <row>
                <entry>40P01</entry>
                <entry>DEADLOCK DETECTED</entry>
                <entry>deadlock_detected</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 42</b> — Syntax Error or Access Rule
                  Violation</entry>
              </row>
              <row>
                <entry>42000</entry>
                <entry>SYNTAX ERROR OR ACCESS RULE VIOLATION</entry>
                <entry>syntax_error_or_access_rule_violation</entry>
              </row>
              <row>
                <entry>42601</entry>
                <entry>SYNTAX ERROR</entry>
                <entry>syntax_error</entry>
              </row>
              <row>
                <entry>42501</entry>
                <entry>INSUFFICIENT PRIVILEGE</entry>
                <entry>insufficient_privilege</entry>
              </row>
              <row>
                <entry>42846</entry>
                <entry>CANNOT COERCE</entry>
                <entry>cannot_coerce</entry>
              </row>
              <row>
                <entry>42803</entry>
                <entry>GROUPING ERROR</entry>
                <entry>grouping_error</entry>
              </row>
              <row>
                <entry>42830</entry>
                <entry>INVALID FOREIGN KEY</entry>
                <entry>invalid_foreign_key</entry>
              </row>
              <row>
                <entry>42602</entry>
                <entry>INVALID NAME</entry>
                <entry>invalid_name</entry>
              </row>
              <row>
                <entry>42622</entry>
                <entry>NAME TOO LONG</entry>
                <entry>name_too_long</entry>
              </row>
              <row>
                <entry>42939</entry>
                <entry>RESERVED NAME</entry>
                <entry>reserved_name</entry>
              </row>
              <row>
                <entry>42804</entry>
                <entry>DATATYPE MISMATCH</entry>
                <entry>datatype_mismatch</entry>
              </row>
              <row>
                <entry>42P18</entry>
                <entry>INDETERMINATE DATATYPE</entry>
                <entry>indeterminate_datatype</entry>
              </row>
              <row>
                <entry>42809</entry>
                <entry>WRONG OBJECT TYPE</entry>
                <entry>wrong_object_type</entry>
              </row>
              <row>
                <entry>42703</entry>
                <entry>UNDEFINED COLUMN</entry>
                <entry>undefined_column</entry>
              </row>
              <row>
                <entry>42883</entry>
                <entry>UNDEFINED FUNCTION</entry>
                <entry>undefined_function</entry>
              </row>
              <row>
                <entry>42P01</entry>
                <entry>UNDEFINED TABLE</entry>
                <entry>undefined_table</entry>
              </row>
              <row>
                <entry>42P02</entry>
                <entry>UNDEFINED PARAMETER</entry>
                <entry>undefined_parameter</entry>
              </row>
              <row>
                <entry>42704</entry>
                <entry>UNDEFINED OBJECT</entry>
                <entry>undefined_object</entry>
              </row>
              <row>
                <entry>42701</entry>
                <entry>DUPLICATE COLUMN</entry>
                <entry>duplicate_column</entry>
              </row>
              <row>
                <entry>42P03</entry>
                <entry>DUPLICATE CURSOR</entry>
                <entry>duplicate_cursor</entry>
              </row>
              <row>
                <entry>42P04</entry>
                <entry>DUPLICATE DATABASE</entry>
                <entry>duplicate_database</entry>
              </row>
              <row>
                <entry>42723</entry>
                <entry>DUPLICATE FUNCTION</entry>
                <entry>duplicate_function</entry>
              </row>
              <row>
                <entry>42P05</entry>
                <entry>DUPLICATE PREPARED STATEMENT</entry>
                <entry>duplicate_prepared_statement</entry>
              </row>
              <row>
                <entry>42P06</entry>
                <entry>DUPLICATE SCHEMA</entry>
                <entry>duplicate_schema</entry>
              </row>
              <row>
                <entry>42P07</entry>
                <entry>DUPLICATE TABLE</entry>
                <entry>duplicate_table</entry>
              </row>
              <row>
                <entry>42712</entry>
                <entry>DUPLICATE ALIAS</entry>
                <entry>duplicate_alias</entry>
              </row>
              <row>
                <entry>42710</entry>
                <entry>DUPLICATE OBJECT</entry>
                <entry>duplicate_object</entry>
              </row>
              <row>
                <entry>42702</entry>
                <entry>AMBIGUOUS COLUMN</entry>
                <entry>ambiguous_column</entry>
              </row>
              <row>
                <entry>42725</entry>
                <entry>AMBIGUOUS FUNCTION</entry>
                <entry>ambiguous_function</entry>
              </row>
              <row>
                <entry>42P08</entry>
                <entry>AMBIGUOUS PARAMETER</entry>
                <entry>ambiguous_parameter</entry>
              </row>
              <row>
                <entry>42P09</entry>
                <entry>AMBIGUOUS ALIAS</entry>
                <entry>ambiguous_alias</entry>
              </row>
              <row>
                <entry>42P10</entry>
                <entry>INVALID COLUMN REFERENCE</entry>
                <entry>invalid_column_reference</entry>
              </row>
              <row>
                <entry>42611</entry>
                <entry>INVALID COLUMN DEFINITION</entry>
                <entry>invalid_column_definition</entry>
              </row>
              <row>
                <entry>42P11</entry>
                <entry>INVALID CURSOR DEFINITION</entry>
                <entry>invalid_cursor_definition</entry>
              </row>
              <row>
                <entry>42P12</entry>
                <entry>INVALID DATABASE DEFINITION</entry>
                <entry>invalid_database_definition</entry>
              </row>
              <row>
                <entry>42P13</entry>
                <entry>INVALID FUNCTION DEFINITION</entry>
                <entry>invalid_function_definition</entry>
              </row>
              <row>
                <entry>42P14</entry>
                <entry>INVALID PREPARED STATEMENT DEFINITION</entry>
                <entry>invalid_prepared_statement_definition</entry>
              </row>
              <row>
                <entry>42P15</entry>
                <entry>INVALID SCHEMA DEFINITION</entry>
                <entry>invalid_schema_definition</entry>
              </row>
              <row>
                <entry>42P16</entry>
                <entry>INVALID TABLE DEFINITION</entry>
                <entry>invalid_table_definition</entry>
              </row>
              <row>
                <entry>42P17</entry>
                <entry>INVALID OBJECT DEFINITION</entry>
                <entry>invalid_object_definition</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 44</b> — WITH CHECK OPTION
                  Violation</entry>
              </row>
              <row>
                <entry>44000</entry>
                <entry>WITH CHECK OPTION VIOLATION</entry>
                <entry>with_check_option_violation</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 53</b> — Insufficient Resources</entry>
              </row>
              <row>
                <entry>53000</entry>
                <entry>INSUFFICIENT RESOURCES</entry>
                <entry>insufficient_resources</entry>
              </row>
              <row>
                <entry>53100</entry>
                <entry>DISK FULL</entry>
                <entry>disk_full</entry>
              </row>
              <row>
                <entry>53200</entry>
                <entry>OUT OF MEMORY</entry>
                <entry>out_of_memory</entry>
              </row>
              <row>
                <entry>53300</entry>
                <entry>TOO MANY CONNECTIONS</entry>
                <entry>too_many_connections</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 54</b> — Program Limit Exceeded</entry>
              </row>
              <row>
                <entry>54000</entry>
                <entry>PROGRAM LIMIT EXCEEDED</entry>
                <entry>program_limit_exceeded</entry>
              </row>
              <row>
                <entry>54001</entry>
                <entry>STATEMENT TOO COMPLEX</entry>
                <entry>statement_too_complex</entry>
              </row>
              <row>
                <entry>54011</entry>
                <entry>TOO MANY COLUMNS</entry>
                <entry>too_many_columns</entry>
              </row>
              <row>
                <entry>54023</entry>
                <entry>TOO MANY ARGUMENTS</entry>
                <entry>too_many_arguments</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 55</b> — Object Not In Prerequisite
                  State</entry>
              </row>
              <row>
                <entry>55000</entry>
                <entry>OBJECT NOT IN PREREQUISITE STATE</entry>
                <entry>object_not_in_prerequisite_state</entry>
              </row>
              <row>
                <entry>55006</entry>
                <entry>OBJECT IN USE</entry>
                <entry>object_in_use</entry>
              </row>
              <row>
                <entry>55P02</entry>
                <entry>CANT CHANGE RUNTIME PARAM</entry>
                <entry>cant_change_runtime_param</entry>
              </row>
              <row>
                <entry>55P03</entry>
                <entry>LOCK NOT AVAILABLE</entry>
                <entry>lock_not_available</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 57</b> — Operator Intervention</entry>
              </row>
              <row>
                <entry>57000</entry>
                <entry>OPERATOR INTERVENTION</entry>
                <entry>operator_intervention</entry>
              </row>
              <row>
                <entry>57014</entry>
                <entry>QUERY CANCELED</entry>
                <entry>query_canceled</entry>
              </row>
              <row>
                <entry>57P01</entry>
                <entry>ADMIN SHUTDOWN</entry>
                <entry>admin_shutdown</entry>
              </row>
              <row>
                <entry>57P02</entry>
                <entry>CRASH SHUTDOWN</entry>
                <entry>crash_shutdown</entry>
              </row>
              <row>
                <entry>57P03</entry>
                <entry>CANNOT CONNECT NOW</entry>
                <entry>cannot_connect_now</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class 58</b> — System Error (errors external
                  to Greenplum Database )</entry>
              </row>
              <row>
                <entry>58030</entry>
                <entry>IO ERROR</entry>
                <entry>io_error</entry>
              </row>
              <row>
                <entry>58P01</entry>
                <entry>UNDEFINED FILE</entry>
                <entry>undefined_file</entry>
              </row>
              <row>
                <entry>58P02</entry>
                <entry>DUPLICATE FILE</entry>
                <entry>duplicate_file</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3">Class F0 — Configuration File Error</entry>
              </row>
              <row>
                <entry>F0000</entry>
                <entry>CONFIG FILE ERROR</entry>
                <entry>config_file_error</entry>
              </row>
              <row>
                <entry>F0001</entry>
                <entry>LOCK FILE EXISTS</entry>
                <entry>lock_file_exists</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class P0</b> — PL/pgSQL Error</entry>
              </row>
              <row>
                <entry>P0000</entry>
                <entry>PLPGSQL ERROR</entry>
                <entry>plpgsql_error</entry>
              </row>
              <row>
                <entry>P0001</entry>
                <entry>RAISE EXCEPTION</entry>
                <entry>raise_exception</entry>
              </row>
              <row>
                <entry>P0002</entry>
                <entry>NO DATA FOUND</entry>
                <entry>no_data_found</entry>
              </row>
              <row>
                <entry>P0003</entry>
                <entry>TOO MANY ROWS</entry>
                <entry>too_many_rows</entry>
              </row>
              <row>
                <entry namest="col1" nameend="col3"><b>Class XX</b> — Internal Error</entry>
              </row>
              <row>
                <entry>XX000</entry>
                <entry>INTERNAL ERROR</entry>
                <entry>internal_error</entry>
              </row>
              <row>
                <entry>XX001</entry>
                <entry>DATA CORRUPTED</entry>
                <entry>data_corrupted</entry>
              </row>
              <row>
                <entry>XX002</entry>
                <entry>INDEX CORRUPTED</entry>
                <entry>index_corrupted</entry>
              </row>
            </tbody>
          </tgroup>
        </table>
      </body>
    </topic>
  </topic>
</topic>