29
Fri, Nov
0 New Articles

TechTip: Get a Grip on Your IBM i Databases with IBM Data Studio

Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

Increase your database understanding with this free IBM tool.

 

Your physical database implementation plays a key role in the performance and extensibility of your application. Because the AS/400's integrated relational database was so easy to use, many programmers created physical files and logical files without giving much thought to the database model. This approach has resulted in many unwieldy physical databases that are hard to understand.

 

Data modeling tools help teams build efficient new databases as well as maintain existing database implementations. IBM Data Studio is a relatively new, no-charge tool from IBM that includes support for physical data modeling. This physical data model supports DB2 for i databases. This functionality even includes some support for DB2 for i objects created with DDS.

 

IBM Data Studio doesn't provide support for logical data modeling, but the physical data model support can improve your database understanding and maintenance. If your team is looking for an IBM tool that supports both logical and physical data modeling, you could download a trial evaluation copy of the IBM InfoSphere Data Architect product.  

 

IBM Data Studio manages all of the tasks through the use of projects. To launch Data Studio and create a new project, perform the following steps:

  1. From the Windows Start menu, click All Programs > Data Studio > Data Studio Client.
  2. From the File menu, select the New task and create a Data Design project. In this example, the project name is Project2. Click Finish to finalize the project creation process.

 

To start the process of generating a graphical representation of the IBM i physical database model, right-click on the newly created Data Design project and select the New > Physical Data Model task as shown in Figure 1.

100413Millilganfig1                       

Figure 1: Create a new physical data model.

 

The next step is identifying the target database to model, as shown in Figure 2. The first input field will contain the name of the newly created Data Design project. The next input field allows you to name the data model. In this example, the name is My Database Model. Obviously, the database value will be DB2 for i, and then you need to select the operating system version that is installed on your target IBM i system. In this case, an existing database is being modeled, so select the "Create from reverse engineering" check box. After selecting this option, click Next to continue.

 

100413Millilganfig2

Figure 2: In the New Physical Data Model window, identify the target database to model.


Selecting the connection for the DB2 for i server that houses the database you want to analyze is the next step. Figure 3 contains the Select Connection page. Create a connection for your DB2 for i server by clicking on New.

 

100413Millilganfig3

Figure 3: Specify the connection for the DB2 for i server.

 

The New Connection window in Figure 4 presents the input fields for defining a new database connection. The default naming convention results in the generation of a connection name based on the database or host name for your IBM i server. From the JDBC driver drop-down list, you will find several driver options. The majority of IBM i programmers select AS/400 Toolbox for Java because this JDBC driver is available at no charge. The IBM Toolbox for Java is automatically included with the IBM i operating system software. You can also download this JDBC driver from the JTOpen website. JTOpen is the open-source version of the IBM Toolbox for Java.

 

The Host name is the TCP/IP host name of your IBM i server. This interface also allows you to override the default schema value (the authorization ID) that is used while running the SQL routine for any SQL statements that contain unqualified table or view references. If a value is not specified, the default value is Authorization ID. The IBM i equivalent of an authorization ID is a user profile.

100413Millilganfig4

Figure 4: The New Connection properties page looks like this.

 

You can either verify that you have set up the connection correctly by clicking Test Connection or move the process along by selecting Next. The next window provides you with an optional Data Privacy Modeling step that allows you to associate the new connection with a physical data model. This is an optional step. Click Next to continue.

 

You are then presented with the Filter window shown in Figure 5. This is an optional step that allows you to specify particular schemas that are available or not available to a database connection. It's often a good idea to exclude some of the IBM-provided schemas that start with letter Q.

 

100413Millilganfig5

Figure 5: The Filter page allows you to specify a schema.

 

Click Finish to complete the creation of the connection. With the database connection created, left-click to choose that connection on the Select Connection window (Figure 3). Click Next to move on to the next step in the modeling process.

 

