One: Platform
1:HP Server
Cpu:inter (R) Xeon (r) E5606 2.13G
Disk: Local Disk plus storage
2: Operating system
Redhet 5.4 64-bit
Kernel: 2.6.18-194.1.ax53
3: Database
db2_v9.7 x86_64
Two: Install the operating system
Put the Redhat 5.4 64-bit CD-ROM into the optical drive, if there is storage, first unplug the storage line, reload the system. Follow the prompts to install the operating system
After installation, log in as root, configure IP address and gateway
You can configure IP addresses and gateways graphically
Open Terminal: Input setup, select Network Configuration, Edit devices,eth0, configure static IP and netmask, save exit
Third: Install the DB2 database
1: Put the DB2 CD into the optical drive and execute the MOUNT/DEV/CDROM/MNT
2:CD/MNT Note: If the package in the CD is a tar.gz package, you need to create the directory first
Mkdir/db2
TAR-ZXVF ******.tar.gz-c/DB2
CD/DB2/EXPC)
3:./db2setup (Graphical installation)
4:
5: Click to install the product, one click Install, accept the terms, and then click Next
6: Select Typical installation
7: Install DB2 on this computer
8: Choose the installation directory
9: Set up DB2 Management Server account
10: Create DB2 instance
11: Set up the DB2 instance user account
12: Set up a protected account
13: Complete
14: The above DB2 is installed on the virtual machine, the version is V9.7
Four: Create a database and table the first method
1: Cancellation system, to Db2inst1 landing system
2: Open terminal execution Db2start
3: Set the DB2 boot self-starter
Su–root
Cd/opt/ibm/db2/v9.7/instance
./db2iauto-on Db2inst1
Exit
4: Open the graphical interface, perform db2cc
5: Click OK
6: Expand all ststems--machine name sequentially-–instances-–db2inst1--databases
Creating a Database
7: Enter the database name
8: Select the database file storage location, by default
9: Next step is done
10: The above is a graphical interface to create a database
11: Import script, CREATE table
Open Command Editor
Select Add, use Db2inst1 login
(Note: The database name changed, because I deleted before, and created a, can not duplicate)
Then copy the commands in the script to the box and execute the line, and remember that if you created the database, the first line in the script doesn't have to be copied because the first line of the script is to create the database.
(2) The second method
Switch to Db2inst1
Create database TestDB using CodeSet GBK territory CN
DB2 Connect to TestDB
Take Table.sql footsteps to the/OPT
Cd/opt
Cat Table.sql
Copy all content with the mouse
And then copy it under the terminal.