DB2 clearing the database sequence cacheAlter sequence wfr.wfr_bill_histories_s NoCache;Create a script that empties all table dataSelect ' ALTER TABLE ' | | RTRIM (Tabschema) | | tabname| | ' Activate not the logged initially with empty table; ' from syscat.tables where type = ' T ' and Tabschema not in (' SYS IBM ', ' systools '); Generate statements that delete all foreign keysSELECT' ALTER TABLE ' | | tabschema| | '. ' | | SUBSTR (tabname,1,50) |
20
DB2 Update DB CFG for Btpdbs using LOGFILSIZ 5120
After the change is completed, the following command should be executed to make it effective:
DB2 stop
DB2 start
Add:
DB2 Set schema BTP modify the current mode to "BTP"
DB2 List tablespaces Show Detail view current data
from TAB76.IXF of Ixf Commitcount, insert into Achact"DB2 "CREATE table achact_t like Achact"DB2 "Rename table achact_t to Achact"DB2 "INSERT INTO achact_t select * from Achact where txndt>= (select Lstpgdt fromAcmact where Actno=achact.actno) "DB2 get snapshot for Dynaimic SQL
1. Open the command line window
# Db2cmd
2. Open the Control Center
# Db2cmd db2cc
3. Open the command editor.
Db2cmd db2ce
===== Operation database commands ====
4. Start a database instance# Db2start
5. Stop a database instance# Db2stop
If you cannot stop the database because of the activated connection, you can run DB2 force application all before running db2stop force.6. Create a database#
specific user tables#db2 list tables for schema [user]19. Create a new table (T1) with the same structure as a table (T2) in the database#db2 CREATE table T1 like T220. Import data from one table T1 to another table T2#db2 "INSERT INTO T1 select * from T2"21. Enquiry Form#db2 "SELECT * from table name where ..."22. Di
specific user tables#db2 list tables for schema [user]19. Create a new table (T1) with the same structure as a table (T2) in the database#db2 CREATE table T1 like T220. Import data from one table T1 to another table T2#db2 "INSERT INTO T1 select * from T2"21. Enquiry Form#db2 "SELECT * from table name where ..."22. Di
. List User Tables#db2 List Tables for user18. List specific user tables#db2 list tables for schema [user]19. Create a new table (T1) with the same structure as a table (T2) in the database#db2 CREATE table T1 like T220. Import data from one table T1 to another table T2#db2 "INSERT INTO T1 select * from T2"21. Enquiry
If you are familiar with the DB2 database, you must first understand and master the basic commands of the DB2 database. This article provides you with some frequently used commands for your reference, hope to help you.
Dasauto-automatically starts the DB2 Management Server
public 35. Mode Privileges GRANT Createin on SCHEMA schema-name to USER 36. Database Privileges Grant Connect,createtab,dbadm on the database to user 37. Indexing Privileges Grant control on index index-name to user 38. Information Help (? XXXNNNNN) Cases:? SQL30081 SQL Help (Description of SQL statement syntax) Help statement For example, the Help SELECT SQLSTATE help (stating the status and category Code
Operation commands in the db2 database
Common DB2 commands. For more information about using db2, see. The management Client no longer has a control center after v9.7, but uses the Data Studio Client. The license key is not applied during the installation of the
generate a batch file
Document: temp. SQL
Select 'runstats on table DB2. '| tabname |'
With distribution and detailed indexes all ;'
From syscat. tables where tabschema = 'db2 'and type = 'T ';
Db2-tf temp. SQL> runstats. SQL
17.
Common DB2 commands
Common DB2 commandsI. Basics1. db2 connect to Db2 connect to 2. db2 force application all -- force all applications to disconnect the database3. db2 backup db db2nam
other functions SQL Server Oracle DB2
Length Len () length ()
Substring () substr ()
1.2
Appendix
1.2.1 db2v8.
1 Common commands
■ Create a database and execute DB2 create dB oatemp on the server
■ Delete the database and execute DB2 drop dB oatemp on the server
■ Create a
1. Disable DB2Db2stop or db2stop force.In the script, write both of them to avoid using the db2stop force command, for example:Db2stopDb2stop force2. Start DB2Db2start3. view the local node directoryDB2 list node directory4. cataloguing a TCP/IP NodeDB2 catalog TCPIP node 5. node CataloguingDB2 catalog TCP node node_name remote server_ip server server_port6. node deserializationDB2 uncatalog node node_name7. Cancel node CataloguingDB2 uncatalog node 8. Test node attachmentDB2 attach to node_name
"SELECT * from Puser where brhid= ' 907020000 ' and oprid= ' 0001 '"DB2 "Select OPRID,OPRNM,BRHID,PASSWD from Puser"Iv. Delete data from the table:DB2 "Delete from Puser where brhid= ' 907020000 ' or brhid= ' 907010000 '"Five, modify the table data:DB2 "Update svmmst set prtlines=0 where brhid= ' 907010000 ' and joww= ' 02 '"Vi. joining the databaseDB2 Connect to SpdbVII. Clearing Database joinsDB2 Connect reset Disconnects the databaseDB2 Terminate
® database developers or administrators. You should have a basic understanding of how UNIX or Windows command-line shells are used, and you should know the basics of DB2 and SQL commands.
System Requirements
The examples in this tutorial apply to DB2 9.5, which runs on the Windows operating system. The concepts and i
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.