Downloading and installing Db2 Developer Community Edition on Ubuntu Linux Roger E. Sanders Yujing Ke Published on October 24, 2018

Similar documents
Downloading and installing Db2 Developer Community Edition on Red Hat Enterprise Linux Roger E. Sanders Yujing Ke Published on October 24, 2018

Downloading and installing Db2 Developer-C on Red Hat Enterprise Linux Roger E. Sanders Yujing Ke Published on October 23, 2018

Tensorflow/SyntaxNet. Installation Guide

Ubuntu LTS Install Guide

Infoblox Kubernetes1.0.0 IPAM Plugin

Linux Essentials Objectives Topics:

Docker Swarm installation Guide

Red Hat Development Suite 2.1

Installation of the DigitalSystemsVM virtual machine

Lab 2A> ADDING USERS in Linux

Lab Authentication, Authorization, and Accounting

SCRIV NETWORK COLD WALLET MASTERNODE SETUP GUIDE DETAILED

Simulation Manager Configuration Guide

This guide assumes that you are setting up a masternode for the first time. You will need:

Install the Marionnet network simulator on Kali Linux Light vbox-i686

SmartCash SmartNode Setup Guide V1.2 Windows 10 13/01/2018 By (Jazz) yoyomonkey Page 1

Relarium (RLM) Masternode Guide for VPS

CENG 334 Computer Networks. Laboratory I Linux Tutorial

SQL Server vnext on Linux Ubuntu - Part 1

DOCUMENT HISTORY REV. NO. CHANGES DATE. 000 New Document 30 Mar Document Revision:

DogeCash Masternode Setup Guide Version 1.2 (Ubuntu 16.04)

Red Hat Quay 2.9 Deploy Red Hat Quay - Basic

ULTEO OPEN VIRTUAL DESKTOP NATIVE CLIENT

SmartCash SmartNode Setup Guide v1.2. Windows 10. Date: 13/01/2018. By (Jazz) yoyomonkey

UC for Enterprise (UCE) NEC Centralized Authentication Service (NEC CAS)

SAS Event Stream Processing for Edge Computing 4.3: Deployment Guide

Linux Kung Fu. Stephen James UBNetDef, Spring 2017

Ansible Tower Quick Setup Guide

Metasploit. Installation Guide Release 4.4

Orchid Core VMS Installation Guide

Hiptest on-premises - Installation guide

Orchid Fusion VMS Installation Guide

Table of Contents. Table of Contents License server installation guide - Linux. Download SCL

Red Hat Development Suite 2.2

USING NGC WITH YOUR NVIDIA TITAN PC

Dixicoin (DXC) Masternode Guide for VPS

IBM DB Getting started with Data Studio Hands-On Lab. Information Management Cloud Computing Center of Competence.

Client TM 2.0 SP2 for Linux

IDOL Site Admin. Software Version Installation Guide

Technology Note. ER/Studio: Upgrading from Repository (v ) to Team Server 2016+

Installation Guide. Connection Broker. Advanced Capacity and Connection Management for Hybrid Clouds

Contents. Note: pay attention to where you are. Note: Plaintext version. Note: pay attention to where you are... 1 Note: Plaintext version...

Geneious Floating License Manager Version Biomatters Ltd

Red Hat Container Development Kit 3.0 Installation Guide

10ZiG Technology. Thin Desktop Quick Start Guide

Bitnami MEAN for Huawei Enterprise Cloud

Technology Note. ER/Studio: Upgrading from Repository (v ) to Team Server 17.x

Setting up a Chaincoin Masternode

Cloudera Manager Quick Start Guide

Introduction. What is Linux? What is the difference between a client and a server?

Getting Started with ESX Server 3i Installable Update 2 and later for ESX Server 3i version 3.5 Installable and VirtualCenter 2.5

Dell EMC ME4 Series vsphere Client Plug-in

QuickStart Guide for Managing Computers. Version 9.73

29 March 2017 SECURITY SERVER INSTALLATION GUIDE

Getting Started with ESX Server 3i Embedded ESX Server 3i version 3.5 Embedded and VirtualCenter 2.5

