db2--command windows and command-line processors

Source: Internet
Author: User
Tags db2 db2 client db2 connect db2 connect to ldap switches quiesce
The DB2 command window and the command line processor are actually generated by the CMD command window, and the specific differences are as follows

Correspondence between menus and executable files
D: \ Program Files \ IBM \ SQLLIB \ BIN \
DB2 command window-Administrator <----> db2cwadmin.bat
DB2 command window <----> DB2CW.BAT
The DB2 command line processor <----> The DB2CMD.exe parameters are:
DB2 Command Line Processor Enhanced <----> clpplus.bat

Environment variables added by DB2
D: \ PROGRA ~ 1 \ IBM \ SQLLIB \ BIN; D: \ PROGRA ~ 1 \ IBM \ SQLLIB \ FUNCTION; D: \ PROGRA ~ 1 \ IBM \ SQLLIB \ SAMPLES \ REPL

DB2 command window
Also known as db2 non-interactive mode. The role is to switch to the BIN directory of DB2, you can directly execute the executable files (exe, bat, etc.) under D: \ Program Files \ IBM \ SQLLIB \ BIN \
In fact, the DB2 command window is the result of the windos CMD window switching to the DB2 BIN directory.
Because DB2 automatically sets environment variables during installation, the commands related to db2 executed by the CMD window are equivalent to the commands executed by the DB2 command window
The commands that can be executed are:
Operating system commands, such as DIR, TREE
All executable files in the BIN directory, such as db2start, db2stop
db2-command commands (require db2 and spaces before these commands), such as db2 connect to sample, db2 list tables for schema "current user name"


DB2 command window-Administrator
It has the same role as the DB2 command window. It adds an administrator front. Generally, when the front window prompts permission problems, use this window instead.
The commands that can be executed are the same as above


