When 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 Object IDs (OIDs) and SQL error codes.
• Greenplum Database SNMP OIDs • SQL Standard Error Codes
For information about enabling Greenplum Database to use SNMP, see Enabling System Alerts and Notifications.
28 file_name text The internal code file where the message originated 29 file_line int The line of the code file where the message originated 30 stack_trace text Stack trace text associated with this message
Table 7.5 Greenplum Database Server Log Format
Greenplum Database SNMP OIDs and Error Codes 80 Greenplum Database System Administrator Guide 4.2 – Chapter 7: Monitoring a Greenplum System
Greenplum Database SNMP OIDs
These are the Greenplum Database SNMP Object IDs.
iso(1) identified-organization(3) dod(6) internet(1) private(4) enterprises(1) gpdbMIB(31327) gpdbObjects(1) gpdbAlertMsg(1) gpdbAlertMsg
1.3.6.1.4.1.31327.1.1: STRING: alert message text
gpdbAlertSeverity
1.3.6.1.4.1.31327.1.2: INTEGER: severity level
gpdbAlertSeverity can have one of the following values:
gpdbSevUnknown(0) gpdbSevOk(1) gpdbSevWarning(2) gpdbSevError(3) gpdbSevFatal(4) gpdbSevPanic(5) gpdbSevSystemDegraded(6) gpdbSevSystemDown(7) gpdbAlertSqlstate
1.3.6.1.4.1.31327.1.3: STRING: SQL standard error codes
For a list of codes, see SQL Standard Error Codes. gpdbAlertDetail
1.3.6.1.4.1.31327.1.4: STRING: detailed alert message text
gpdbAlertSqlStmt
1.3.6.1.4.1.31327.1.5: STRING: SQL statement generating this alert if applicable
gpdbAlertSystemName
1.3.6.1.4.1.31327.1.6: STRING: hostname
SQL Standard Error Codes
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.
Greenplum Database SNMP OIDs and Error Codes 81 Greenplum Database System Administrator Guide 4.2 – Chapter 7: Monitoring a Greenplum System
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.
Note: PL/pgSQL does not recognize warning, as opposed to error, condition names; those are classes 00, 01, and 02.
Table 7.6 SQL Error Codes
Error Code Meaning Constant
Class 00 — Successful Completion
00000 SUCCESSFUL COMPLETION successful_completion Class 01 — Warning
01000 WARNING warning
0100C DYNAMIC RESULT SETS
RETURNED
dynamic_result_sets_returne d
01008 IMPLICIT ZERO BIT PADDING implicit_zero_bit_padding 01003 NULL VALUE ELIMINATED IN
SET FUNCTION
null_value_eliminated_in_set _function
01007 PRIVILEGE NOT GRANTED privilege_not_granted 01006 PRIVILEGE NOT REVOKED privilege_not_revoked
01004 STRING DATA RIGHT
TRUNCATION
string_data_right_truncation 01P01 DEPRECATED FEATURE deprecated_feature Class 02 — No Data (this is also a warning class per the SQL standard)
02000 NO DATA no_data
02001 NO ADDITIONAL DYNAMIC
RESULT SETS RETURNED
no_additional_dynamic_resul t_sets_returned
Class 03 — SQL Statement Not Yet Complete
03000 SQL STATEMENT NOT YET
COMPLETE
sql_statement_not_yet_comp lete
Class 08 — Connection Exception
08000 CONNECTION EXCEPTION connection_exception 08003 CONNECTION DOES NOT EXIST connection_does_not_exist 08006 CONNECTION FAILURE connection_failure
08001 SQLCLIENT UNABLE TO ESTABLISH SQLCONNECTION sqlclient_unable_to_establish _sqlconnection 08004 SQLSERVER REJECTED ESTABLISHMENT OF SQLCONNECTION sqlserver_rejected_establish ment_of_sqlconnection 08007 TRANSACTION RESOLUTION UNKNOWN transaction_resolution_unkno wn
Greenplum Database SNMP OIDs and Error Codes 82 Greenplum Database System Administrator Guide 4.2 – Chapter 7: Monitoring a Greenplum System
08P01 PROTOCOL VIOLATION protocol_violation Class 09 — Triggered Action Exception
09000 TRIGGERED ACTION
EXCEPTION
triggered_action_exception Class 0A — Feature Not Supported
0A000 FEATURE NOT SUPPORTED feature_not_supported Class 0B — Invalid Transaction Initiation
0B000 INVALID TRANSACTION
INITIATION
invalid_transaction_initiation Class 0F — Locator Exception
0F000 LOCATOR EXCEPTION locator_exception
0F001 INVALID LOCATOR
SPECIFICATION
invalid_locator_specification Class 0L — Invalid Grantor
0L000 INVALID GRANTOR invalid_grantor
0LP01 INVALID GRANT OPERATION invalid_grant_operation Class 0P — Invalid Role Specification
0P000 INVALID ROLE SPECIFICATION invalid_role_specification Class 21 — Cardinality Violation
21000 CARDINALITY VIOLATION cardinality_violation Class 22 — Data Exception
22000 DATA EXCEPTION data_exception
2202E ARRAY SUBSCRIPT ERROR array_subscript_error
22021 CHARACTER NOT IN
REPERTOIRE
character_not_in_repertoire 22008 DATETIME FIELD OVERFLOW datetime_field_overflow
22012 DIVISION BY ZERO division_by_zero
22005 ERROR IN ASSIGNMENT error_in_assignment
2200B ESCAPE CHARACTER
CONFLICT
escape_character_conflict 22022 INDICATOR OVERFLOW indicator_overflow 22015 INTERVAL FIELD OVERFLOW interval_field_overflow
2201E INVALID ARGUMENT FOR
LOGARITHM
invalid_argument_for_logarit hm
2201F INVALID ARGUMENT FOR
POWER FUNCTION
invalid_argument_for_power _function
Table 7.6 SQL Error Codes
Greenplum Database SNMP OIDs and Error Codes 83 Greenplum Database System Administrator Guide 4.2 – Chapter 7: Monitoring a Greenplum System
2201G INVALID ARGUMENT FOR
WIDTH BUCKET FUNCTION
invalid_argument_for_width_ bucket_function
22018 INVALID CHARACTER VALUE FOR CAST
invalid_character_value_for_ cast
22007 INVALID DATETIME FORMAT invalid_datetime_format 22019 INVALID ESCAPE CHARACTER invalid_escape_character 2200D INVALID ESCAPE OCTET invalid_escape_octet 22025 INVALID ESCAPE SEQUENCE invalid_escape_sequence
22P06 NONSTANDARD USE OF ESCAPE CHARACTER nonstandard_use_of_escape _character 22010 INVALID INDICATOR PARAMETER VALUE invalid_indicator_parameter_ value
22020 INVALID LIMIT VALUE invalid_limit_value 22023 INVALID PARAMETER VALUE invalid_parameter_value
2201B INVALID REGULAR
EXPRESSION
invalid_regular_expression
22009 INVALID TIME ZONE
DISPLACEMENT VALUE
invalid_time_zone_displacem ent_value
2200C INVALID USE OF ESCAPE
CHARACTER
invalid_use_of_escape_char acter
2200G MOST SPECIFIC TYPE
MISMATCH
most_specific_type_mismatc h
22004 NULL VALUE NOT ALLOWED null_value_not_allowed 22002 NULL VALUE NO INDICATOR
PARAMETER
null_value_no_indicator_para meter
22003 NUMERIC VALUE OUT OF
RANGE
numeric_value_out_of_range
22026 STRING DATA LENGTH
MISMATCH
string_data_length_mismatch
22001 STRING DATA RIGHT
TRUNCATION
string_data_right_truncation
22011 SUBSTRING ERROR substring_error
22027 TRIM ERROR trim_error
22024 UNTERMINATED C STRING unterminated_c_string
2200F ZERO LENGTH CHARACTER
STRING
zero_length_character_string 22P01 FLOATING POINT EXCEPTION floating_point_exception
22P02 INVALID TEXT
REPRESENTATION
invalid_text_representation
Table 7.6 SQL Error Codes
Greenplum Database SNMP OIDs and Error Codes 84 Greenplum Database System Administrator Guide 4.2 – Chapter 7: Monitoring a Greenplum System
22P03 INVALID BINARY
REPRESENTATION
invalid_binary_representation 22P04 BAD COPY FILE FORMAT bad_copy_file_format
22P05 UNTRANSLATABLE
CHARACTER
untranslatable_character Class 23 — Integrity Constraint Violation
23000 INTEGRITY CONSTRAINT
VIOLATION
integrity_constraint_violation 23001 RESTRICT VIOLATION restrict_violation
23502 NOT NULL VIOLATION not_null_violation 23503 FOREIGN KEY VIOLATION foreign_key_violation
23505 UNIQUE VIOLATION unique_violation
23514 CHECK VIOLATION check_violation
Class 24 — Invalid Cursor State
24000 INVALID CURSOR STATE invalid_cursor_state Class 25 — Invalid Transaction State
25000 INVALID TRANSACTION STATE invalid_transaction_state 25001 ACTIVE SQL TRANSACTION active_sql_transaction
25002 BRANCH TRANSACTION
ALREADY ACTIVE
branch_transaction_already_ active
25008 HELD CURSOR REQUIRES
SAME ISOLATION LEVEL
held_cursor_requires_same_ isolation_level
25003 INAPPROPRIATE ACCESS
MODE FOR BRANCH TRANSACTION
inappropriate_access_mode _for_branch_transaction 25004 INAPPROPRIATE ISOLATION
LEVEL FOR BRANCH TRANSACTION
inappropriate_isolation_level _for_branch_transaction 25005 NO ACTIVE SQL TRANSACTION
FOR BRANCH TRANSACTION
no_active_sql_transaction_fo r_branch_transaction 25006 READ ONLY SQL TRANSACTION read_only_sql_transaction
25007 SCHEMA AND DATA
STATEMENT MIXING NOT SUPPORTED
schema_and_data_statemen t_mixing_not_supported 25P01 NO ACTIVE SQL TRANSACTION no_active_sql_transaction 25P02 IN FAILED SQL TRANSACTION in_failed_sql_transaction Class 26 — Invalid SQL Statement Name
26000 INVALID SQL STATEMENT NAME invalid_sql_statement_name Class 27 — Triggered Data Change Violation
Table 7.6 SQL Error Codes
Greenplum Database SNMP OIDs and Error Codes 85 Greenplum Database System Administrator Guide 4.2 – Chapter 7: Monitoring a Greenplum System
27000 TRIGGERED DATA CHANGE
VIOLATION
triggered_data_change_viola tion
Class 28 — Invalid Authorization Specification
28000 INVALID AUTHORIZATION
SPECIFICATION
invalid_authorization_specific ation
Class 2B — Dependent Privilege Descriptors Still Exist
2B000 DEPENDENT PRIVILEGE
DESCRIPTORS STILL EXIST
dependent_privilege_descript ors_still_exist
2BP01 DEPENDENT OBJECTS STILL
EXIST
dependent_objects_still_exist Class 2D — Invalid Transaction Termination
2D000 INVALID TRANSACTION
TERMINATION
invalid_transaction_terminati on
Class 2F — SQL Routine Exception
2F000 SQL ROUTINE EXCEPTION sql_routine_exception
2F005 FUNCTION EXECUTED NO
RETURN STATEMENT
function_executed_no_return _statement
2F002 MODIFYING SQL DATA NOT
PERMITTED modifying_sql_data_not_per mitted 2F003 PROHIBITED SQL STATEMENT ATTEMPTED prohibited_sql_statement_att empted
2F004 READING SQL DATA NOT
PERMITTED
reading_sql_data_not_permit ted
Class 34 — Invalid Cursor Name
34000 INVALID CURSOR NAME invalid_cursor_name Class 38 — External Routine Exception
38000 EXTERNAL ROUTINE EXCEPTION external_routine_exception 38001 CONTAINING SQL NOT PERMITTED containing_sql_not_permitted
38002 MODIFYING SQL DATA NOT
PERMITTED modifying_sql_data_not_per mitted 38003 PROHIBITED SQL STATEMENT ATTEMPTED prohibited_sql_statement_att empted
38004 READING SQL DATA NOT
PERMITTED
reading_sql_data_not_permit ted
Class 39 — External Routine Invocation Exception
39000 EXTERNAL ROUTINE
INVOCATION EXCEPTION
external_routine_invocation_ exception
39001 INVALID SQLSTATE RETURNED invalid_sqlstate_returned
Table 7.6 SQL Error Codes
Greenplum Database SNMP OIDs and Error Codes 86 Greenplum Database System Administrator Guide 4.2 – Chapter 7: Monitoring a Greenplum System
39004 NULL VALUE NOT ALLOWED null_value_not_allowed 39P01 TRIGGER PROTOCOL VIOLATED trigger_protocol_violated 39P02 SRF PROTOCOL VIOLATED srf_protocol_violated Class 3B — Savepoint Exception
3B000 SAVEPOINT EXCEPTION savepoint_exception
3B001 INVALID SAVEPOINT
SPECIFICATION
invalid_savepoint_specificati on
Class 3D — Invalid Catalog Name
3D000 INVALID CATALOG NAME invalid_catalog_name Class 3F — Invalid Schema Name
3F000 INVALID SCHEMA NAME invalid_schema_name Class 40 — Transaction Rollback
40000 TRANSACTION ROLLBACK transaction_rollback
40002 TRANSACTION INTEGRITY
CONSTRAINT VIOLATION
transaction_integrity_constrai nt_violation
40001 SERIALIZATION FAILURE serialization_failure
40003 STATEMENT COMPLETION
UNKNOWN
statement_completion_unkno wn
40P01 DEADLOCK DETECTED deadlock_detected
Class 42 — Syntax Error or Access Rule Violation
42000 SYNTAX ERROR OR ACCESS
RULE VIOLATION
syntax_error_or_access_rule _violation
42601 SYNTAX ERROR syntax_error
42501 INSUFFICIENT PRIVILEGE insufficient_privilege
42846 CANNOT COERCE cannot_coerce
42803 GROUPING ERROR grouping_error
42830 INVALID FOREIGN KEY invalid_foreign_key
42602 INVALID NAME invalid_name
42622 NAME TOO LONG name_too_long
42939 RESERVED NAME reserved_name
42804 DATATYPE MISMATCH datatype_mismatch
42P18 INDETERMINATE DATATYPE indeterminate_datatype
42809 WRONG OBJECT TYPE wrong_object_type
42703 UNDEFINED COLUMN undefined_column
42883 UNDEFINED FUNCTION undefined_function
42P01 UNDEFINED TABLE undefined_table
Table 7.6 SQL Error Codes
Greenplum Database SNMP OIDs and Error Codes 87 Greenplum Database System Administrator Guide 4.2 – Chapter 7: Monitoring a Greenplum System
42P02 UNDEFINED PARAMETER undefined_parameter
42704 UNDEFINED OBJECT undefined_object
42701 DUPLICATE COLUMN duplicate_column
42P03 DUPLICATE CURSOR duplicate_cursor
42P04 DUPLICATE DATABASE duplicate_database 42723 DUPLICATE FUNCTION duplicate_function
42P05 DUPLICATE PREPARED
STATEMENT
duplicate_prepared_stateme nt
42P06 DUPLICATE SCHEMA duplicate_schema
42P07 DUPLICATE TABLE duplicate_table
42712 DUPLICATE ALIAS duplicate_alias
42710 DUPLICATE OBJECT duplicate_object
42702 AMBIGUOUS COLUMN ambiguous_column
42725 AMBIGUOUS FUNCTION ambiguous_function 42P08 AMBIGUOUS PARAMETER ambiguous_parameter
42P09 AMBIGUOUS ALIAS ambiguous_alias
42P10 INVALID COLUMN REFERENCE invalid_column_reference 42611 INVALID COLUMN DEFINITION invalid_column_definition 42P11 INVALID CURSOR DEFINITION invalid_cursor_definition 42P12 INVALID DATABASE DEFINITION invalid_database_definition 42P13 INVALID FUNCTION DEFINITION invalid_function_definition
42P14 INVALID PREPARED
STATEMENT DEFINITION
invalid_prepared_statement_ definition
42P15 INVALID SCHEMA DEFINITION invalid_schema_definition 42P16 INVALID TABLE DEFINITION invalid_table_definition 42P17 INVALID OBJECT DEFINITION invalid_object_definition Class 44 — WITH CHECK OPTION Violation
44000 WITH CHECK OPTION
VIOLATION
with_check_option_violation Class 53 — Insufficient Resources
53000 INSUFFICIENT RESOURCES insufficient_resources
53100 DISK FULL disk_full
53200 OUT OF MEMORY out_of_memory
53300 TOO MANY CONNECTIONS too_many_connections Class 54 — Program Limit Exceeded
Table 7.6 SQL Error Codes
Greenplum Database SNMP OIDs and Error Codes 88 Greenplum Database System Administrator Guide 4.2 – Chapter 7: Monitoring a Greenplum System
54000 PROGRAM LIMIT EXCEEDED program_limit_exceeded 54001 STATEMENT TOO COMPLEX statement_too_complex
54011 TOO MANY COLUMNS too_many_columns
54023 TOO MANY ARGUMENTS too_many_arguments Class 55 — Object Not In Prerequisite State
55000 OBJECT NOT IN PREREQUISITE STATE
object_not_in_prerequisite_st ate
55006 OBJECT IN USE object_in_use
55P02 CANT CHANGE RUNTIME
PARAM
cant_change_runtime_param 55P03 LOCK NOT AVAILABLE lock_not_available
Class 57 — Operator Intervention
57000 OPERATOR INTERVENTION operator_intervention
57014 QUERY CANCELED query_canceled
57P01 ADMIN SHUTDOWN admin_shutdown
57P02 CRASH SHUTDOWN crash_shutdown
57P03 CANNOT CONNECT NOW cannot_connect_now Class 58 — System Error (errors external to Greenplum Database )
58030 IO ERROR io_error
58P01 UNDEFINED FILE undefined_file
58P02 DUPLICATE FILE duplicate_file
Class F0 — Configuration File Error
F0000 CONFIG FILE ERROR config_file_error
F0001 LOCK FILE EXISTS lock_file_exists
Class P0 — PL/pgSQL Error
P0000 PLPGSQL ERROR plpgsql_error
P0001 RAISE EXCEPTION raise_exception
P0002 NO DATA FOUND no_data_found
P0003 TOO MANY ROWS too_many_rows
Class XX — Internal Error
XX000 INTERNAL ERROR internal_error
XX001 DATA CORRUPTED data_corrupted
XX002 INDEX CORRUPTED index_corrupted
Table 7.6 SQL Error Codes
Routine Vacuum and Analyze 89 Greenplum Database System Administrator Guide 4.2 – Chapter 8: Routine System Maintenance Tasks
8.
Routine System Maintenance Tasks
Greenplum Database requires that certain tasks be performed regularly to achieve optimal performance. The tasks discussed here are required, but database
administrators can automate them using standard UNIX tools such as cron scripts. An administrator sets up the appropriate scripts and checks that they execute successfully. • Routine Vacuum and Analyze
• Routine Reindexing
• Managing Greenplum Database Log Files
Routine Vacuum and Analyze
Because of the MVCC transaction concurrency model used in Greenplum Database, deleted or updated data rows still occupy physical space on disk even though they are not visible to new transactions. If your database has many updates and deletes, many expired rows will exist. The VACUUM command collects table-level statistics such as number of rows and pages, so it is also necessary to vacuum append-only tables. Vacuuming append-only tables should be instantaneous since there is no space to reclaim. For details about vacuuming a database, see the Greenplum Database Database Administrator Guide.
Transaction ID Management
Greenplum’s MVCC transaction semantics depend on comparing transaction ID (XID) numbers to determine visibility to other transactions. Because transaction ID numbers have an upper limit, a Greenplum system that runs more than 4 billion transactions experiences transaction ID wraparound: the XID counter reverts to zero, and past transactions appear to be in the future. This means past transactions’ outputs become invisible. Therefore, it is necessary to VACUUM every table in every database at least once per two billion transactions.
Important: Greenplum Database monitors transaction IDs. If you do not vacuum the database regularly, Greenplum Database will generate a warning and error. Greenplum Database issues the following warning when a significant portion of the transaction IDs are no longer available and before transaction ID wraparound occurs:
WARNING: database "database_name" must be vacuumed within
number_of_transactions transactions
When the warning is issued, a VACUUM operation is required. If a VACUUM operation is not performed, Greenplum Database stops creating transactions when it reaches a limit prior to when transaction ID wraparound occurs. Greenplum Database issues this error when it stops creating transactions to avoid possible data loss:
FATAL: database is not accepting commands to avoid wraparound data loss in database "database_name"
Routine Vacuum and Analyze 90 Greenplum Database System Administrator Guide 4.2 – Chapter 8: Routine System Maintenance Tasks
The Greenplum Database configuration parameter xid_warn_limit controls when the warning is displayed. The parameter xid_stop_limit controls when Greenplum Database stops creating transactions.
Recovering from a Transaction ID Limit Error
When Greenplum Database reaches the xid_stop_limit transaction ID limit due to
infrequent VACUUM maintenance, it becomes unresponsive. To recover from this situation, perform the following steps as database administrator:
1. Shut down Greenplum Database.
2. Temporarily lower the xid_stop_limit by 10,000,000.
3. Start Greenplum Database.
4. Run VACUUM FREEZE on all affected databases.
5. Reset the xid_stop_limit to its original value.
6. Restart Greenplum Database.
For information about the configuration parameters, see the Greenplum Database Reference Guide. For information about transaction ID wraparound see the
PostgreSQL documentation.
System Catalog Maintenance
Numerous database updates with CREATE and DROP commands increase the system catalog size and affect system performance. For example, running many DROP TABLE
statements degrades the overall system performance due to excessive data scanning during metadata operations on catalog tables. The performance loss occurs between thousands to tens of thousands of DROP TABLE statements depending on the system. Greenplum recommends you regularly run a system catalog maintenance procedure to reclaim the space occupied by deleted objects. If a regular procedure has not been run for a long time, you may need to run a more intensive procedure to clear the system catalog. This section describes both procedures.
Regular System Catalog Maintenance
Greenplum recommends that you periodically run VACUUM on the system catalog to clear the space that deleted objects occupy. If regular database operations include numerous DROP statements, it is safe and appropriate to run a system catalog
maintenance procedure with VACUUM daily at off-peak hours. You can do this while the
system is available.
The following example script performs a VACUUM of the Greenplum Database system catalog:
#!/bin/bash
DBNAME="<database_name>" VCOMMAND="VACUUM ANALYZE"