List common DB2 errors and solutions for cracking

Source: Internet
Author: User
Tags db2 sql error sql error

The following articles mainly introduce common DB2 errors and solutions for these errors. The following articles mainly introduce common DB2 errors and solutions for these errors, if you are interested in the actual operations, you can click to view the following articles.

Document category: Database

DB2 common error 1. Error 42704 is reported during database creation. For example:

 
 
  1. => Create database test
  2. => SQL0204N "SYSTEM_1386_US" is an undefined name. SQLSTATE = 42704 solution:
  3. => Create database test using codeset gbk territory cn

2. A 57017 error is reported during data connection. For example:

 
 
  1. => Connect to test user test using test
  2. => SQL0332N Character conversion from the source code page "1386" to the target code page "819" is not supported. SQLSTATE = 57017 solution:
  3. => DB2 set db2codepage = 1386

DB2 common error 3. When operating the database, the error 55039 is reported. For example:

 
 
  1. =>db2 drop table t_base_acc_manageacc 
  2. =>SQL0290N Table space access is not allowed. SQLSTATE=55039 
  3. =>db2 list tablespaces show detail  
  4. Tablespace ID = 2 
  5. Name = USERSPACE1 
  6. Type = System managed space  
  7. Contents = Any data  
  8. State = 0x0020 
  9. Detailed explanation:  

Backup pending reason: the database has been loaded or modified to restart the database.

Solution:

Back up database

 
 
  1. =>db2 backup db 

4. When backing up the database, the system reports the 57019 error. For example:

 
 
  1. => Db2 backup database dbname to/xx compress
  2. > SQL1035N The database is currently in use. SQLSTATE = 57019 solution:
  3. => Db2stop force
  4. => Db2start

5. When creating a tablespace, the system reports the error 54047. For example:

 
 
  1. =>create regular tablespace space1 pagesize 4 k managed by database using (device '/dev/dd' 25000000) prefetchsize automatic bufferpool bp1 
  2. =>SQL1139N The total size of the table space is too big. SQLSTATE=54047 

Solution: Change the tablespace size to a smaller value or change regular64G to large.

6. If the DB2 backup fails and the memory is insufficient, it is useless to increase the dbheap. SQL2009C. There is not enough memory to run this utility.

Cause: DB2 UTIL_HEAP_SZ is not set high enough for backup utilities.

Solution: db2 update db cfg for dbname using UTIL_HEAP_SZ the memory used for the specific digital db2 backup is UTIL_HEAP_SZ. Use the preceding command to adjust the memory ).

DB2 common error 7. When using JDBC to insert data into tables in batches. Error 23502 is reported. For example:

Error for batch element #0: DB2 SQL error: SQLCODE:-407, SQLSTATE: 23502, SQLERRMC: TBSPACEID = 2, TABLEID = 15, COLNO = 2 cause: insert null values for fields with non-null constraints in the table.

Solution: View table definitions, remove non-null constraints, or add non-null values.

8. When you use JDBC to insert data into a table in batches. Error 22001 is reported. For example:

DB2 SQL Error: SQLCODE =-302, SQLSTATE = 22001, SQLERRMC = null reason: the length of a field in the table is insufficient and string truncation occurs.

Solution: view the table definition and increase the field length.

DB2 common error 9. When you use JDBC to insert data into a table in batches. The error "-4474" is reported. For example:

Invalid conversion: cannot begin with "java. lang. string "to" byte [] "ERRORCODE =-4474, SQLSTATE = null reason: a field in the table is defined as 'id CHAR (16) for bit data not null', which is converted to uniqueidentifier when MTK is used to migrate DATA from ms SQL to DB2 ).

Solution: recreate the table and change the field attribute to the VARCHAR type.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.