Here will tell you a few dbase:db2 common commands and skills, hope that through these commands and skills, can simplify everyone's work, improve efficiency.
1.DB2 inside the string connection can be "| |" This is connected
2. How to quickly delete a large number of data tables (test is a database table)
The most commonly used statement: Delete from Test, but it is inefficient and takes too long because the database log is logged when data is deleted.
Import from/dev/null of Del Replace into test//emptied first, then imports data (because the imported file is empty, which is equivalent to emptying the table data), this deletion is faster
ALTER table test Activate not logged initially with EMPTY table; Deletes the data in the table without logging, which is the fastest
3. Import, export data, supported files have ixf,del files
DB2 import data from a table into a file in the//db2 of "Export to Filename.del of del select * FROM tablename"
DB2 "Import from Filename.del to del INSERT INTO TableName"//db2 the data in the file into the table
Check if the table already exists in 4.DB2
SELECT * from "SYSIBM". " Systables "where lower (name) = ' Afa_maintransdtl '
5. Deal with DB2 lock table problem:
DB2 "Connect to AFA"
DB2 "Get snapshot to Locks on instance name"
DB2 "Terminate"
Then look at the relevant information, locate the locked table, and execute the following statement:
DB2 "Force application (application handle) Note: Application handle corresponds to an integer
6. When the stored procedure is created on the server:
You should specify a specific newline character for the stored procedure, and then execute the following statement:
db2-td@-VF Filename.sql (where @ is the line feed specified in the stored procedure)
7. See if the index works
Runstats on table AFA.YJ_JYWTK with distribution and detailed indexes all;
8. Intercepting database snapshots:
DB2 "Connect to Instance name"
DB2 ' Update monitor switches using lock on ' bufferpool on ' uow on ' table on ' statement on '
DB2 "Get snapshot to all" instance name