Instance-level operations:
Start the current instance with db2start
Db2stop
Create a new instance using db2icrt
Db2idrop delete an instance
Db2ilist: displays the list of all your current instances.
DB2 get instance displays the currently running instance
Database-level operations:DB2 create database creates a new databaseDB2 drop database delete a databaseDB2 connect to DB2 create table/create vi
Tags: des style blog http color useCatalog Database:Catalog INDIRECT:DB2 Catalog Database On/db2sys[dir_name]Catalog REMOTE:DB2 catalog Database as at node Case: DB2 catalog TCPIP node Nodesun remote 192.168.1.1 server 50000 ostype Aix DB2 Catalog db sundb as SUN at node NodesunUncatalog Database:DB2 Uncatalog DatabaseThe best way to view your local database:DB2 List DB directory On/db2sys[dir_name]To cha
Db2start starting the databaseDb2stop Stop DatabaseDB2 Connect to dbname user username using pwd Connection DatabaseDB2 get dbm CFG view Database Manager configurationDB2 update dbm CFG using SVCENAME 55000 change listening portDb2ilist viewing a DB instanceDB2 list Tables list all user tablesDB2 describe table tablename display tables structureDB2 List DB directory lists all databasesDB2 list node directory lists database nodesDB2 list Active databases lists all active databasesDB2 terminate
Tags: creat specify location execute grant use ASE set NEC statementBuild Library Create db vipface using CodeSet UTF-8 on Build library to specified location Create Database on D:using codeset GBK Territory CN List all databases Database Directory Granting Dbadm permissions to users Grant on Database to User Db2admin command line execution SQL file - -CF d:\1-2. Log Connecting to a database to Vip Export Database DDL - - - -o D:\VIP_TABLE_DB2.sql Query schema for all Tables productio
Common DB2 data commandsWhen writing SQL scripts for DB2 databases, you must add ";" eg: ------------------------------------ the script starts ------------------------------; -- delete the field alter table db2inst1 In the DB2 database table. student drop column age; -- alter table db2inst1. student alter name set data type varchar (100); -- the alter table db2i
1. db2ilistDisplays the list of all current instances of the system.2. db2startStart the current instance.3. db2stopStop the current instance.4. db2icrtCreate a new instance, such as db2icrtMyinst.5. db2idrop
Deletes an instance, such as db2idrop.Myinst.6. Create a databaseCreate a database in the current running instance. You can run the following command in the DB2 command window: DB2 create databaseMydb
] On Zjt_tables (tabname);
9. View Table
Select TabName from tables
where tabname= ' zjt_tables ';
10. View Column
Select SUBSTR (colname,1,20) as column name, TYPENAME as type, length as
From columns
where tabname= ' zjt_tables ';
11. View Table Structure
DB2 describe table User1.department
DB2 describe select * FROM User.tables
12. View the index of a table
Operations under the DB2 command line CLP
Note: The Blue font indicates the variable. You can replace the value you need as appropriate.
1. Connect to the database
-Connect to dbname User Username using Password
2. List all databases
-List dB directory
-List activated databases: List active databases
3. List the database tables under the current database
-List tables
-List tables for all/system/user
-List tables whose schema is db2admin: List tables
The string connection inside the 1.DB2 is available "| |" This to connect
2. How to quickly delete large quantities of data tables (test for database tables)
The most commonly used and most frequently used statements: Delete from test, but this practice is less efficient and takes too long because the database log is remembered when data is deleted.
Import from/dev/null of Del Replace into test//first empty, then import the data (because the imported
DB2 data migration, the most commonly used is to import the export function, and the import and export of the command seemingly simple, but actually contains mystery, the ever-changing, slightly inattentive, the error is full, here on the work of the command, summed up, to share to everyone! Welcome everyone to shoot bricks enthusiastically! JOf course, before this, I think it is necessary to mention a little about the import and export basics!DEL: de
Http://hi.baidu.com/wader2006/blog/item/78406b60b51f8b47ebf8f8f0.html
DB2 Common Command Set----DB2 maintenance 2007-09-09 10:10 in the DB2 development process, the whole development process also has a very important part of the work is the maintenance of the database, for the maintenance of a huge information system is very necessary; Leave a simple maintenance
statements and run to produce results2 Dclgen automatic generation of table structures and host language definitions in different languages3 program Preparati the various parameters needed to prepare the application via multi-layer screen to complete the processPre-compile, compile, pre-connect, connect, and execute each step of the sequence4 Precompi LE Pre-compiles the source program by entering the necessary parameters in the screen5 BI Nd/rebi Nd/free bind, rebind, or release a schedule or
This article is a detailed summary of DB2 Common operation commands, to share with you. For the use of DB2 friends can refer to the following.
The DB2 database management client does not have a control center since the v9.7 version, but instead uses data Studio client. License keys are not applied during the installat
Recently has been doing database optimization this business, found themselves a lot of DB2 commands are forgotten, and even useless, and sometimes become a bottleneck in the efficiency of the work, 工欲善其事, its prerequisite, so did the following summary:1. Open the Command Line window#db2cmd2. Open the control center# Db2cmd DB2CC3. Open the Command editorDb2cmd Db2ce===== Operation Database Command =====4. S
Tables for system17. 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 *
example is as follows: db2set db2comm = NetBIOS-G.[E] indicates environment variable. Example: Export set db2comm = TCPIPAlthough most variables can be set to environment variables, we recommend that you set them to DB2 variables (using db2set)If a variable is set to multiple levels, the system determines in the following order:1. Environment Variable set using the set/export operating system commands.2.
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.