The following articles mainly describe the actual operating environment for manual addition of databases to DB2, as well as the actual operation steps for manual addition and deletion of databases to DB2, the following is a detailed description of the main content of the article. I hope you will have a better understanding of it after browsing.
Test environment: Windows XP
DB2 version information
D: DB2BIN> db2level
DB2 1085i instance "DB2" uses "32" bit and DB2 code release version "SQL09050", with the level ID "03010107 ".
Refer to "DB2 v9.5.0.808", "s071001", and "NT3295" with revision package "0 ".
The product uses the DB2 copy name "DB2COPY1" installed in "D: DB2.
D: DB2BIN> db2licm-l
Product name: "DB2 Express-C"
License type: "unsecured"
Expiry date: "permanent"
Product identifier: "db2expc"
Version info: "9.5"
Max number of CPUs: "2"
D: DB2BIN>
Create a database
Step 1: Install DB2 (omitted)
Step 2: Configure related directories
Mkdir d: db2study
Db2set DB2_CREATE_DB_ON_PATH = YES
Note: manually add a database to DB2 created by me should be stored in the d: db2study directory. Because I want to specify the database path in the create script, I need to activate the DB2_CREATE_DB_ON_PATH registry key.
Step 3: Start a DB2 instance
D: DB2BIN> db2
(C) Copyright IBM Corporation 1993,2007
DB2 client 9.5.0 command line Processor
You can issue Database Manager commands and SQL statements from a command prompt. For example:
- db2 => connect to sample
- db2 => bind sample.bnd
For general help, enter :?.
For Command help, enter :? Command, where command can be
The first few keywords of the Database Manager Command. For example:
? Catalog database is used to help with the catalog database Command
? CATALOG is used to help all CATALOG commands.
To exit the db2 interaction mode, enter QUIT at the command prompt. In non-interactive mode, all commands must be prefixed with "db2.
To LIST the settings of the current command options, enter list command options.
For more help, see Online Reference Manual.
Db2 => db2start
The DB20000I DB2START command is successfully completed.
Db2 =>
Step 4: Create a DB2 manual database
Db2 => create database study automatic storage no on 'd: db2study 'Alias study using codeset GBK territory CN collate using system pagesize 8192 catalog tabl espace managed by database using (FILE 'd: DB2studycatalog. dbf '100) user tablespace managed by database using (FILE 'd: DB2studystudy. dbf' 5120)
Temporary tablespace managed by database using (FILE 'd: DB2studytemp. dbf '2017) WITH 'Study'
The DB20000I create database Command is successfully completed.