DB2 command line processor
It is also called db2 interactive mode, which is equivalent to typing db2 in the DB2 command window or CMD window and pressing Enter. One advantage of the interactive mode is that all the commands that need to start with db2 do not need to start with db2.
This is very similar to the sqlplus of the Oracle database. If you need to exit the interactive mode, type QUIT and press Enter.
The commands that can be executed are the db2-command command and some commands in the bin directory. The specific db2-command command can be viewed by pressing Enter.
The result is as follows

 

  (c) Copyright IBM Corporation 1993, 2007
  Command line processor for DB2 client 10.5.5
   
  You can issue database manager commands and SQL statements from a command prompt. E.g:
  db2 => connect to sample
  db2 => bind sample.bnd
   
  For general help, enter:?.
  To get command help, enter:? Command, where command can be
  The first few keywords of the database manager command. E.g:
  CATALOG DATABASE for help on the CATALOG DATABASE command
  CATALOG is used for help on all CATALOG commands.
   
  To exit db2 interactive mode, enter at a command prompt
  QUIT. In non-interactive mode, all commands must be prefixed with "db2".
  To list the current command option settings, enter LIST COMMAND OPTIONS.
   
  For more detailed help, see the Online Reference Manual.
   
  db2 =>?
  ACTIVATE DATABASE GET CONTACTS REFRESH LDAP
  ADD CONTACT GET / UPDATE DB CFG REGISTER LDAP
  ADD CONTACTGROUP GET / UPDATE DBM CFG REGISTER XMLSCHEMA
  ADD DBPARTITIONNUM GET DBM MONITOR SWITCHES REGISTER XSROBJECT
  ADD XMLSCHEMA GET DESCRIPTION FOR HEALTH REORG INDEXES / TABLE
  ARCHIVE LOG GET NOTIFICATION LIST REORGCHK
  ATTACH GET HEALTH SNAPSHOT RESET ADMIN CFG
  AUTOCONFIGURE GET INSTANCE RESET ALERT CFG
  BACKUP DATABASE GET MONITOR SWITCHES RESET DB CFG
  BIND GET RECOMMENDATIONS RESET DBM CFG
  CATALOG APPC NODE GET ROUTINE RESET MONITOR
  CATALOG APPN NODE GET SNAPSHOT RESTART DATABASE
  CATALOG DATABASE HELP RESTORE DATABASE
  CATALOG DCS DATABASE HISTORY REWIND TAPE
  CATALOG LDAP DATABASE IMPORT ROLLFORWARD DATABASE
  CATALOG LDAP NODE INITIALIZE TAPE RUNCMD
  CATALOG LOCAL NODE INSPECT RUNSTATS
  CATALOG NPIPE NODE LIST ACTIVE DATABASES SET CLIENT
  LIST COMMAND OPTIONS LIST APPLICATIONS SET RUNTIME DEGREE
  CATALOG ODBC DATA SOURCE LIST DATABASE DIRECTORY SET TABLESPACE CONTAINERS
  CATALOG TCPIP NODE LIST DB PARTITION GROUPS SET TAPE POSITION
  CHANGE DATABASE COMMENT LIST DBPARTITIONNUMS SET UTIL_IMPACT_PRIORITY
  CHANGE ISOLATION LEVEL LIST DCS APPLICATIONS SET WRITE
  COMPLETE XMLSCHEMA LIST DCS DIRECTORY START DATABASE MANAGER
  CREATE DATABASE LIST DRDA INDOUBT START HADR
  CREATE TOOLS CATALOG LIST HISTORY STOP DATABASE MANAGER
  DEACTIVATE DATABASE LIST INDOUBT TRANSACTIONS STOP HADR
  DECOMPOSE XML DOCUMENT LIST NODE DIRECTORY TAKEOVER HADR
  DECOMPOSE XML DOCUMENTS LIST ODBC DATA SOURCES TERMINATE
  DEREGISTER LIST PACKAGES / TABLES UNCATALOG DATABASE
  DESCRIBE LIST TABLESPACE CONTAINERS UNCATALOG DCS DATABASE
  DETACH LIST TABLESPACES UNCATALOG LDAP DATABASE
  DROP CONTACT LIST UTILITIES UNCATALOG LDAP NODE
  DROP CONTACTGROUP LOAD UNCATALOG NODE
  DROP DATABASE LOAD QUERY UNCATALOG ODBC DATA
  DROP DBPARTITIONNUM PING UNQUIESCE DATABASE
  DROP TOOLS CATALOG PREP / PRECOMPILE UNQUIESCE INSTANCE
  ECHO PRUNE HISTORY / LOGFILE UPDATE ALERT CFG
  EDIT PUT ROUTINE UPDATE COMMAND OPTIONS
  EXPORT QUERY CLIENT UPDATE CONTACT
  FORCE APPLICATION QUIESCE DATABASE UPDATE CONTACTGROUP
  GET / UPDATE ADMIN CFG QUIESCE INSTANCE UPDATE NOTIFICATION LIST
  GET ALERT CFG QUIESCE TABLESPACES UPDATE HISTORY
  GET / UPDATE CLI CFG QUIT UPDATE LDAP NODE
  GET CONNECTION STATE REBIND UPDATE MONITOR SWITCHES
  GET CONTACTGROUP RECOVER UPGRADE DATABASE
  GET CONTACTGROUPS REDISTRIBUTE DB PARTITION XQUERY
   
   
   
  Note: Some commands are operating system specific and may not be available.
   
  For further help:
  ? db2-command-Help on the specified command
  OPTIONS-help on all command options
  HELP-help on reading the help screen
  The first three options can be run as db2 <option> at the operating system prompt.
   
  ! db2ic-DB2 Information Center (Windows only)
  This command can also be run as db2ic from the operating system prompt.
  db2 =>

DB2 command line processor enhanced
Enter SQL interactive mode and execute limited commands. Specific commands can be viewed through HELP INDEX
The result is as follows

 

  CLPPlus: version 1.6
  Copyright (c) 2009, 2011, IBM CORPORATION. All rights reserved.
   
   
  SQL> HELP INDEX
   
   
  INDEX
  -------
   
  Please enter "HELP [topic]" for command line help.
   
  @ ACCEPT APPEND BREAK
  BTITLE CHANGE CLEAR CLPPLUS
  COLUMN COMPUTE CONNECT COPY
  CURRENT_SCHEMA DEFINE DEL DESCRIBE
  DISCONNECT EDIT EXECUTE EXIT
  EXPLAIN EXPORT GET GET_DBM_CFG
  GET_DB_CFG HELP HOST IMPORT
  INDEX INPUT LIST LOAD
  PASSWORD PAUSE PRINT PROMPT
  QUIT REMARK REORG REORGCHK
  REPFOOTER REPHEADER RESET_DBM_CFG RESET_DB_CFG
  RUNSTATS SAVE SERVEROUTPUT SET
  SHOW SPOOL START TTITLE
  UNDEFINE UPDATE_DBM_CFG UPDATE_DB_CFG VARIABLE
  WHENEVER
   
   
  SQL>

The command editor has been removed in DB2 10 (the command editor was originally a graphical interface for DB2 9 and previous versions). The new version recommends installing Data Studio to manage

DB2-command window and command line processor
Related Article

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.