DB2 Common Command Set

Source: Internet
Author: User
Tags configuration settings db2 switches quiesce

1. Connect Remote DB2 Server
Graphical Interface: Control Center
Note: The default installation DB2 service name is DB2C_DB2
Port 50000 when connecting using the TCP/IP protocol
Command:

Uncatalog node TestCatalog TCPIP node TEST REMOTE toone-1eb06fba5 SERVER db2c_db2 remote_instance

DB2 SYSTEM Toone-1eb06fba5 OSType WIN
TEST node Name
TOONE-1EB06FBA5 Remote server name
DB2C_DB2 as service name
DB2 Instance Name

2. Start DB2 Database
Db2start

3. Backup Database
BACKUP database command.
Instance:
--Connecting to the database
CONNECT to Jminnet;
--Pause Database
Quiesce DATABASE IMMEDIATE FORCE connections;
--Disconnect the connection
CONNECT RESET;
--Backup
Backup DATABASE jminnet to "d:/2005-10-12 backups/" with 1 buffers BUFFER 1024 PARALLELISM 1 without

prompting;
--Connecting to the database
CONNECT to Jminnet;
--Cancel the pause
Unquiesce DATABASE;
--Disconnect the connection
CONNECT RESET;

4, commonly used commands, see the IBM Development website
Connect to <dbname>
[[user <userid>] using <pwd>]


CLP Command Description
Db2start Start the Database Manager instance.
Db2stop stops the Database Manager instance.
Get dbm CFG Returns the database Manager configuration settings.
Get dbm CFG Show detail displays the current and deferred values of the Database Manager parameters (from V8).
1update dbm CFG using <p> <v> Update Database Manager configuration Parameters <p> to value <v>.
The Get instance returns the value of the DB2INSTANCE environment variable.
List Active databases lists the number of active databases and connections.
List application [Show detail] returns information about the currently connected application.
Force application (H1 [, H2,.., HN]) disconnects a particular application based on the handle number.
Force application all disconnects all applications from the database.
Attach to <node> user <userid> using <pwd> with user <userid> through the use of password <pwd> and the remote reality identified as <node> Example Connection.

Database


Create <dbname> creates a database named <dbname>.
Activate database <dbname> explicitly activates databases.
Deactivate DB <dbname> explicitly invalidates the database.
Connect to <dbname>
[[User <userid&gt] using <pwd>] explicitly connect user <userid> and password <pwd> to database <dbname> as needed.
1update dbm CFG using <p> <v> Update Database Manager configuration Parameters <p> to value <v>.
Connect reset disconnects from the current database.
Get DB CFG Show detail displays the current and deferred values of the database configuration parameters (for V8 only).
Get DB CFG for <dbname> return database <dbname> database configuration settings.
The update DB CFG for <dbname> using <p> <v> Updates database <dbname> database configuration parameters <p> to the value <v>.
List Tables[for {user | all | system | Schema <schemaname>}][show detail] lists the tables in the database. If

No parameters are specified, the default is to list the current user's table.
Describe table <tablename> displays column information for a table or view.
List tablespaces [Show detail] Displays the identity, name, type, content, and state of the tablespace.
List tablespace containers for <tablespace_id> [show detail] shows tablespace specified with <tablespace_id>

Container information.
Quiesce tablespaces for table <tablename> Reset resets the state of the table space to normal.

Connectivity of


Catalog [admin] <protocol> node ... Create an entry in the node directory for protocol <protocol>.
The list [admin] node directory returns the contents of the node catalog.
Catalog Database <dbname&gt .... Create an entry for database <dbname> in the database directory.
List database directory [on &LT;PATH&GT;] returns the contents of the Databases directory.

Performance


Get monitor switches returns the status of the session monitor switch.
Update monitor switches using <monitor> <on|off> sets the status of the session monitor switch for <monitor>.
Reset monitor all reset Performance Monitor value.
Get snapshot for dbm returns performance information at the instance level.
Get snapshot to all <dbname> returns all performance information for the database <dbname> at the database level.
Get snapshot for dynamic SQL on <dbname> returns the contents of the dynamic SQL cache.
Runstats on table <tbschema>.<tbname> collect table <tbname> statistics. The table name must be in <dbschema> fully qualified

Of
Reorgchk on table all determines whether the table needs to be reorganized. This is useful for automating runstats for all tables.
reorg table <tablename> reorganizes the tables by removing "fragmented" data and compressing the information by refactoring the rows.

Management

Export extracts the database data into a flat file.
Import imports data into a database by using the Import utility.
Load query Table <tbname>
[To Local-message-file] [NoSummary | summaryonly] [Showdelta] Returns the progress of the LOAD utility.
Backup databases <dbname> [to <path>] Perform database backups.
Restore databases <dbname> [from &LT;PATH&GT;] Perform database recovery.
Get health snapshot for dbm returns the normal snapshot information for the instance (V8 only).
Get health snapshot to all <dbname> returns all normal snapshots of database <dbname> (for V8 only).

managing Servers

Get admin cfg returns the configuration settings for the Management server.
Update admin cfg using <p> <v> update Management Server configuration parameters <p> to value <v>.

Application Development


Get routine to <filename> from [specific] procedure <routine-name>[hide the body] extracts the SQL process into

Binary Files
Put routine from <filename> [owner <newowner>[use Registers]] to deploy the SQL process from a binary file.

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.