Figure 6 displays the Select Objects page where you can specify the schema (or library) that contains the DB2 objects that you want to reverse engineer. You can select a single schema or multiple schemas. You can select the schema from the list of schemas associated with the schema or type in a filter string to narrow the list to your target schema. After selecting the schema, click Next to advance to the final step in the process.

100413Millilganfig6

Figure 6: Select the schema.

 

The Database Elements page (shown in Figure 7) allows you to select the type of database objects that can appear in your physical data model. In this example, tables are the only object type that will be included in the diagram. After selecting the required database element types, click Finish to build the physical data model.

100413Millilganfig7

Figure 7: Select database element types.

 

After the physical data model is built, you will be taken to the Physical Data Model Editor view (refer to Figure 8). To generate the visualization diagram, your first step is to expand the data object (ctcdbv7r1.rchland.ibm.com) associated with the physical data model object (My Database Model.dbm). After the data object has been expanded, you need to right-click the Diagrams folder and click New Overview Diagram.

 

100413Millilganfig8

Figure 8: This is the Physical Data Model Editor view.

 

The first input field in the Overview Diagram Selection dialog box (shown in Figure 9) allows you to supply a name for the diagram. The Implicit relationships option enables Data Studio to find relationships between DB2 objects by looking for common column names. Data Studio uses foreign key constraint definitions to find explicit relationships between tables. The "Include selected elements" section enables you to include a subset of the objects from the data model in the diagram. If a selected DB2 object references an unselected DB2 object, the "Automatically select referenced elements" checkbox controls whether or not that object is included in the diagram.

 

100413Millilganfig9

Figure 9: Here's the Overview Diagram Selection dialog box.

 

Figure 10 contains the data diagram generated by Data Studio for the selected database objects. The boxes in the diagram (for example, Project) are the tables in the data model's schema. The identifiers associated with the connecting lines between tables are the constraint names. Data Studio enables you to rearrange objects in the diagram, change text formatting, and add notes to the diagram to make the diagram easier to read. You can also add database objects that were not selected earlier in the process.

 

100413Millilganfig10

Figure 10: The data diagram output looks like this.

 

The column definitions for a table or physical file can be accessed from the model diagram by first clicking the table object in the diagram. After the table is selected, right-click and click Show Properties View as shown in Figure 11. After that task has been selected, the lower-right pane of the window displays a table properties view. Clicking on the Columns tab provides a list of the columns in the table and the attributes for each column.

 

Data Studio also allows you to print the diagram or save the diagram into an image file so that the diagram can be easily shared with other team members.

 

The Data Studio physical data model and data diagram tooling does support DB2 for i objects created with data description specifications (DDS). Data Studio categorizes logical file objects as views, so keep that in mind when selecting database object types to include in your physical data model.

100413Millilganfig11

Figure 11: The Show Properties view allows you to see table properties.

 

Hopefully, you can now appreciate how much easier it is to understand your database design with the physical data modeling capabilties that the Data Studio tooling offers. Data Studio provides more than physical modeling capabilities; a complete listing of the features that are supported with DB2 for i databases can be found here.

 

