Skip to main content

If you don't have an IBM ID and password, register here.

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. This profile includes the first name, last name, and display name you identified when you registered with developerWorks. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

Deploy your database applications and projects on the cloud

Using IBM DB2 data server and Amazon Elastic Compute Cloud (EC2)

Rav Ahuja (rsahuja@ca.ibm.com), Senior Product Manager, IBM
Rav Ahuja is a Senior Product Manager for Data Management at IBM and is based in the Toronto Lab. He has been working with DB2 since version 1, and he has held various roles in DB2 development, technical support, marketing, and product management. In addition to product strategy and evangelism, Rav spends his time helping customers and business partners around the globe benefit from DB2 solutions using emerging technologies and cloud computing. He is a frequent presenter at events in many countries, and he has written numerous papers, articles and books related to DB2. In his spare time, Rav helps maintain ChannelDB2.com, a social network that aggregates DB2 related videos, blogs, podcasts, and so on. Rav holds a Computer Engineering degree from McGill University and an MBA from University of Western Ontario.
Bradley Steinfeld (bsteinfe@ca.ibm.com), Software Developer, IBM
Bradley Steinfeld is a software developer and an open-source-software evangelist based out of the IBM Toronto Lab. He is one of the first IBMers to work with DB2 on the cloud, and he has become an expert on various cloud technologies (Amazon EC2, CloudBurst, Eucalyptus, and so on). He has a Bachelor of Mathematics from the University of Waterloo.

Summary:  Cloud computing is an increasingly popular paradigm that can significantly accelerate development and prototyping cycles. In this tutorial you will learn how you can easily deploy your database applications and projects on the cloud in just minutes using IBM® DB2® data server and Amazon Elastic Compute Cloud (EC2). No prior cloud computing or DB2 experience is necessary.

Date:  28 Jan 2010
Level:  Intermediate PDF:  A4 and Letter (2313 KB | 39 pages)Get Adobe® Reader®

Comments:  

E. Working with your database

The database you created in D. Performing initial configuration of your DB2 AMI instances does not contain any data yet. For this tutorial, it might be more useful to work with a database that already contains some data. Follow the steps to understand how to find and use an existing database.

  1. Open a terminal, and ssh into your instance.
  2. Enter su - db2inst1 to become the db2inst1 user.
  3. Enter db2sampl to create the sample database, as shown in Figure 48.

Figure 48. db2sampl command
Shows db2sampl entered at command line
  1. Enter db2. The DB2 Command Line Processor (CLP) interface appears, as shown in Figure 49.

Figure 49. DB2 CLP
Shows DB2 Command Line Processor interface
  1. Enter connect to SAMPLE to connect to the SAMPLE database, as shown in Figure 50.

Figure 50. Connect to SAMPLE
connecting to sample database from CLP
  1. Enter list tables to find out which tables are in the SAMPLE database, as shown in Figure 51.

Figure 51. List tables
Shows issuing command and resulting list of tables
  1. Enter other SQL statements to experiment with viewing the data. Figures 52-54 show examples of some statements and results.

Figure 52. Entering the DESCRIBE SELECT * FROM DEPT statement
Shows results of describe select statement

Figure 53. Entering the SELECT * FROM DEPT statement
Shows results of select statement

Figure 54. Entering the SELECT COUNT(*) FROM DEPT statement
Shows results of select count statement
  1. Enter quit to close the CLP interface, as shown in Figure 55.

Figure 55. Closing the CLP interface
Shows issuing quit command

Using Technology Explorer

During the initial configuration phase, the Apache Web Server and a PHP application called Technology Explorer for DB2 (TE) were also setup. TE is a useful Web-based tool to monitor DB2 databases and to learn about new features and technologies in DB2. You can access this tool if HTTP port 80 was opened up for your DB2 instance during the security group setup. Optionally follow these steps to use TE.

  1. Go to http://<Hostname_of_DB2_Instance>/TE to access TE, as shown in Figure 56.

Figure 56. Access Technology Explorer
Shows Technology explorer screen
  1. In the top right corner, click New to create a new database connection.
  2. Enter the details, as shown in Figure 57, and click Connect.

Figure 57. Connecting to a database from the Technology Explorer
Enter sample database, hostname, port number, username, and password
  1. Verify in the top right corner of TE that it is connected to the sample database on your EC2 instance.
  2. Navigate through the menus of this tool to explore your database and to learn about DB2 features, as shown in Figure 58.

Figure 58. Explore Technology Explorer menus
Shows Technology Explorer screen

6 of 12 | Previous | Next

Comments



Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Information Management,
ArticleID=465178
TutorialTitle=Deploy your database applications and projects on the cloud
publish-date=01282010
author1-email=rsahuja@ca.ibm.com
author1-email-cc=
author2-email=bsteinfe@ca.ibm.com
author2-email-cc=

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).