An introduction to Docker

Getting Started with ESXi Embedded

Linux Kung Fu. Ross Ventresca UBNetDef, Fall 2017

Upgrade Tool Guide. July

Sun VirtualBox Installation Tutorial

KOHA UBUNTU In Compatible With. 1 P a g e

Installing the Management Software

QuickStart Guide for Managing Computers. Version

Installing and Upgrading Cisco Network Registrar Virtual Appliance

Enterprise Vault.cloud CloudLink Google Account Synchronization Guide. CloudLink to 4.0.3

Installing the Operating System or Hypervisor

Guide Installation and User Guide - Linux

Bitnami MariaDB for Huawei Enterprise Cloud

Building a 64-bit CentOS 7 Workstation using Oracle Virtual Box

Geneious Floating License Manager Version Biomatters Ltd

Linux Operating System Environment Computadors Grau en Ciència i Enginyeria de Dades Q2

Chapter 15: Using GemStone/S 64 Bit in a VMware Appliance

SmartCash SmartNode SCRIPT Setup Guide v2.2. Windows 10. Date: 20/02/2018. By (Jazz) yoyomonkey

LT Auditor Installation Guide

Jackson State University Department of Computer Science CSC / Computer Security Fall 2013 Instructor: Dr. Natarajan Meghanathan

IOL INTACT Installation Guide

Silk Performance Manager Installation and Setup Help

Installation of Sybase ASE 15.5 on Solaris 10 is pretty easy to accomplish. Please, do follow the steps as below.

Some Ubuntu Practice...

Download and install MySQL server 8 in Windows. Step1: Download windows installer

Symantec Desktop and Laptop Option 8.0 SP2. Symantec Desktop Agent for Mac. Getting Started Guide

More Raspian. An editor Configuration files Shell scripts Shell variables System admin

XLink Kai Raspberry Pi Beginners Tutorial

Dell Wyse Management Suite. Version 1.1 Migration Guide

HiveManager Virtual Appliance QuickStart

Start Up and Shutdown Procedures (Unix)

Appliance Guide. Version 1.0

IBM Monitoring Agent for Citrix Virtual Desktop Infrastructure 7.2 FP3. User's Guide IBM SC

How to Use This Lab Manual

Server Monitoring. AppDynamics Pro Documentation. Version 4.1.x. Page 1

Ubuntu Supplement to X350 & X550 User s Guide NComputing X350 & X550 vspace Software for Linux on Ubuntu 8.04

VIRTUALIZATION MANAGER ENTERPRISE EDITION GETTING STARTED GUIDE. Product: Virtual Iron Virtualization Manager Version: 4.2

Post Ubuntu Install Exercises

Version Installation Guide. 1 Bocada Installation Guide

Upgrading an ObserveIT One-Click Installation

Quick Start Guide 0514US

Running Blockchain in Docker Containers Prerequisites Sign up for a LinuxONE Community Cloud trial account Deploy a virtual server instance

IQSweb Installation Instructions Version 5.0

02. At the command prompt, type usermod -l bozo bozo2 and press Enter to change the login name for the user bozo2 back to bozo. => steps 03.

DB2 - SERVER INSTALLATION

Transcription:

Downloading and installing Db2 Developer Community Edition on Ubuntu Linux Roger E. Sanders Yujing Ke Published on October 24, 2018 This guide will help you download and install IBM Db2 software, Data Server Manager software, Data Studio software (optionally) and a sample database all packaged in a Docker container on Ubuntu Linux. After completing the following steps, you will have a Db2 v11.1.3.3 database named SAMPLE that can be used to develop and test applications. Table of Contents 1 Introduction: What is Db2?... 1 2 Prerequisites... 2 2.1 Hardware... 2 2.2 Software... 2 3 Enabling root user access... 3 4 Downloading the Db2 Developer Community Edition software... 4 5 Preparing the server for Db2 installation... 9 5.1 Download and install Docker for Linux... 9 5.2 Configure the server to start Docker automatically on boot... 10 5.3 Create a Db2 instance user... 10 5.4 Create a Docker group and add the Db2 user to it... 11 6 Installing the Db2 software... 12 7 Testing and validating setup... 22 7.1 Querying the Db2 SAMPLE database... 22 8 Summary... 28 9 References... 28 1 Introduction: What is Db2? IBM Db2 is an enterprise-level, high-performance relational database management system (RDBMS) that is designed to make the storage, management, and retrieval of data simple. Data