Kent Milligan
Kent Milligan is a Senior Db2 for i Consultant in the IBM Lab Services Power Systems Delivery Practice.  Kent has over 25 years of experience as a Db2 for IBM i consultant and developer working out of the IBM Rochester lab. Prior to re-joining the DB2 for i Lab Services practice in 2020, Kent spent 5 years working on healthcare solutions powered by IBM Watson technologies. Kent is a sought-after speaker and author on Db2 for i & SQL topics.
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  • SB Profound WC 5536 Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application. You can find Part 1 here. In Part 2 of our free Node.js Webinar Series, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Brian will briefly discuss the different tools available, and demonstrate his preferred setup for Node development on IBM i or any platform. Attend this webinar to learn:

  • SB Profound WP 5539More than ever, there is a demand for IT to deliver innovation. Your IBM i has been an essential part of your business operations for years. However, your organization may struggle to maintain the current system and implement new projects. The thousands of customers we've worked with and surveyed state that expectations regarding the digital footprint and vision of the company are not aligned with the current IT environment.

  • SB HelpSystems ROBOT Generic IBM announced the E1080 servers using the latest Power10 processor in September 2021. The most powerful processor from IBM to date, Power10 is designed to handle the demands of doing business in today’s high-tech atmosphere, including running cloud applications, supporting big data, and managing AI workloads. But what does Power10 mean for your data center? In this recorded webinar, IBMers Dan Sundt and Dylan Boday join IBM Power Champion Tom Huntington for a discussion on why Power10 technology is the right strategic investment if you run IBM i, AIX, or Linux. In this action-packed hour, Tom will share trends from the IBM i and AIX user communities while Dan and Dylan dive into the tech specs for key hardware, including:

  • Magic MarkTRY the one package that solves all your document design and printing challenges on all your platforms. Produce bar code labels, electronic forms, ad hoc reports, and RFID tags – without programming! MarkMagic is the only document design and print solution that combines report writing, WYSIWYG label and forms design, and conditional printing in one integrated product. Make sure your data survives when catastrophe hits. Request your trial now!  Request Now.

  • SB HelpSystems ROBOT GenericForms of ransomware has been around for over 30 years, and with more and more organizations suffering attacks each year, it continues to endure. What has made ransomware such a durable threat and what is the best way to combat it? In order to prevent ransomware, organizations must first understand how it works.

  • SB HelpSystems ROBOT GenericIT security is a top priority for businesses around the world, but most IBM i pros don’t know where to begin—and most cybersecurity experts don’t know IBM i. In this session, Robin Tatam explores the business impact of lax IBM i security, the top vulnerabilities putting IBM i at risk, and the steps you can take to protect your organization. If you’re looking to avoid unexpected downtime or corrupted data, you don’t want to miss this session.

  • SB HelpSystems ROBOT GenericCan you trust all of your users all of the time? A typical end user receives 16 malicious emails each month, but only 17 percent of these phishing campaigns are reported to IT. Once an attack is underway, most organizations won’t discover the breach until six months later. A staggering amount of damage can occur in that time. Despite these risks, 93 percent of organizations are leaving their IBM i systems vulnerable to cybercrime. In this on-demand webinar, IBM i security experts Robin Tatam and Sandi Moore will reveal:

  • FORTRA Disaster protection is vital to every business. Yet, it often consists of patched together procedures that are prone to error. From automatic backups to data encryption to media management, Robot automates the routine (yet often complex) tasks of iSeries backup and recovery, saving you time and money and making the process safer and more reliable. Automate your backups with the Robot Backup and Recovery Solution. Key features include:

  • FORTRAManaging messages on your IBM i can be more than a full-time job if you have to do it manually. Messages need a response and resources must be monitored—often over multiple systems and across platforms. How can you be sure you won’t miss important system events? Automate your message center with the Robot Message Management Solution. Key features include:

  • FORTRAThe thought of printing, distributing, and storing iSeries reports manually may reduce you to tears. Paper and labor costs associated with report generation can spiral out of control. Mountains of paper threaten to swamp your files. Robot automates report bursting, distribution, bundling, and archiving, and offers secure, selective online report viewing. Manage your reports with the Robot Report Management Solution. Key features include:

  • FORTRAFor over 30 years, Robot has been a leader in systems management for IBM i. With batch job creation and scheduling at its core, the Robot Job Scheduling Solution reduces the opportunity for human error and helps you maintain service levels, automating even the biggest, most complex runbooks. Manage your job schedule with the Robot Job Scheduling Solution. Key features include:

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • LANSAWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed. Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

  • LANSASupply Chain is becoming increasingly complex and unpredictable. From raw materials for manufacturing to food supply chains, the journey from source to production to delivery to consumers is marred with inefficiencies, manual processes, shortages, recalls, counterfeits, and scandals. In this webinar, we discuss how:

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • Profound Logic Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application.

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: