Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"
International Rescue Committe

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents

· Introduction to Operating Systems
· Linux Basics
· Working with the System
· Shells and Utilities
· Editing Files
· Basic Administration
· The Operating System
· The X Windowing System
· The Computer Itself
· Networking
· System Monitoring
· Solving Problems
· Security
· Installing and Upgrading
· Linux and Windows

Glossary
MoreInfo
Man Pages
Linux Topics
Test Your Knowledge

Site Menu
Site Map
FAQ
Copyright Info
Terms of Use
Privacy Info
Disclaimer
WorkBoard
Thanks
Donations
Advertising
Masthead / Impressum
Your Account

Communication
Feedback
Forums
Private Messages
Surveys

Features
HOWTOs
News Archive
Submit News
Topics
User Articles
Web Links

Google
Google


The Web
linux-tutorial.info

Who's Online
There are currently, 64 guest(s) and 0 member(s) that are online.

You are an Anonymous user. You can register for free by clicking here

  

HOWTO Home

Current HOWTO: DB2-HOWTO


Using DB2 UDB

18. Using DB2 UDB

This section gives you the basic information you need to start working with DB2 UDB on Linux. It includes instructions on issuing DB2 UDB commands and SQL statements from the command line, as well as the commands you need to start the DB2 UDB Control Center and the DB2 UDB Information Center.

18.1. DB2 UDB Control Center

The left side of the DB2 UDB Control Center provides an object-oriented view of the database objects that you have catalogued, including DB2 UDB instances and databases on other DB2 UDB servers. One way to add, edit, or drop database objects is to right-click on an object to bring up a menu.

To start the DB2 UDB Control Center

  1. Ensure you are logged on to your Linux workstation using either the DB2 UDB Administration Server user ID or the DB2 UDB instance user ID. If you use the su command to become the user, ensure you include the -l parameter to initialize the environment for the user.

  2. Start the X server, if it is not already started.

  3. Issue the db2cc command to start the DB2 UDB Control Center.

18.2. DB2 UDB Information Center

As mentioned above, the new DB2 UDB Information Center is a revamped documentation display system that now encapsulates the task, concept and reference information required to properly run DB2 UDB. It can be installed locally, on an intranet server, or accessed directly from an ibm.com hosting service

To start the DB2 UDB Information Center:

  1. Ensure you are logged on to your Linux workstation using either the DB2 UDB Administration Server user ID or the DB2 UDB instance user ID. If you use the su command to become the user, ensure you include the -l parameter to initialize the environment for the user.

  2. Ensure that the X server is started, because the Information Center requires a Web browser.

  3. Issue one of these launch commands:

    • db2help

    • db2ic

    • db2cc -ic

Alternatively, you can launch the Information Center from within the Control Center (or any of the other GUI tools), by clicking an item under the "Help" menu, or by clicking on the "?" icon.

If you did not install the DB2 UDB Information Center, or have not configured your tools to use a different server, these commands will launch a detected browser, and take you directly to the IBM hosted DB2 UDB Information Center at http://publib.boulder.ibm.com/infocenter/db2help/.

18.3. DB2 UDB CLP

If you are logged on to your Linux workstation using either the DB2 UDB Administration Server user ID or the DB2 UDB instance user ID, you can issue DB2 UDB commands and SQL statements from the command line.

If this is your first time using DB2 UDB, I would suggest creating the sample database that ships with DB2 UDB. The sample database is used throughout the DB2 UDB documentation and is required by most of the sample applications.

To create the sample database, you can either select the Create the sample database option from the DB2 UDB First Steps launchpad, or by issuing the db2sampl command.

Before you can issue an SQL statement, you have to connect to a database. To connect to a database, enter the command:

db2 CONNECT TO database USER userID USING password

To connect to a database, and have DB2 UDB prompt you for the password, issue the command:

db2 CONNECT TO database USER userID

To connect to a database using the default user ID, issue the command:

db2 CONNECT TO database

Once you have connected to a database, you can then issue SQL statements or DB2 UDB commands against that database. For example, to select all of the columns from the EMPLOYEE table in the SAMPLE database, issue this command:

db2 "SELECT * FROM employee"

You can avoid typing db2 as the prefix for every SQL statement and DB2 UDB command by issuing DB2 UDB commands using the Command Line Processor (CLP). To start the CLP, issue the db2 command by itself. DB2 UDB provides the following prompt:

You can issue database manager commands and SQL statements from the
command prompt. For example:
    db2 => connect to sample
    db2 => bind sample.bnd

For general help, type: ?. 
For command help, type: ? command, where command can be 
the first few keywords of a database manager command. For example: 
 ? CATALOG DATABASE for help on the CATALOG DATABASE command
 ? CATALOG          for help on all of the CATALOG commands. 

To exit db2 interactive mode, type QUIT at the command prompt. Outside 
interactive mode, all commands must be prefixed with 'db2'. 
To list the current command option settings, type LIST COMMAND OPTIONS. 

For more detailed help, refer to the Online Reference Manual. 

db2 => 

Some users prefer to avoid the CLP because it prevents using the command line history features of the shell.

Some users claim that running the CLP within an Emacs shell gives them the best of both worlds: they get command line history, and they don't have to escape commands that contain lots of quotation marks and brackets.


The Linux Tutorial completely respects the rights of authors and artists to decide for themselves if and how their works can be used, independent of any existing licenses. This means if you are the author of any document presented on this site and do no wish it to be displayed as it is on this site or do not wish it to be displayed at all, please contact us and we will do our very best to accommodate you. If we are unable to accommodate you, we will, at your request, remove your document as quickly as possible.

If you are the author of any document presented on this site and would like a share of the advertising revenue, please contact us using the standard Feedback Form.


  
Show your Support for the Linux Tutorial

Purchase one of the products from our new online shop. For each product you purchase, the Linux Tutorial gets a portion of the proceeds to help keep us going.


Login
Nickname

Password

Security Code
Security Code
Type Security Code


Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Help if you can!


Amazon Wish List

Did You Know?
The Linux Tutorial can use your help.


Friends



Tell a Friend About Us

Bookmark and Share



Web site powered by PHP-Nuke

Is this information useful? At the very least you can help by spreading the word to your favorite newsgroups, mailing lists and forums.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Articles are the property of their respective owners. Unless otherwise stated in the body of the article, article content (C) 1994-2013 by James Mohr. All rights reserved. The stylized page/paper, as well as the terms "The Linux Tutorial", "The Linux Server Tutorial", "The Linux Knowledge Base and Tutorial" and "The place where you learn Linux" are service marks of James Mohr. All rights reserved.
The Linux Knowledge Base and Tutorial may contain links to sites on the Internet, which are owned and operated by third parties. The Linux Tutorial is not responsible for the content of any such third-party site. By viewing/utilizing this web site, you have agreed to our disclaimer, terms of use and privacy policy. Use of automated download software ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and are therefore expressly prohibited. For more details on this, take a look here

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.14 Seconds