is stored in the form of tables consisting of rows (records) and columns (fields) and can be retrieved or modified by any number of applications that are running concurrently. Access to, and manipulation of data in a Db2 database is accomplished using Structured Query Language (SQL) to store (INSERT), retrieve (SELECT), and manipulate (UPDATE and DELETE) data in a RDBMS. SQL also provides facilities for defining database objects like tables, indexes, and views, and for restricting data access. Docker is software that aids in the delivery and deployment of other software by bundling the required components in containers; IBM Db2 Developer Community Edition is a Docker container that has everything needed to set up an environment for Db2 database application development. 2 Prerequisites Basic understanding of Linux operating system concepts 2.1 Hardware An Intel-based X86 server capable of supporting a 64-bit Operating System Minimum of 8GB of RAM Monitor Keyboard Mouse 2.2 Software Ubuntu Linux 18.04 LTS (Desktop)* The latest long-term support (LTS) version of the Ubuntu Linux operating system. Download the Ubuntu Linux 18.04 software. Db2 Developer Community Edition * Free, fully functional version of Db2 intended for development, test, and small production environments. (Get information on Db2 Direct and Developer-C Editions.) A list of the most current versions of Db2 and Linux operating systems that have been tested (together) can be found at the System requirements for IBM DB2 for Linux, UNIX, and Windows web site.

3 Enabling root user access (Duration: 1 minute) When Ubuntu Linux 18.04 LTS is installed, root login is disabled by default. Db2 should be installed under the root user account so follow these steps to enable root user access: 1. Log in with the user account that was created and given administrative privileges during the OS installation. 2. Open a terminal window. (Right-click anywhere on the desktop and select Open Terminal from the menu shown or press Ctrl + Alt + t). 3. Enter the command sudo passwd root. 4. When the prompt [sudo] password for [AdminUser]: (where AdminUser is the user account that was used in Step 1) appears, enter the password for the administrative user account and press Enter. 5. When the prompt Enter new Unix Password: appears, type a new password for the root user and press Enter. 6. When the prompt Retype new Unix Password: appears, type the new password again and press Enter. You should see the message passwd: password updated successfully; if this message does not appear, go through the steps again, making any corrections suggested by the error message or messages that are returned.

4 Downloading the Db2 Developer Community Edition software (Duration: 5 minutes) Follow these steps to download the Db2 Developer Community Edition software (web page appearance may vary): 1. Open a web browser and go to the IBM Db2 Direct and Developer Editions web page. (Figure 1). Figure 1. IBM Db2 Direct and Developer Editions Web Page

2. Click the Try free developer edition button. This will open the IBM Db2 Developer Editions download page (see Figure 2). Figure 2. IBM Db2 Developer Editions download page 3. Click Try free edition for IBM Db2 Developer Community Edition. This will open a Sign Up for IBM Db2 web page (Figure 3).

Figure 3. IBM Db2 Developer Community Edition Sign Up page 4. If you already have an IBM ID, click the Sign in link and then enter your IBM ID and password. 5. If you do not already have an IBM ID, enter the information requested, along with a password; then click Continue. 6. Answer the questions on the Complete your profile page (Figure 4) and click Continue.

Figure 4. Complete your profile page 7. A Downloads page will open (Figure 5). Click the Download now link next to "IBM Db2 Developer Community Edition for Linux x86 (SUSE Linux Enterprise Server 12, Fedora 25, Ubuntu 16.04+)."

Figure 5. IBM Db2 Developer Community Edition Downloads page 8. Save the resulting file (ibm-db2-developer_community_edition-1.2.1- x86_64.appimage). You now have the software needed to install Db2 Developer Community Edition on your machine.

