DB2 Administration and Application Development on Cloud (BlueMix)
Sardana 06000055HU 1,954 Views
After almost 3 months of hard work in the office, I thought of taking a break and planned to make a trip to goa. Being very near to Goa in my college days, I never get a chance to see this most preferred tourist place in India. It was a off season there, but I planned this trip with some of my friends (or I will say they planned and I just joined). We spent 2 exciting and happening days there. From the first day vigator beach, where we are almost in between the high tide sea layers and still survived to the last days in forts and temples, we enjoyed to the fullest. Some of the things to remember apart from the tourist places are the play of cards in train, Tamil's singing, the view of Dhoodhsagar falls from the train and not to forget the video shoots from none other then me. It was a pleasant break to refresh all of us to start working again.
While working from last 3.5 years under different mangers, I always use to think, on which platform I compare my managers. How I can say which is the best and which is not so good comparatively(might be individual's personal choice but still it will be good if their will be some criteria). I always wonder what to speak when a manager ask me to give feedback. Today I read an article which gives me some points to consider while preparing for such a feedback session. Thanks to my team mate Jayasimha who sent the link for this article. Have a look
Dont miss the link in the article which gives 10 qualities to be measure up and see how many times you like to say thanks to your manager.[Read More]
Last week, I got a question regarding the connection failure. This problem is very common in DB2 and mostly because of the TCP/IP communication was not enabled properly. I have suggested the following steps to test if the TCP/IP is setup up properly.
1. Check that the DB2COMM registry variable os set to TCPIP.2. The port number is defined properly in services file. Better to use port number directly instead of the name of the port.3. dbm cfg SVCENAME parameter is assigned the correct value.4. If the database is remote, it is cataloged properly.5. Try pinging the server machine. Check if the IP for the server is dynamic. In which case server IP can change resulting in communication lost.6. Try running LIST DATABASE DIRECTORY command and make sure that the database appear in the list.7. Try running LIST NODE DIRECTORY and make sure the server node is cataloged properly.8. Check if there is any firewall which is preventing the access to the server.9. Try connection to the server using TELNET and DB2 Port.10. Try connection to the database from CLP.
These are very simple tests to make sure network communication is fine. So next time you see any connection failure, try these tests to check the communication.[Read More]
Today while browsing developerworks, I came across this tutorial which explain how to setup your system to create an web application from free softwares suits from IBM ie DB2 express-C, Eclipse and WAS Community edition. The tutorial explain how to install, configure and integrate these component and start creating your application. I think this will be beneficial for the students for their projects and at the same time for the people who likes to learn and create their sample web application and see the power of this suit. Here are what this tutorial cover in 2 part sessions.
# Downloading and installing DB2 Express-C 9.5
# Creating databases and manipulating data with tools in DB2 Express-C 9.5
# Downloading and installing Application Server 2.0
# Managing Application Server through the Web console
# Connecting Application Server to DB2 Express-C 9.5 using a JCA 1.5 connector
# Downloading and installing Eclipse
# Installing the Eclipse Web Tools Platform (WTP) server adapter for Application Server (formerly called the Application Server plug-in for Eclipse)
# Managing, browsing, and editing DB2 Express-C 9.5 data through the Eclipse IDE
# Testing Web applications in Eclipse using existing Application Server installation
# Rapidly developing and testing a JSP/JSTL Web application in Eclipse, with data access to DB2 Express-C 9.5, and deploying it to Application Server
# Configuring Application Server as a general Web server on the Internet
And here is the link to the tutorial first part
So enjoy reading and create your web application for free.[Read More]
Today I started reading the book "Database Administration : The Complete Guide to Practices and Procedures". I started with the 3rd chapter which talk about the data modeling. I am not sure if the data modeling work falls into the tasks a DBA should perform. At the same time as its one time activity, having a independent team to do the data modeling may result into no-work for the team once the database is implemented. As there are a lot of tools available to model the data, despite of that, is data modeling is really difficult ?. The book says efficient data model will allow you to minimize the data redundancy, maintain integrity, better data sharing and access and maintain consistency and while modeling you should consider how the data can be used in future instead of the current usage. But predicting about how the data can be used in future and really a difficult task. With new technologies coming every day, the usage of the data can go any way. Predicting the future use correctly will really make a data model a good one (of course, prediction should be right for that).I think now I need to start looking for some article which will give me some insight on how to predict the different manner a data can be accessed in future?. Do let me know if you know anything related.[Read More]
Sardana 06000055HU 1,477 Views
As not all the certification guides are available for DB2 Version 9, It looks a little difficult to go for the certification for V9. Susan Visser mention in one of her blog entry to read the book titled "IBM DB2 9 New Features" along with the corresponding V8 certification guide to prepare and pass the V9 certification. I wondered if this book is available in India and asked the same question to Susan and got a pleasing answer, the book is available through tata McGraw-Hill publication. When I visited their site, I found they need a manual order and I was not sure how many days it will take to get it delivered to me. Then after a google search, I found that you can order the book online though a cb-india portal, and they are delivering the book within 3 days from the order. They are giving 20% discount too. I just ordered the book as I need it for preparing for the DBA certification. Here is the portal link
Here are the contents for this book, looks really interesting. It seems V9 features are covered thoroughly. Susan mentioned in her blog"One of the major selling points of this book, besides the fact that it lists all the newest features is it's coverage of XML. There is no other book on the market that has such thorough coverage of XML on DB2 9."
So it will be nice reading. I am waiting for this book to reach me soon.
Part I. XML in DB2 New Hybrid Storage Engine Ch. 1. What is XML? Ch. 2. When Do I use pureXML? Ch. 3. pureXML: The DB2 XML Database Ch. 4. Tuning XML Performance Part II. Autonomics and Manageability Ch. 5. Up and Running Enhancements Ch. 6. Self Tuning Memory Manager Ch. 7. Automated Storage Ch. 8. Other Autonomic and Manageability Enhancements
Part III. Application Development Ch. 9. Rational Data Architect Ch. 10. DB2 and the .NET Developer Ch. 11. DB2 and the Java Developer Ch. 12. DB2 and the Scripting Languages Developer Ch. 13. DB2 and the XML Developer Ch. 14. DB2 Developer Workbench Ch. 15. Other Application Development Topics
Part IV. Security Enhancements Ch. 16. Label-Based Access Control Ch. 17. Additional Security Enhancements Part V. SHARP Enhancements Ch. 18. Larger Table Space Support Ch. 19. Larger Object Support Ch. 20. Raw Compression Ch. 21. High-Availability Enhancements Ch. 22. Additional SHARP Enhancements Index[Read More]
Finally after 3 months of preparation, I have completed the DB 9 Advance DBA certification. It was my 2nd attempt. First time when I gave this exam, I was in an impression that it will be similar to the exams I gave earlier (DBA and Application Development) where I can just read certification guide and will be able to clear it but that was not the case here. When I attempted first time and failed by 4 marks I realized, I do need to read some concepts very much in details. Specifically HA and Performance. HA and performance makes 52% of the exam and you need to have good hold on these topics to get a good score. So I started reading the complete performance and HA guide. While reading I really felt that DB2 is not just SQL and some monitoring stuff. There are a lot in it. It also gave me the feeling how hard it can be to tune a database and how difficult it would be for a DBA to tune a database which is huge in size. This encourage me to read some more administration guide and go for DB2 problem determination certification. And yes that is my next goal for this year. Another certification and a new way to see a database tuning and problem determination.
In case you need some tips and questions, let me know. I will be happy to help who likes DB2 administration.[Read More]
Earlier today, I was preparing the presentation on DB2 pureXML. At the end of the presentation, I wanted to put some references and came across these DB2 Games. A nice idea to teach DB2 to the people who are new to DB2. I like the detective game more interesting then business one. It is easier but interesting too. I think it will be very useful to teach people DB2 and SQL/XQuery. Here is the link to download these games.
DB2 Business game
DB2 Detective Gamehttp://www.ibm.com/developerworks/edu/dm-dw-dm-0402kubasta-i.html
Have fun learning DB2[Read More]
As I promised that I will be putting the questions asked by the customer on DB2, so here are the some.
1. One of the questions was on GTT(Global Temporary Table). As documented, GTT are at the session level and will be flushed out once the session is closed. The question was, can we have 2 GTT with the same name in 2 different stored procedure. I think its possible but it seems it may create a conflict when we try to call both the stored procedure using same connection. As GTT are at the session/connection level, the GTT created in second stored procedure may conflict with the existing GTT created in the first. I wonder if the GTT are flushed out as soon as we come out of the stored procedure execution. I still need to play and find out the correct answer. Your feedbacks are welcome.
2. Second question was on stored procedure. As we know execution permission on the package are enough to call a stored procedure, now if one of the stored procedure is calling another inside it, do we need to grant explicit execute permission on the internal stored procedure or giving the permission on the external stored procedure will implicitly grant the permission on internal too. The question here was, in there scenario they have a lot of nesting of stored procedures and giving explicitly permission on each of the nested procedures is really cumbersome.
3. Oracle gives a flexibility to provide external hints to the SQL for optimization. According to them, these hints are really useful for them as they can force the query to use some indexes. They have the question that do we have something similar. Yes we do have but we never encourage to use it as DB2 optimizer is very much intelligent enough to decide on the indexes to be used and providing these hints may force optimizer to use user provided hints and may degrade the performance.
4. Do we have compiler directives ? I am not sure what they mean by this. There might be something in oracle.
Your comments on these questions are welcome.
Yesterday, I read a small article on DBA traits in Craig Mullins blog. I agreed to what he mentioned in the article. Some traits he mentioned are organized and capable of succinct planning, adaptable, insatiably curious and should have some people skills too. He says "DBAs are expected to know everything about everything -- at least in terms of how it works with databases". When I shared this article with some of my colleagues, I was a little surprised by the responses. One of the question come out of the discussion is "Do DBA certification help becoming a DBA ?". Some says no as it will never give you a feel of real world problems. According to me it depends on who is doing the certification. A person who the real work experience may see no value in doing the certification however for a person who never get a chance to see the real world, A DBA certification may help at least giving a little insight into the kind of problem DBA face. It will at least enable then to see the problem in a right manner and approach in the right direction. I will say certification is the first step to become a DBA and a DBA will never want to go back to the first step. So value of certification depends on the step where you are in the DBA ladder.
While I was in discussion with my colleagues, I was looking for some book which will give me a complete list of task which a DBA need to perform. I found a book "Database Administration: The Complete Guide to Practices and Procedures" again written by Craig Mullins. Hoping that I will find the stuff which I am looking for in this book.[Read More]
Last week I got a request from one of my colleague to help her in deploying one of their application to Bluemix. This application is an enterprise application and I have been given an ear file and a readme file which just provide me step to step instruction of installing the application in a local liberty profile.
To start with, the task seems to be easy as we already have the step to step instruction for local liberty profile and Bluemix use the liberty runtime only. My understanding was that there wont be much differences accept I don't need the liberty installation (as I will get it on the Bluemix), but as I moved on I started seeing some challenges which is very much particular to cloud environment. These challenges has changed my view and clarified some differences between, how the application should be developed and deployed in a cloud environment Vs in premise development.
The first step I did is to push the ear file to Bluemix using cf push and that worked smoothly. My web module is up and running within couple of minutes. The next task was now to have the database up and running and configured with the application. I have added an sqldb service and bound it to the application. Till now its was smooth selling, but the real challenge came now. How to make sure that application configured and connect to the database ? Literally without changing the application code ?
If I think of how we do it in a local environment, we do put the details of database like db name, user name, password, host name, port number etc in server.xml file of the liberty profile and give it a JNDI name. This JNDI name is then referred in the application to connect to the database. This server.xml file is part of the liberty server and not application. In cloud environment we generally don't get access to the server and hence has no control on the server.xml file of the default liberty runtime on Bluemix. The step by step instruction given to me says to copy, server.xml file zipped along with application, to my server profile. But this is not possible when working with the cloud. Same problem goes with the database driver jars. In local installation we generally copy them to the server library. In case of cloud we need to make it part of the application library (under WEB-INF/lib). Both of these alternatives are not possible with the standard liberty build pack and with a ear which can not be changed.
After some understanding of build pack and how I can push changes to build packs, I got the solution to the problem. So here is what I did.
So what this solution is actually doing. When you run the server package command with usr directory included, It actually zipping all the server runtime and application in one folder. When you push this to Bluemix, Bluemix actually detect the server.xml file inside the zip and understand that the zip file contain both the application and the runtime and overwrite the existing configuration file (server.xml) with the one you have created and zipped.
The same solution works for the driver jars file too. You can add the driver file in your local liberty profile under shared resources directory (LIBERTY_HOME/usr/shared/resources) and this will be zipped as part of your server package. Upon cf push, will become part of your customized build back accessible to application. When you do this, make sure that your server.xml file actually has the correct path for these JDBC driver jars, other wise liberty will not be able to find it at the time connection request..
So this solved my problem and application was deployed successfully and was using my customized liberty build pack and sqldb service on the cloud.
This process can be used to do anything which require you to change your build pack including adding new liberty feature in your cloud liberty build pack.
So happy developing :)
Lately I am trying one of the service on Bluemix, Twilo which allow you to send and receive SMS through your application. For my on demand car pooling application I am planning to implement a OTP authentication by sending a one time password to user to validate there mobile number.
Have you ever done such a thing or if you have done anything on Twilo in the past, do share your experience. This will surely help me implement the same quickly.
Waiting to hear from you. In case i make some progress, learn things on this topic, will surely share it with you in my next bog entry.
at present I am following this article to make use of Twilo
Recently I was facing a problem in one of my experiments with Bluemix, where I was trying to connect to a local database on my system from a Bluemix application. I was failing to do so and the reason being that my system was behind a firewall of my organization. Bluemix being on the open network (internet) can not access network behind firewall. Offcourse this is what most of the organization's objective is, for security reasons and to make sure no unwanted access happens on their network.
Being in the cloud world now where organization are planning to have their application over cloud, one of the requirement will be to have some communication happen between their application on cloud and application/tools/databases etc inside their premises. Organization can not do away with firewall security too. So what is the solution here.
Cast Iron live cloud integration add on in Bluemix actually help you achieve this, communication in a secure manner without compromising on your firewall security. Lately I was playing with this service and found it really worth in achieving the kind if integration most of the organization require.
Cast Iron live allow to create a secure connector between a system behind firewall and cast iron service on the Bluemix. This service that communicate with the application. So in summary cast iron live create a secure channel between the application and the system behind firewall in such a way that security is not compromised.
Overall the process includes creating a cast iron service on Bluemix, installing the secure connector in the system and configuring it, creating end points and defining inputs/output of various endpoint defined using cast iron studio, deploying it and using the end points to access the system in your application. Cast iron studio supports various end points including database (jdbc access), HTTP, HTTPs etc. I am planning to cover each of these steps in my next blog entry. Till than keep reading and experimenting with Bluemix and various services available.
I am sure you might have been wondering where I lost after writing a lot on exploring Bluemix and my answer is I was making a transition from exploring Bluemix to developing with Bluemix. After so much of learning with Bluemix, I decided to develop one real application to see how fast I can do that. Last 1 month or so was spent on this. Along with my office work I was spending around 4-5 Hours a week on this. The application I was developing was for on demand car pooling. So here is my experience.
So overall it took me only a full week work to put this application together and make it live.
I am sure You can guess now how easy it to put a live website/portal using Bluemix platform. Have you given it a try ? If no do try it out.
Any problem, do let me know and we can work together to solve it.
One of my basic experiment on the BlueMix was to create a database and see if I can move my local database to the cloud and free up my resources. I knew that I can create my own database and work with it in Blu Acceleration offering, But than for an existing database users, chances are high that there is already a database in local system. So the first thing one has to do it to move the existing database into the cloud and free his local system/infrastructure. I decided to try it out.
I didn't have a working database in my system so I thought of creating one for this experiment. I have a DB2 10.5 installed on my system so I decided to create sample database using db2sampl tool which comes along with the server installation. This tool create a sample database with some tables, indexes, views, stored procedure and many more objects and load data. So once can say that it is similar to a production database but of minimum size.
After logging into the BlueMix portal and adding Blu Acceleration offering, I get a console to manage the service. Below is the snapshot of the Blu Acceleration Web console
So I have the option of designing my database or using existing data models. Under “design your database”, it do give option to use product like InfoSphere Data Architect to model your database locally and deploy it back on the cloud. I also have option to load data from various sources to the existing table (which I can do only when I have my tables created).
Being a public offering, whenever you add Blu Acceleration service to cloud application, a database get created or get shared with you with a user id. You are given access to a schema and you can create object in this schema. This means that one doesn't have the full control over the database. This prohibits user to do a recovery of the whole database as this might disrupt other users. BlueMix gives you the following options to actually move your database to cloud.
Once you have the DDL extracted from my local system, Go to the “Work with Table “option as shown in the below snapshot
One you select the option, You see the following screen
So the next step was to run the DDLs, Click on + sign gives a box to run the DDLs
While using this option, one may need to make sure that you create tables and objects in a way that objects with dependencies are created only after the object on which they are depend on. So you may need ti divide your DDL in that way.
I will share the details on this option in my next entry