IBM's Universal Database
Installing DB2 is made easy by an installation and setup utility called DB2 Installer. This utility will install all required packages for DB2, create instances for DB2 databases and administration support, and configure your DB2 server for communications. The instructions in this section assume you do not change any of the defaults presented by DB2 Installer, unless noted in the steps below.
You will usually run into display problems if you start DB2 Installer from a command window in your Linux distribution's graphical interface. You can refresh the view of DB2 Installer at any time by pressing CTRL-L. To avoid most potential display problems, I recommend running the DB2 Installer in a virtual console session outside of your operating system's graphical interface. You can shift between the virtual console session and the graphical interface session on most Linux distributions by pressing CTRL-ALT-F1 and CTRL-ALT-F7. Refer to your Linux documentation for more details.
To quickly install DB2, perform the following steps:
Log on to the system as a user with root authority
Mount the DB2 product CD-ROM by entering the following command:
mount -t iso9660 -o ro /dev/cdrom /mnt/cdrom
where /mnt/cdrom is the mount point of the CD-ROM. Note that even if you are installing DB2 on a workstation that is running TurboLinux version 3.6 or Red Hat Linux version 6.1, you still need to mount the CD-ROM. The image created by the install fix links to the DB2 CD-ROM. For more information, refer to your fix's readme.txt file.
Change focus to the mount point of the CD-ROM. Note that if you were installing DB2 on a workstation that is running TurboLinux version 3.6 or Red Hat Linux version 6.1, you would change to the directory where you created the image on your workstation. For more information, refer to your fix's readme.txt file.
Enter the ./db2setup command to start the DB2 Installer program. The Install DB2 V6.1 window will open. The contents of this window vary with respect to the DB2 product you are installing. Figure 1 is the window displayed when you are installing DB2 Workgroup Edition for Linux.
tab key to move the selector bar, and the ENTER key to select or deselect an option. For more information or assistance during the installation of DB2, select Help. From the product list, select the DB2 product you want to install. For this example, select DB2 UDB Workgroup Edition, then OK. The Create DB2 Services window will open.
Select the “Customize” option beside the DB2 product you want to install. For our example, select the “Customize” option beside the DB2 UDB Workgroup Edition option.
Select the “Java Support” and the “Control Center” components.
Select the “Create a DB2 Instance” option. Enter a password for this user and verify it by retyping this password in the field provided.
Select the “Properties” option.
Select the “Create a Sample Database” for a DB2 instance then OK.
A window will open that asks you to create a user that will be used to execute user-defined functions (UDFs) and stored procedures. For this example, you do not need to know anything about, or use, this user. Simply enter a password for this user, verify it and select OK. You are returned to the DB2 Create Services window. For more information on UDFs or stored procedures, refer to the “Administration Guide”.
Select the “Create the Administration Server” option. Enter a password for this user as well and select OK.
A pop-up window will open telling you the DB2 system's name for this workstation. Select OK. You are again returned to the Create DB2 Services window.
Select OK, then Continue, and finally, OK to begin the installation. When the installation completes, respond to the DB2 Installer's prompts to close this utility.
You are finished all the steps necessary to install DB2!
Now that you have finished your installation, let's go through a quick sample query to prove to you that this powerful database is actually alive and running on your system.
To verify your installation, perform the following steps:
Log on to the system as the db2inst1 user. If you use the su command to do this, ensure that you enter this command with the - option; for example, su - db2inst1.
Enter the following command to connect to the sample database created by DB2 Installer:
db2 connect to sample
You should receive output that is similar to the following:
Database Connection Information Database server = DB2/LINUX 6.1.0 SQL authorization ID = DB2INST1 Local database alias = SAMPLE
Enter the following command to select a list of all employees who belong to department 20 in the staff table:
db2 "select * from staff where dept = 20"
Note that you must enter this command using the quotation marks so that your operating system does not confuse the SQL statement with a command. You should receive output that is similar to that shown in Table 1.
End the database connection by entering the following command: db2 terminate.
|Using Salt Stack and Vagrant for Drupal Development||May 20, 2013|
|Making Linux and Android Get Along (It's Not as Hard as It Sounds)||May 16, 2013|
|Drupal Is a Framework: Why Everyone Needs to Understand This||May 15, 2013|
|Home, My Backup Data Center||May 13, 2013|
|Non-Linux FOSS: Seashore||May 10, 2013|
|Trying to Tame the Tablet||May 08, 2013|
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- RSS Feeds
- New Products
- Using Salt Stack and Vagrant for Drupal Development
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- Home, My Backup Data Center
- Validate an E-Mail Address with PHP, the Right Way
- New Products
- Tech Tip: Really Simple HTTP Server with Python
- Ahh, the Koolaid.
4 hours 52 min ago
- git-annex assistant
10 hours 52 min ago
- direct cable connection
11 hours 14 min ago
- Agreed on AirDroid. With my
11 hours 24 min ago
- I just learned this
11 hours 29 min ago
11 hours 59 min ago
- not living upto the mobile revolution
14 hours 50 min ago
- Deceptive Advertising and
15 hours 25 min ago
- Let\'s declare that you have
15 hours 26 min ago
- Alterations in Contest Due
15 hours 27 min ago
Enter to Win an Adafruit Prototyping Pi Plate Kit for Raspberry Pi
It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Prototyping Pi Plate Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- Next winner announced on 5-21-13!
Free Webinar: Linux Backup and Recovery
Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.
In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.