5 Preparing the server for Db2 installation 5.1 Download and install Docker for Linux (Duration: 10 minutes) Because Db2 Developer Community Edition is Db2 (along with other tools) in a Docker container, Docker Community Edition (CE) or Docker Enterprise Edition (EE) must be installed on the server before Db2 Developer Community Edition can be used. Perform the following steps to install Docker CE: 1. Open a terminal window if you do not already have one open. 2. Execute the command su - root. When the Password: prompt appears, provide the password you created for the root user earlier. The command line prompt should change from $ to #. 3. If an older version of Docker is already installed, uninstall it by executing the command apt-get remove docker docker-engine docker.io. (It s OK if this command reports that none of these packages are installed.) 4. Execute the command apt-get update to update the list of packages installed on the system. 5. Execute the following commands to install the Docker prerequisite packages: a) apt-get -y install apt-transport-https b) apt-get -y install ca-certificates c) apt-get -y install curl d) apt-get -y install software-properties-common 6. Add Docker s official GNU Privacy Guard (GPG) security key to the server s keyring by executing the command curl -fssl https://download.docker.com/linux/ubuntu/gpg sudo apt-key add. 7. Verify that the key was installed correctly by searching the keyring for the fingerprint 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88. This can be done by executing the command apt-key fingerprint 0EBFCD88 (the last 8 characters of the fingerprint) when this command is executed, the fingerprint should be displayed on the screen. 8. Create a new Docker CE repository for the latest stable image by executing the command add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable". (Note that you only need to set up the repository once, after which you can install Docker EE and upgrade repeatedly from the repository, as necessary.) 9. Execute the command apt-get update to update the list of packages installed on the system again.

10. Install the latest release of Docker CE by executing the command apt-get -y install docker-ce. 11. Verify that Docker CE was installed correctly by running the hello-world image. This is done by executing the command docker run hello-world. You should see a message that contains the following text: Hello from Docker! This message shows that your installation appears to be working correctly. NOTE: Additional information about installing Docker CE on an Ubuntu server can be found here: https://docs.docker.com/v17.12/install/linux/docker-ce/ubuntu/#install-docker-ce-1 5.2 Configure the server to start Docker automatically on boot (Duration: 1 minute) Most current Linux distributions (i.e., RHEL, CentOS, Fedora, Ubuntu 16.04 and higher) use systemd to manage which services are started when a system boots. To configure your server to automatically start Docker as part of the boot process, perform the following steps: 1. Open a terminal window if you do not already have one open. 2. Execute the command su - root; when the Password: prompt appears, provide the correct password for the root user. 3. Execute the command systemctl enable docker. You should see a message that looks something like this: Synchronizing state of docker.service with SysV service script with /lib/system/system-sysv-install. Executing: /lib/system/system-sysv-install enable docker NOTE: If you decide you do not want Docker to start automatically when a system boots, you can execute the command systemctl disable docker to stop this behavior. 5.3 Create a Db2 instance user (Duration: 2 minutes) During a typical installation of Db2, an instance user (named db2inst1 by default) is created and assigned to a group named db2iadm1. However, that s not the case when Db2 Developer Community Edition is installed an instance user name and password are provided as part of the installation process, but that information is stored in the Docker container not at the server

