Installation of the DB2 database

Source: Internet
Author: User
Tags db2 db2 connect db2 connect to

This is installed on the IBM RS6000 operating system for AIX and is identical on HP9000

1. Register as a user with superuser privileges (root)
2. Insert the software CD labeled "DB2 Common Database Enterprise Edition" into the drive
3. Enter the following command to create a directory to install the CD-ROM:
# Mkdir-p/cdrom where CDROM represents the CD-ROM installation directory.
Assign the CD-ROM file system by entering the following command:
# Smitty Storage
4. Select File System
5. Select Add/Change/show/delete file system
6. Select CDROM File System
7. Select Add CDROM file system
8. In the pop-up window, enter the following as the installation point:
/cdrom
9. Install the CD-ROM file system by entering the following command: Smit mountf
10. Enter a value in the File System Name field. For example, the name may be/dev/cd0.
11. Enter a value in the Installation directory field. For example, this value may be/cdrom.
12. Set the install as read-only system to Yes.
13. Click OK.
Cd/cdrom
15. Enter the./db2setup command to start the DB2 Setup program. The Install DB2 V6 window opens.
16. Press the TAB key to change the highlighted option, and press ENTER to select or deselect options.
(1) installed on the server, generally choose to install the following three products:
Note: To display the parts of the DB2 product you want to install, choose Custom. To return to the previous window at any time, select Cancel.
DB2 Administration Client
Choose Custom Install this product,
DB2 UDB Enterprise Edition
Choose Custom Install this product,
DB2 Software Developer Kit
If you do development at the same time, you need to customize the installation of this product.
(2) in the "DB2 Product Information" and "DB2 Product Library" only select the Chinese language ZH_CN support.
17. After 16 steps are confirmed, the database program will begin to be installed. During the installation process, you also need to confirm the following issues:
(1) Whether the establishment of DB2 management account, the general choice to establish:
By default, DB2 manages user db2as (using the default Uid,group Id, installing the Home Path), and on language support,
Select only Chinese language ZH_CN support.
(2) Whether to establish DB2 examples, the general choice to establish:
 Establish DB2 management user DB2INST1:DB2IADM1 by default (using the default Uid,group Id, install the home path),
For language support, select only the Chinese language ZH_CN support.
 Establish the DB2 user DB2FENC1:DB2FENC1 by default (using the default Uid,group Id, install the home path),
For language support, select only the Chinese language ZH_CN support.
 Whether to establish sample database (in order to check the database installation is correct, generally choose to establish sample database)
 Select DB2 instance process to automatically initialize when the operating system starts
If you are installing on a stand-alone server, you can choose Autostart, but in a AIX+HACMP+DB2 shared environment, do not select
AUTOSTART,DB2 the start of the instance process, controlled by the hacmp.

18. Installation Results:
After the database program is installed, the DB2 software program is installed in the/USR/LPP directory,
Db2dir =/usr/lpp/db2_06_01
Note: If you do not specify an instance and an administrative account during installation, you can use the command to create an instance (DB2ICRT) after the installation is complete.
Or to create or add new instances, manage servers, or other DB2 products and parts, enter the following command:
/usr/lpp/db2_06_01/install/db2setup
19. Verifying Installation
If you do not choose to set up the sample database at installation time, you can create the sample database by command (DB2SAMPL) after the installation is complete.
and verify the installation by connecting to the database by using a command-line processor:
(1) To register with the system as a user with System Management (SYSADM) privileges. such as: Db2inst1
(2) Enter the Db2sampl command to create the SAMPLE database.
(3) When creating a sample database, catalog it automatically with database alias sample.
(4) Enter the Db2start command to start the database management program.
(5) Enter the following command to connect to the SAMPLE database, retrieve a list of all employees working in department 20, and reset the database connection:
DB2 Connect to sample
DB2 "SELECT * FROM staff where dept = 20"
DB2 Connect Reset
Note: After verifying the installation, you can drop the SAMPLE database to free up disk space. Enter DB2 drop Database sample command
To remove the SAMPLE database.





If the DB2 tool is not already installed, you can create a SAMPLE database and use the command line processor with the database
Connect to verify the installation as follows:
Step 1.
Registers with the system as a user with system administration (SYSADM) permissions.

Step 2.
Enter the Db2sampl command to create the SAMPLE database.


When you create a sample database, catalog it automatically with database alias sample.

Step 3.
Enter the Db2start command to start the database management program.

Step 4.
Enter the following command to connect to the SAMPLE database, retrieve a list of all employees working in department 20, and reset the database connection:

DB2 Connect to sample
DB2 "SELECT * FROM staff where dept = 20"
DB2 Connect Reset

If all the above commands are executed correctly, the installation of the DB2 UDB database server has been successfully completed.

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.