SoFunction
Updated on 2025-04-14

Installation of DB2 database

The db2 tutorial I am watching is: Installation of DB2 database. This is installed on the IBM RS6000 operating system for AIX, similar to HP9000

1. Register as a user with super user permissions (root)
2. Insert the software CD marked "DB2 General 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.
Enter the following command to allocate the CD-ROM file system:
# smitty storage 
4. Select the 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 item 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 might be /dev/cd0.
11. Enter the value in the Installation Directory field. For example, this value might be /cdrom.
12. Set the installation as read-only system to Yes.
13. Click OK.
14. cd /cdrom  
15. Enter the ./db2setup command to start the DB2 installer. The Installation DB2 V6 window opens.
16. Press the Tab key to change the highlighted options, and press the Enter key to select or deselect the options.
(1) Install on the server, generally choose to install the following three products:
Note: To display the components of the DB2 product you want to install, select Custom. To return to the previous window at any time, select Cancel.
 DB2 Administration Client 
Choose to customize and install this product,
 DB2 UDB enterprise edition  
Choose to customize and install this product,
 DB2 Software Developer Kit  
If you are doing development at the same time, you need to customize and install this product.
(2) Only select the Chinese language ZH_CN support in "DB2 Product Information" and "DB2 Product Library".
17. After confirmation in step 16, the database program will be installed. During the installation process, the following issues need to be confirmed:
(1) Whether to establish a DB2 management account, generally choose to establish:
Create db2 management user db2as by default (using the default UID, Group Id, and installing home path), in terms of language support,
Only select the Chinese language ZH_CN support.
(2) Whether to create an instance of DB2, generally choose to create:
 Create db2 management user db2inst1:db2iadm1 according to the default (using the default UID, Group Id, installation home path),
In terms of language support, only the Chinese language ZH_CN support is selected.
 Create db2 user db2fenc1:db2fenc1 (using the default UID, Group Id, installation home path),
In terms of language support, only the Chinese language ZH_CN support is selected.
 Whether to establish a sample database (In order to check whether the database installation is correct, it is generally chosen to establish a sample database)
 Whether to select the instance process of DB2 to automatically perform initialization when the operating system starts.
If installed on a standalone server, you can choose autostart, but in a dual-machine shared environment of aix+hacmp+db2, do not choose
autostart, the startup of the DB2 instance process is controlled by 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 the establishment of an instance and the management account during the installation process, you can use the command to create an instance (db2icrt) after the installation is completed.
Or to create or add a new instance, "Management Server" or other DB2 products and components, enter the following command:
/usr/lpp/DB2_06_01/install/DB2setup 
19. Verify the installation
If you do not choose to create a sample database during installation, you can create a SAMPLE database through the command (db2sampl) after the installation is completed.
And verify the installation by connecting to the database using a command line processor:
(1) Register with the system as a user with System Management (SYSADM) permission. For example: db2inst1
(2) Enter the DB2sampl command to create a SAMPLE database.
(3) When creating a SAMPLE database, use the database alias SAMPLE to automatically catalog it.
(4) Enter the DB2start command to start the database management program.
(5) Enter the following command to connect to the SAMPLE database, retrieve the 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, the SAMPLE database can be removed to free up disk space. Enter the DB2 drop database sample command
Come and uninstall the SAMPLE database.

   

  

If the DB2 tool has not been installed yet, you can create a SAMPLE database and use the command line processor to connect with the database.
Connect to verify the installation, as shown below:
Step 1.
Register with the system as a user with System Management (SYSADM) permission.

Step 2.
Enter the db2sampl command to create a SAMPLE database.


When creating a SAMPLE database, use the database alias SAMPLE to automatically catalog it.

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

Step 4.
Enter the following command to connect to the SAMPLE database, &

[1] [2] Next page

The db2 tutorial I am watching is: Installation of DB2 database. nbsp;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, it is proved that the installation of the DB2 UDB database server has been successfully completed.

   

  

Previous page  [1] [2]