operating system level. To create a Db2 instance user at the OS level, perform the following steps: 1. Open a terminal window if you do not already have one open. 2. Execute the command su - root; when the Password: prompt appears, provide the correct password for the root user. 3. Create a group named db2iadm1 by executing the command groupadd db2iadm1. 4. Create a user named db2inst1 and assign that user to the group just created by executing the command useradd -g db2iadm1 -m -d /home/db2inst1 -s /bin/bash db2inst1. 5. Assign a password to the user just created by executing the command passwd db2inst1. 6. When the prompt Enter new UNIX password: appears, enter a password for the user account and press Enter. 7. When the prompt Retype new UNIX password: appears, type the new password again and press Enter. You should see the message passwd: password updated successfully; if this message does not appear, go through the steps again, making any corrections suggested by the error message or messages returned. 5.4 Create a Docker group and add the Db2 user to it (Duration: 2 minutes) The Docker daemon binds to a UNIX socket instead of a TCP port and, by default, the socket used is owned by the user root. This means that other users can only access Docker using sudo; the Docker daemon runs under the root user s control. To prevent having to preface every Docker command with sudo, it s good idea to create a group named docker and add the appropriate users to it. Then, when the Docker daemon starts, it will create a UNIX socket that is accessible by the members of this group. You can create a group named docker and assign users to it by performing the following steps: 1. Open a terminal window if you do not already have one open. 2. Execute the command su - root; when the Password: prompt appears, provide the correct password for the root user. 3. Create a group named docker by executing the command groupadd docker. (This group may have been created automatically when the command docker run helloworld was executed earlier; if so, you will see the message groupadd: group docker already exists, which you can ignore.) 4. Add the appropriate users to the group created in the previous step by executing the command usermod -ag docker UserName where UserName is the name of the user that is to be added to the group, for each user. For example: usermod -ag docker db2inst1

usermod -ag docker ibm_admin 5. Close the terminal window and reboot the server. 6. Log back in (as a non-root user who was added to the docker group). 7. Open a terminal window and execute the command su db2inst1. 8. When the prompt Password: appears, enter the password created for the instance owner (db2inst1) earlier and press Enter. 9. Execute the command docker run hello-world. You should see a message that contains the following text: Hello from Docker! This message shows that your installation appears to be working correctly. 6 Installing the Db2 software (Duration: 20 minutes) Once Docker has been installed and is running, you need to use the file containing the Db2 Developer Community Edition software that was downloaded earlier to set up Db2. To perform this task, follow these steps: 1. Open a terminal window if you do not already have one open. 2. Execute the command su - root; when the Password: prompt appears, provide the correct password for the root user. 3. Create a directory named software in the /home directory and execute the following commands to make the software directory accessible to everyone: a) mkdir /home/software b) mkdir /home/software/db2 c) chmod 777 /home/software/db2 4. Execute the command mv /home/adminuser/downloads/ibm-db2* /home/software/db2 (where AdminUser is the name of the administrative user). This will move the file that was downloaded earlier to the directory created in the previous step. 5. Go to the /home/software/db2 directory and make the file just copied there accessible to everyone by executing the following commands: a) cd /home/software/db2 b) chmod 777 * 6. Click the Files icon to open the Files graphical user interface (GUI). Navigate to the /home/software/db2 directory (Other LocationsàComputeràhomeàsoftwareàDb2). 7. Right-click the ibm-db2-developer_community_edition-1.2.1-x86_64.appimage file and select Run from the menu shown. If the Install window shown in Figure 6 appears, click Yes.

Figure 6. IBM Db2 Developer Community Edition Install integration page 8. An IBM Db2 Developer Community Edition window displaying the message HELLO! Thank you for wanting to try out IBM Db2 Developer Community Edition, but sadly the operation system you are using is not supported. may appear (Figure 7). This means that Db2 Developer Community Edition has not been thoroughly tested with the version of Ubuntu you are using. Ignore this message and click Continue. Figure 7. IBM Db2 Developer Community Edition unsupported OS warning page 9. When you see a license agreement window like the one in Figure 8, click I agree and then Continue.

Figure 8. IBM Db2 Developer Community Edition license agreement window 10. An IBM Db2 Developer Community Edition settings window will appear (Figure 9). Select Db2 Developer-C Edition (11.1.3.3) and Data Server Manager (2.1.5) along with any other items you would like to install, then click Continue.

Figure 9. Install settings window 11. If you chose not to make advanced settings changes, an IBM Data Server Manager Credentials and Database Server Credentials window will appear (Figure 10). Enter the user name db2inst1 in the DSM Administrator Username field and supply a password in the corresponding Password fields. (This is the user ID and password that will be used to log into the Data Server Manager console.) Provide similar information in the Database Server Username and Password fields. (This is the user ID and password that will be used to connect to the SAMPLE database.) Then, click Continue.

