Db2 basics tutorial: Working with Db2 for z/OS interactively
This tutorial shows you how to use Db2 for z/OS in the z/OS® terminal interface to complete some basic database administration tasks.
You might use many different tools and environments to work with Db2 for z/OS in your job. Many of these methods use batch jobs or database applications that are programmed in advance and that run in the background, with little or no direct human interaction.
However, you can also work with Db2 for z/OS through interactive methods such as commands and menu-style user interfaces. For example, you can use the SPUFI (SQL processor using file input) facility within the DB2I (Db2 Interactive) primary option menu of ISPF to work with SQL statements interactively. You can edit SQL statements in SPUFI, issue the statements, and see the results immediately.
This tutorial consists of two modules:
Learning objectives
- Become familiar with working with Db2 in the z/OS terminal interface.
- Learn how to query and modify data interactively by submitting SQL statements through SPUFI.
- Learn how to create Db2 tables interactively by using SPUFI.
- Learn how to run Db2 utilities from the DB2I utilities panel and by submitting JCL jobs.
Audience
This tutorial is intended for new database professionals who have some familiarity with the basic concepts of relational database management systems and the SQL language, but who are new to Db2 for z/OS and the z/OS terminal interface.
Users of this tutorial will be more successful if they are familiar with the following information:
Before you begin
- Ensure that you have access to a supported version of Db2 and that the Db2 sample tables have been created.
- Determine the name of the Db2 subsystem that contains the sample tables. This tutorial uses the subsystem name DB2A.
- Obtain a Db2 authorization ID and password that has appropriate authorities to query the Db2 sample tables and create objects. This tutorial uses the authorization ID TUTOR01.
Conventions used in this tutorial
- This tutorial uses standard z/OS terminal key names. These keys might be mapped differently on your keyboard. For example, the standard z/OS terminal key name is PF3. In the standard mapping, the PF3 key corresponds to the F3 key on the keyboard; however, the key that you press depends on your keyboard mapping.
For more information about keyboard mapping in TSO and ISPF, see the following topics:
- Samples refer to the sample tables that are supplied with Db2 for z/OS.
- Certain panels, especially outside of DB2I, are likely to be customized at your site and are likely to have different names than the names that are used in this tutorial.
For example, the
ISPF/PDF Primary Option Menu
is the default name of a panel that is configured during a step of the Db2 for z/OS installation process. This panel might have a different name at your site. If you cannot find the corresponding panels, ask a colleague for help.
Related information
- Module 1: Querying and modifying data
You can interactively query and modify data that is stored in Db2 for z/OS by issuing SQL statements through SPUFI. - Module 2: Running Db2 utilities
IBM® Db2 utilities are tools that help maintain data in your Db2 for z/OS databases. Generally, you use Db2 utilities to perform large-scale operations across one or more table spaces. You can use several different methods to run Db2 utilities. This module shows you two of these methods: using a Db2 Interaction (DB2I) panel and writing job control language (JCL) jobs.