1. 程式人生 > >DB2 指令隨記

DB2 指令隨記

GRANT DBADM,CREATETAB,BINDADD,CONNECT,CREATE_NOT_FENCED_ROUTINE,IMPLICIT_SCHEMA,LOAD,CREATE_EXTERNAL_ROUTINE,QUIESCE_CONNECT,SECADM ON DATABASE  TO USER "<user>"

CREATE DATABASE <database> AUTOMATIC STORAGE YES  ON 'C:\' DBPATH ON 'C:\' USING CODESET UTF-8 TERRITORY CN COLLATE USING SYSTEM PAGESIZE 16384

CREATE  SYSTEM TEMPORARY  TABLESPACE <tablespace> PAGESIZE 16K  MANAGED BY SYSTEM  USING ('<filename>') BUFFERPOOL <buffer>

CREATE TABLESPACE <tablespace> PAGESIZE 16k MANAGED BY DATABASE USING (file '<filename>' 131072) BUFFERPOOL <buffer>

CREATE SEQUENCE <seq> AS INTEGER START WITH 10 INCREMENT BY 1 MINVALUE 10 MAXVALUE 99 CYCLE NO CACHE ORDER

IMPORT FROM "<del file>" OF DEL METHOD P (1, 2) MESSAGES "C:\1.txt" INSERT INTO <table> (ID, NAME)

CATALOG TCPIP NODE <node name> REMOTE <address> SERVER <port>

CREATE DB <database> ON 'C:\' USING CODESET GBK TERRITORY CN

CATALOG DB  <database> as <database alias> AT NODE <node name>

GRANT USE OF TABLESPACE <tablespace> to USER <username>

 ALTER TABLE <table> ALTER COLUMN ID RESTART WITH 10000

CREATE BUFFERPOOL "<name>"  SIZE 12500 PAGESIZE 16384;

CREATE BUFFERPOOL <buffer> SIZE 32768 PAGESIZE 16k

EXPORT TO "<del file>" OF DEL SELECT * FROM <table>

ALTER TABLE <table> ADD <column> VERCHAR(64)

DB2LOOK -d <database> -u <user> -e -o <file>

CONNECT TO <database> user <user>

UNCATALOG NODE <node name>

GET CONNECTION STATE

DESCRIBE TABLE <table>

LIST NODE DIRECTORY

LIST DB DIRECTORY

CONNECT RESET

DB2 -tvf <file>

TERMINATE