Figure 10. Credentials window 12. The Installing DB2 Server Edition window will appear (Figure 11) with a status bar that shows the overall progress of the installation.

Figure 11. Installation window 13. When the installation process is complete, an Installation Complete window appears (Figure 12).

Figure 12. Installation complete window 14. Click Launch Db2 Developer-C and the Welcome to Db2 Community Edition window will appear (Figure 13). Click Get Started to start Db2 and display the Data Server Manager login screen (Figure 14). When this screen appears, enter the User name and Password provided earlier (Step 11) in the appropriate fields and click Sign In.

Figure 13. Db2 DCE welcome window

Figure 14. Db2 DCE Data Server Manager login screen 15. When the Welcome to Data Server Manager screen appears (Figure 15), you can interact with your Db2 database environment via Data Server Manager. Or, you can open a terminal window and work with that.

Figure 15. Data Server Manager welcome screen

7 Testing and validating setup The following section documents a simple test to verify that the software components used to set up the environment described earlier were installed correctly. 7.1 Querying the Db2 SAMPLE database (Duration: 5 minutes) Db2 comes with a sample database that, when created, can be used for a variety of purposes, including development and testing simple applications that interact with Db2. To help you get started, this sample database is created automatically as part of the Db2 Developer Community Edition installation process. (Get information about the Db2 sample database). Follow these steps to run a simple query against the Db2 sample database: 1. Open the Data Server Manager menu by clicking on the three horizontal bars located to the left of the text IBM Data Server Manager and select RUN SQL (see Figure 16). Figure 16. Data Server Manager main menu

2. When prompted, enter the User ID and Password (i.e., the Database Server Credentials provided during installation) in the appropriate fields and click OK to connect to the SAMPLE database (see Figure 17). NOTE: This example assumes the instance owner name is db2inst1. However, you can specify a different name when installing Db2 if that is the case, use the appropriate instance owner name. Figure 17. Operation credentials input window 3. Enter the text select * from department in the SQL text entry area of the Run SQL screen and select Run all from the drop-down menu available under the Run push button (Figure 18).

Figure 18. Run SQL menu 4. After the SQL statement has executed, you should see a screen that is similar to the one in Figure 19. A green circle with a check mark beside the statement text in the Result area of the screen (bottom left) indicates the SQL statement ran successfully; in this example, the Result Set area of the screen (bottom right) displays the data retrieved.

Figure 19. Run SQL screen with results 5. Open the Db2 Developer Community Edition menu by clicking on the three horizontal bars located to the left of the text IBM Db2 Developer Community Edition. Select Open Db2 Terminal (see Figure 20).

Figure 20. Db2 Developer Community Edition menu 6. When the How to access Db2 Server directly from your terminal screen appears (Figure 21), click Open Terminal. Then, execute the command shown on the screen (below the Open Terminal button) in the terminal window. In this example, that command is: docker exec -it db2server bash -c su - db2inst1

Figure 21. How to access the Db2 server screen 7. Execute the command db2 connect to sample (in the terminal window opened in the previous step). When this command is executed, you should see a message that looks like this: Database Connection Information Database server = DB2/LINUXX8664 11.1.3.3 SQL authorization ID = DB2INST1 Local database alias = SAMPLE 8. After a database connection is established, retrieve the contents of the table named DEPARTMENT by executing the command db2 select * from department (be sure to include quotes around the text that follows db2). You should be presented with fourteen rows of data along with the message 14 record(s) selected. 9. Execute the command db2 connect reset to terminate the database connection. You should see the message DB20000I The SQL command completed successfully. The terminal window should look similar to the one in Figure 22.

Figure 22. Db2 server terminal window 8 Summary If you successfully completed the steps outlined here, you will have a Docker on Ubuntu Linux environment that can be used to develop applications that interact with the SAMPLE database that is provided with Db2. You can also create other databases and database objects to work with, as well as explore the different features that has Db2 to offer. To learn more about these features, refer to the IBM Db2 Version 11.1 Knowledge Center. 9 References Db2 database product documentation Db2 samples on GitHub