DB2 using Notes

Source: Internet
Author: User
Tags db2 db2 connect db2 connect to

1. The steps to give the user load permission

Log in to the database using the instance user Db2inst1;
Use the command DB2 update dbm CFG using Sysadm_group dasadm1 to give Sysadm permissions to the Administrators user group dasadm1;
Use the command DB2 connect to DatabaseName Connection database;
Use the command DB2 grant SECADM on the database to user DASUSR1 give Secadm permission to the administrator user dasusr1;
Use the command DB2 disconnect POM_CT to disconnect the current database;
Use the command DB2 connect to DatabaseName user DASUSR1 using 123456 with the administrator user DASUSR1 connection database;
Use the command DB2 grant load on the database to user Db2inst1 give the user db2inst1 load permission;

2. Common error resolution methods

Error code 1 FIX: SET INTEGRITY for table_name IMMEDIATE CHECKED
Error code 3 FIX: LOAD from *.txt of DEL TERMINATE to table name

3. Temporarily disable foreign keys

There are three different ways

1) Set integrity for table_name off
Set integrity for TABLE_NAME FOREIGN key immediate unchecked

2) Disable: Alter TABLE <table-name> ALTER FOREIGN KEY <constraint-name> not ENFORCED
Enable: Alter TABLE <table-name> alter FOREIGN KEY <constraint-name> ENFORCED


3) Disable: ALTER TABLE TABLENAME DISABLE CONSTRAINT constraintname;
Enable: ALTER TABLE TABLENAME enable CONSTRAINT constraintname;


4. Error List and solution

1) [IBM][CLI Driver] sql30081n detected a communication error. Communication protocol in use: "TCP/IP". The communication API being used: "SOCKETS". The location of the error was detected: "172.16.2.140". The wrong communication function was detected: "Connect".  Protocol-specific error codes: "10060", "*", "*". sqlstate=08001

Solve:

Locate the Hosts file under this c:/windows/system32/drivers/etc/path and open it with Notepad

Add the IP and host name of the server host you want to connect to in the file: 127.0.0.1 localhost

2) cannot find the database alias or database name "" or the Database alias "" already exists in the local database directory or the system database directory.

Solve:

DB2 List database directory to view the system database catalog, do not see the databases you are looking for, indicating that the database is not in the system database directory

DB2 list database directory on D: (Executes the command if it is not found in the System database directory, this is the drive letter D), and then discovers the alias of sample and source. Description in the local database directory.

DB2 catalog database name on D: Cataloging the database on the node

DB2 drop DATABASE database name to delete databases

DB2 using Notes

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.