环境:
DB2 V9.1
Windows XP Professional CN
准备工作:
进入DB2命令行控制处理器,输入db2
C:\DB291\IBM\SQLLIB\BIN>db2
(c) Copyright IBM Corporation 1993,2003
DB2 ADCL 9.1.0 的命令行处理器
可从命令提示符处发出数据库管理器命令和 SQL 语句。例如:
??? db2 => connect to sample
??? db2 => bind sample.bnd
要获得一般帮助,输入:?。
要获得命令帮助,输入:? command,其中 command 可以是
数据库管理器命令的前几个关键字。例如:
? CATALOG DATABASE 用于关于 CATALOG DATABASE 命令的帮助
? CATALOG????????? 用于关于所有 CATALOG 命令的帮助。
要退出 db2 交互方式,在命令提示符处输入
QUIT。在非交互方式下,所有命令都必须以“db2”作前缀。
要列出当前命令选项设置,输入 LIST COMMAND OPTIONS。
要获取更详细的帮助,请参阅 Online Reference Manual。
db2 =>
查看命令:
一、查看所有命令:
db2 => ?
ACTIVATE DATABASE??????? GET CONTACTS?????????????? RECOVER
ADD CONTACT????????????? GET/UPDATE DB CFG????????? REDISTRIBUTE DB PARTITION
ADD CONTACTGROUP???????? GET/UPDATE DBM CFG???????? REFRESH LDAP
ADD DATALINKS MANAGER??? GET DBM MONITOR SWITCHES?? REGISTER LDAP
ADD DBPARTITIONNUM?????? GET DESCRIPTION FOR HEALTH REGISTER XMLSCHEMA
ADD XMLSCHEMA??????????? GET NOTIFICATION LIST????? REGISTER XSROBJECT
ARCHIVE LOG????????????? GET HEALTH SNAPSHOT??????? REORG INDEXES/TABLE
ATTACH?????????????????? GET INSTANCE?????????????? REORGCHK
AUTOCONFIGURE??????????? GET MONITOR SWITCHES?????? RESET ADMIN CFG
BACKUP DATABASE????????? GET RECOMMENDATIONS??????? RESET ALERT CFG
BIND???????????????????? GET ROUTINE??????????????? RESET DB CFG
CATALOG APPC NODE??????? GET SNAPSHOT?????????????? RESET DBM CFG
CATALOG APPN NODE??????? HELP?????????????????????? RESET MONITOR
CATALOG DATABASE???????? HISTORY??????????????????? RESTART DATABASE
CATALOG DCS DATABASE???? IMPORT???????????????????? RESTORE DATABASE
CATALOG LDAP DATABASE??? INITIALIZE TAPE??????????? REWIND TAPE
CATALOG LDAP NODE??????? INSPECT??????????????????? ROLLFORWARD DATABASE
CATALOG LOCAL NODE?????? LIST ACTIVE DATABASES????? RUNCMD
CATALOG NPIPE NODE?????? LIST APPLICATIONS????????? RUNSTATS
CATALOG NETBIOS NODE???? LIST COMMAND OPTIONS?????? SET CLIENT
CATALOG ODBC DATA SOURCE LIST DATABASE DIRECTORY??? SET RUNTIME DEGREE
CATALOG TCPIP NODE?????? LIST DB PARTITION GROUPS?? SET TABLESPACE CONTAINERS
CHANGE DATABASE COMMENT? LIST DATALINKS MANAGERS??? SET TAPE POSITION
CHANGE ISOLATION LEVEL?? LIST DBPARTITIONNUMS?????? SET UTIL_IMPACT_PRIORITY
COMPLETE XMLSCHEMA?????? LIST DCS APPLICATIONS????? SET WRITE
CREATE DATABASE????????? LIST DCS DIRECTORY???????? START DATABASE MANAGER
CREATE TOOLS CATALOG???? LIST DRDA INDOUBT????????? START HADR
DEACTIVATE DATABASE????? LIST HISTORY?????????????? STOP DATABASE MANAGER
DECOMPOSE XML DOCUMENT?? LIST INDOUBT TRANSACTIONS? STOP HADR
DEREGISTER?????????????? LIST NODE DIRECTORY??????? TAKEOVER
DESCRIBE???????????????? LIST ODBC DATA SOURCES???? TERMINATE
DETACH?????????????????? LIST PACKAGES/TABLES?????? UNCATALOG DATABASE
DROP CONTACT???????????? LIST TABLESPACE CONTAINERS UNCATALOG DCS DATABASE
DROP CONTACTGROUP??????? LIST TABLESPACES?????????? UNCATALOG LDAP DATABASE
DROP DATABASE??????????? LIST UTILITIES???????????? UNCATALOG LDAP NODE
DROP DATALINKS MANAGER?? LOAD?????????????????????? UNCATALOG NODE
DROP DBPARTITIONNUM????? LOAD QUERY???????????????? UNCATALOG ODBC DATA
DROP TOOLS CATALOG?????? MIGRATE DATABASE?????????? UNQUIESCE DATABASE
ECHO???????????????????? PING?????????????????????? UNQUIESCE INSTANCE
EDIT???????????????????? PREP/PRECOMPILE??????????? UPDATE ALERT CFG
EXPORT?????????????????? PRUNE HISTORY/LOGFILE????? UPDATE COMMAND OPTIONS
FORCE APPLICATION??????? PUT ROUTINE??????????????? UPDATE CONTACT
GET/UPDATE ADMIN CFG???? QUERY CLIENT?????????????? UPDATE CONTACTGROUP
GET ALERT CFG??????????? QUIESCE DATABASE?????????? UPDATE NOTIFICATION LIST
GET AUTHOR