iSeries Administration

Embed Size (px)

Citation preview

  • 8/6/2019 iSeries Administration

    1/22

    iSeries

    AdministrationVersion 5 Release 3

    ERserver

  • 8/6/2019 iSeries Administration

    2/22

  • 8/6/2019 iSeries Administration

    3/22

    iSeries

    AdministrationVersion 5 Release 3

    ERserver

  • 8/6/2019 iSeries Administration

    4/22

    NoteBefore using this information and the product it supports, be sure to read the information inNotices, on page 11.

    Eighth Edition (August 2005)

    This edition applies to version 5, release 3, modification 0 of IBM Operating System/400 (product number 5722-SS1)and to all subsequent releases and modifications until otherwise indicated in new editions. This version does notrun on all reduced instruction set computer (RISC) models nor does it run on CISC models.

    Copyright International Business Machines Corporation 1998, 2005. All rights reserved.US Government Users Restricted Rights Use, duplication or disclosure restricted by GSA ADP Schedule Contractwith IBM Corp.

  • 8/6/2019 iSeries Administration

    5/22

    Contents

    Administration . . . . . . . . . . . . 1Print this topic. . . . . . . . . . . . . . 1

    Database administration . . . . . . . . . . 2Alter and manage database objects . . . . . . 2Create database objects . . . . . . . . . . 3Ensure data integrity . . . . . . . . . . 4Import and export databetween systems . . . . 4Work with mulitple databases . . . . . . . 4Work with triggers and constraints . . . . . . 4Write DB2 programs . . . . . . . . . . . 5

    Database backup and recovery . . . . . . . . 5Distributed database administration . . . . . . 6

    Queries and reports . . . . . . . . . . . . 6Changes to Query for iSeries . . . . . . . . 7

    Security . . . . . . . . . . . . . . . . 9

    Appendix. Notices . . . . . . . . . . 11Programming Interface Information . . . . . . 13Trademarks . . . . . . . . . . . . . . 13Terms and conditions for downloading and printingpublications . . . . . . . . . . . . . . 13Code example disclaimer . . . . . . . . . . 14

    Copyright IBM Corp. 1998, 2005 iii

  • 8/6/2019 iSeries Administration

    6/22

    iv iSeries: Administration

  • 8/6/2019 iSeries Administration

    7/22

    Administration

    The Administration topic provides the key information for DB2 UDB(TM) for iSeries(TM). Follow theselinks to find a specific topic in one of the DB2(R) Universal Database(TM) for iSeries Information Center

    resources.

    You can also explore other database information using the main navigationbar or the Database finder.

    Print this topicView and print this topic in PDF format.

    Commitment controlLearn how to use commitment control to ensure data integrity. Commitment control allows you todefine and process a group of changes to resources, such as database files or tables, as a transaction.

    Database backup and recoveryBacking up your data regularly is an important practice in the event that data recovery is necessary.See this topic for methods of database backup and recovery.

    Database administrationSee several topics that will help you to manage your database.

    Distributed database administrationLearn how to set up and maintain databases distributed across several systems.

    Queries and reportsCreate and run queries using various methods, including SQL, the OPNQRYF command, theOS/400(R) Create Query API (QQQQRY), ODBC, and Query for iSeries.

    SecurityAuthorizing users to data at the system and data levels allows you to control access to yourdatabase. These links describe various security methods for controlling your database.

    Note: Read the Code example disclaimer on page 14 for important legal information.

    Print this topic

    To view or download the PDF version of this document, select Administration (about 217 KB).

    Saving PDF files

    To save a PDF on your workstation for viewing or printing:

    1. Right-click the PDF in yourbrowser (right-click the link above).

    2. Click Save Target As... if you are using Internet Explorer. Click Save Link As... if you are usingNetscape Communicator.

    3. Navigate to the directory in which you would like to save the PDF.

    4. Click Save.

    Downloading Adobe Acrobat Reader

    Copyright IBM Corp. 1998, 2005 1

    http://../rzatd/rzatdfinder.htmhttp://../rzatd/rzatdfinder.htmhttp://../rzatd/rzatdfinder.htmhttp://rzahf.pdf/http://rzahf.pdf/http://../rzatd/rzatdfinder.htm
  • 8/6/2019 iSeries Administration

    8/22

    You need Adobe Acrobat Reader to view or print these PDFs. You can download a copy from the

    Adobe Web site (www.adobe.com/products/acrobat/readstep.html) .

    Database administration

    Database administration contains the following topics:

    Alter and manage database objectsThe iSeries server provides both SQL and system methods for altering and managing the databaseobjects you create. These links show you how to work with library, table, view, journal, alias, andindex objects.

    Create database objectsThe first step in developing your database is to create the objects that will hold your data. Thiscategory covers both SQL and file-based methods for creating tables, views, and indexes (with SQL)as well as physical and logical files (with file-based methods).

    Ensure data integrityiSeries provides several different integrity measures, including constraints, trigger programs, and

    commitment control.

    Import and export data between systemsThis topic describes how to load and unload databetween systems.

    Manage journalsYou can use journal management to audit database and other activities on your server, as well asrecover changes.

    Work with multiple databasesSet up multiple independent user databases on your iSeries. This topic describes how to useindependent disk pools to configure multiple databases.

    Work with triggers and constraints on page 4Triggers and constraints can be used to manipulate and manage data in your database tables. Theselinks describe different methods for adding and using triggers and constraints.

    Write DB2 programs on page 5This topic describes the various ways to write applications to access DB2 UDB for iSeries.

    Alter and manage database objectsThere are several methods available for working with database objects. You can use the iSeries Navigatorinterface, SQL methods, or the traditional file interface. The table below shows the available optionsforeach task. Click the appropriate X for more information about performing the task.

    The iSeries Navigator tasks are documented in the Online help. For more information about accessingiSeries Navigator objects and using Online help, see iSeries Navigator database tasks.

    Task iSeries Navigator SQL Traditional file interface

    Display table (file)attributes (catalog)

    X X X

    Drop database objects X X X

    Change schema (library) list X X

    Add a column to a table X X X

    2 iSeries: Administration

    http://www.adobe.com/products/acrobat/readstep.htmlhttp://www.adobe.com/products/acrobat/readstep.htmlhttp://../rzatc/rzatccreateobj.htmhttp://../rzatc/rzatccreateobj.htmhttp://../rzatc/rzatccreateobj.htmhttp://../rzatc/rzatccreateobj.htmhttp://../db2/rbafzmstcatalog.htmhttp://../dbp/rbafodfdes.htmhttp://../rzatc/rzatccreateobj.htmhttp://../sqlp/rbafysqlpcdropping.htmhttp://../cl/dltf.htmhttp://../rzatc/rzatccreateobj.htmhttp://../cl/chglibl.htmhttp://../rzatc/rzatccreateobj.htmhttp://../sqlp/rbafyaddcol.htmhttp://../cl/chgpf.htmhttp://../cl/chgpf.htmhttp://../sqlp/rbafyaddcol.htmhttp://../rzatc/rzatccreateobj.htmhttp://../cl/chglibl.htmhttp://../rzatc/rzatccreateobj.htmhttp://../cl/dltf.htmhttp://../sqlp/rbafysqlpcdropping.htmhttp://../rzatc/rzatccreateobj.htmhttp://../dbp/rbafodfdes.htmhttp://../db2/rbafzmstcatalog.htmhttp://../rzatc/rzatccreateobj.htmhttp://../rzatc/rzatccreateobj.htmhttp://www.adobe.com/products/acrobat/readstep.html
  • 8/6/2019 iSeries Administration

    9/22

    Task iSeries Navigator SQL Traditional file interface

    Add or alter an identitycolumn

    X X

    Change a table (file)definition

    X X X

    Copy a table (file) X X

    Copy column definitions X

    Display contents of tables(files) and views

    X X X

    Display locked rows(records)

    X X

    Edit table (file) data X X X

    Move a table (file) X X

    Reorganize a table (file) X X

    Altering a sequence X X

    Create database objectsThe first step in developing any DB2 Universal Database database is to create the database objects thatwill hold the actual data. For SQL-based databases, you create tables, views, and indexes; for system filedatabases, you create physical or logical files.

    Once these basic objects exist you can Alter and manage database objects on page 2 them, as needed.

    You can create objects using iSeries Navigator, SQL, or the traditional file interface. The table belowshows the available options for each task. Click the appropriate X for more information aboutperforming the task.

    The iSeries Navigator tasks are documented in the Online help. For more information about accessing

    iSeries Navigator objects and using Online help, see iSeries Navigator database tasks.

    Task iSeries Navigator SQL Traditional file interface

    Create a map of databaseobject relationships

    X

    Create a package X X X

    Create a schema (library) X X

    Create a stored procedure X X

    Create a table (file) X X X

    Create a user-definedfunction

    X X

    Create a user-defined type X X

    Create a view or logical file X X X

    Create an alias X X X

    Create an index or accesspath

    X X X

    Create an object using RunSQL Scripts

    X

    Generate SQL for databaseobjects

    X

    Administration 3

    http://../rzatc/rzatccreateobj.htmhttp://../sqlp/rbafysqlpidentity.htmhttp://../rzatc/rzatccreateobj.htmhttp://../sqlp/rbafyalter.htmhttp://../dbp/rbafomngcom.htmhttp://../rzatc/rzatccreateobj.htmhttp://../dbp/rbafocopytable.htmhttp://../rzatc/rzatccreateobj.htmhttp://../rzatc/rzatccreateobj.htmhttp://../sqlp/rbafyviewnt.htmhttp://../dbp/rbaforddbf.htmhttp://../rzatc/rzatccreateobj.htmhttp://../dbp/rbafodsprcdlck.htmhttp://../rzatc/rzatccreateobj.htmhttp://../sqlp/rbafydml.htmhttp://../dbp/rbafoupdbr.htmhttp://../rzatc/rzatccreateobj.htmhttp://../dbp/rbafomovetable.htmhttp://../dbp/rbaforrgton.htmhttp://../dbp/rbaforrgpf.htmhttp://../rzatc/rzatccreateobj.htmhttp://../sqlp/rbafysequence.htmhttp://../rzatc/rzatccreateobj.htmhttp://../rzatc/rzatccreateobj.htmhttp://../rzatc/rzatccreateobj.htmhttp://../rzatc/rzatccreateobj.htmhttp://../rzatc/rzatccreateobj.htmhttp://../sqlp/rbafypack1.htmhttp://../db2/rbafzmstpackageap.htmhttp://../rzatc/rzatccreateobj.htmhttp://../sqlp/rbafysqlpcschema.htmhttp://../rzatc/rzatccreateobj.htmhttp://../sqlp/rbafysqlproc.htmhttp://../rzatc/rzatccreateobj.htmhttp://../sqlp/rbafysqlpctablecreate.htmhttp://../dbp/rbafocrepf.htmhttp://../rzatc/rzatccreateobj.htmhttp://../sqlp/rbafyudfdudf.htmhttp://../rzatc/rzatccreateobj.htmhttp://../sqlp/rbafydefudt.htmhttp://../rzatc/rzatccreateobj.htmhttp://../sqlp/rbafyviewnt.htmhttp://../dbp/rbafocrlof.htmhttp://../rzatc/rzatccreateobj.htmhttp://../sqlp/rbafycreatingalias.htmhttp://../dbp/rbafodesckw.htmhttp://../rzatc/rzatccreateobj.htmhttp://../sqlp/rbafycrtindx.htmhttp://../dbp/rbafoapath.htmhttp://../rzatc/rzatccreateobj.htmhttp://../rzatc/rzatccreateobj.htmhttp://../rzatc/rzatccreateobj.htmhttp://../rzatc/rzatccreateobj.htmhttp://../dbp/rbafoapath.htmhttp://../sqlp/rbafycrtindx.htmhttp://../rzatc/rzatccreateobj.htmhttp://../dbp/rbafodesckw.htmhttp://../sqlp/rbafycreatingalias.htmhttp://../rzatc/rzatccreateobj.htmhttp://../dbp/rbafocrlof.htmhttp://../sqlp/rbafyviewnt.htmhttp://../rzatc/rzatccreateobj.htmhttp://../sqlp/rbafydefudt.htmhttp://../rzatc/rzatccreateobj.htmhttp://../sqlp/rbafyudfdudf.htmhttp://../rzatc/rzatccreateobj.htmhttp://../dbp/rbafocrepf.htmhttp://../sqlp/rbafysqlpctablecreate.htmhttp://../rzatc/rzatccreateobj.htmhttp://../sqlp/rbafysqlproc.htmhttp://../rzatc/rzatccreateobj.htmhttp://../sqlp/rbafysqlpcschema.htmhttp://../rzatc/rzatccreateobj.htmhttp://../db2/rbafzmstpackageap.htmhttp://../sqlp/rbafypack1.htmhttp://../rzatc/rzatccreateobj.htmhttp://../rzatc/rzatccreateobj.htmhttp://../rzatc/rzatccreateobj.htmhttp://../sqlp/rbafysequence.htmhttp://../rzatc/rzatccreateobj.htmhttp://../dbp/rbaforrgpf.htmhttp://../dbp/rbaforrgton.htmhttp://../dbp/rbafomovetable.htmhttp://../rzatc/rzatccreateobj.htmhttp://../dbp/rbafoupdbr.htmhttp://../sqlp/rbafydml.htmhttp://../rzatc/rzatccreateobj.htmhttp://../dbp/rbafodsprcdlck.htmhttp://../rzatc/rzatccreateobj.htmhttp://../dbp/rbaforddbf.htmhttp://../sqlp/rbafyviewnt.htmhttp://../rzatc/rzatccreateobj.htmhttp://../rzatc/rzatccreateobj.htmhttp://../dbp/rbafocopytable.htmhttp://../rzatc/rzatccreateobj.htmhttp://../dbp/rbafomngcom.htmhttp://../sqlp/rbafyalter.htmhttp://../rzatc/rzatccreateobj.htmhttp://../sqlp/rbafysqlpidentity.htmhttp://../rzatc/rzatccreateobj.htm
  • 8/6/2019 iSeries Administration

    10/22

    Task iSeries Navigator SQL Traditional file interface

    Create a sequence X X

    Ensure data integrityProtecting your database against inadvertent insertions, deletions, and updates is accomplished using

    commitment control, constraints, and triggers. Constraints basically govern how data values can change,while triggers are automatic actions that start, or trigger, an event, such as an update of a specific table.

    Select one of the following topics:

    v Ensure data integrity with commitment control

    v Work with triggers and constraints

    Import and export data between systemsImporting data is the process of retrieving data from external sources, while exporting data is the processof extracting data from DB2 Universal Database for iSeries and copying the data to another server.

    Importing data into DB2 Universal Database for iSeries can be a one-time event or it can be an ongoing

    task, like weekly updates for business reporting purposes. These types of data moves are typicallyaccomplished through import, export, or load functions.

    Select one of the following topics:

    v File management: Copying database files

    v Copying a table

    v Moving a table

    v Copy source file data

    v Loading and unloading data from non-iSeries systems

    The Query Management Programming manual also contains information about importing andexporting data between servers.

    Work with mulitple databasesWith iSeries servers, you can work with multiple databases. The iSeries server provides a systemdatabase (often referred to as SYSBAS) and the ability to work with one or more user databases. Userdatabases are implemented on the iSeries server through the use of independent disk pools, which are setup in the Disk Management function of iSeries Navigator. Once an independent disk pool is set up, itappears as another database under the Databases function of iSeries Navigator.

    When you expand an iSeries server in iSeries Navigator and then expand Databases, a list of databasesappears that you can work with. To establish a connection to a database, expand the database that youwant to work with.

    For more information about working with multiple databases, see the Disk Management topic.

    Work with triggers and constraintsA trigger is a type of stored procedure program that is automatically called whenever a specified action isperformed on a specific table. Triggers are useful for keeping audit trails, for detecting exceptionalconditions, for maintaining relationships in the database, and for running applications and operationsthat coincide with the change operation.

    4 iSeries: Administration

    http://../rzatc/rzatccreateobj.htmhttp://../db2/rbafzmstcsequence.htmhttp://../rzakj/rzakjcommitkickoff.htmhttp://../rzakj/rzakjcommitkickoff.htmhttp://../rzakj/rzakjcommitkickoff.htmhttp://../rzakj/rzakjcommitkickoff.htmhttp://../rzakj/rzakjcommitkickoff.htmhttp://../dm/rbal3copyfile.htmhttp://../dm/rbal3copyfile.htmhttp://../dm/rbal3copyfile.htmhttp://../dbp/rbafocopytable.htmhttp://../dbp/rbafocopytable.htmhttp://../dbp/rbafocopytable.htmhttp://../dbp/rbafomovetable.htmhttp://../dbp/rbafomovetable.htmhttp://../dbp/rbafomovetable.htmhttp://../dbp/rbafosrccpy.htmhttp://../dbp/rbafosrccpy.htmhttp://../dbp/rbafosrcimex.htmhttp://../dbp/rbafosrcimex.htmhttp://../dbp/rbafosrcimex.htmhttp://../dbp/rbafosrcimex.htmhttp://../dbp/rbafosrcimex.htmhttp://../dbp/rbafosrcimex.htmhttp://../books/sc415703.pdfhttp://../books/sc415703.pdfhttp://../books/sc415703.pdfhttp://../rzaly/rzalydmkickoff.htmhttp://../rzaly/rzalydmkickoff.htmhttp://../rzaly/rzalydmkickoff.htmhttp://../books/sc415703.pdfhttp://../dbp/rbafosrcimex.htmhttp://../dbp/rbafosrccpy.htmhttp://../dbp/rbafomovetable.htmhttp://../dbp/rbafocopytable.htmhttp://../dm/rbal3copyfile.htmhttp://../rzakj/rzakjcommitkickoff.htmhttp://../db2/rbafzmstcsequence.htmhttp://../rzatc/rzatccreateobj.htm
  • 8/6/2019 iSeries Administration

    11/22

    Constraints are restrictions or limitations that you place on your database. Constraints are implementedat the table level. You can use constraints to create referential integrity in your database.

    You can work with triggers and constraints using iSeries Navigator, SQL, or the traditional file interface.The table below shows the available options for each task. Click the appropriate X for moreinformation about performing the task.

    The iSeries Navigator tasks are also documented in the Online help. For more information aboutaccessing iSeries Navigator objects and using Online help, see iSeries Navigator database tasks.

    Task iSeries Navigator SQL Traditional file interface

    Write an external triggerprogram

    X X

    Add an external trigger X X

    Add an SQL trigger X X

    Write an SQL triggerprogram

    X X

    Enable and disable a trigger X X

    Remove a trigger X X XCreate a key constraint X X X

    Remove a key constraint X X X

    Create a referentialconstraint

    X X X

    Enable and disable areferential constraint

    X X

    Remove a referentialconstraint

    X X X

    Create a check constraint X X X

    Remove a check constraint X X X

    Manage check pendingconstraints

    X

    Write DB2 programsDB2 Universal Database for iSeries provides many methods for programmatically accessing or updatingiSeries data.

    Select one of the following topics:

    v Write a program that uses embedded SQL

    v Write an external function program

    v

    Write an external procedure programv Write an external trigger

    v Write an SQL CLI application

    v Write applications that use SQL

    Database backup and recovery

    Saving your data can be time-consuming and requires discipline. However, it is crucial that you back upyour data because you never know when you may need to do a server recovery. Use the topics listedhere to properly back up your data and recover it if necessary.

    Administration 5

    http://../rzatc/rzatccreateobj.htmhttp://../rzatc/rzatccreateobj.htmhttp://../rzatc/rzatccreateobj.htmhttp://../dbp/rbaforzahftrn.htmhttp://../cl/addpftrg.htmhttp://../rzatc/rzatccreateobj.htmhttp://../dbp/rbaforzahftrb.htmhttp://../rzatc/rzatccreateobj.htmhttp://../sqlp/rbafydb2triggers.htmhttp://../dbp/rbaforzahftrb.htmhttp://../sqlp/rbafysqltrig.htmhttp://../rzatc/rzatccreateobj.htmhttp://../dbp/rbaforzahftrv.htmhttp://../rzatc/rzatccreateobj.htmhttp://../db2/rbafzmstdropst.htmhttp://../dbp/rbaforzahftrp.htmhttp://../rzatc/rzatccreateobj.htmhttp://../sqlp/rbafyconstex.htmhttp://../dbp/rbaforzahfcod.htmhttp://../rzatc/rzatccreateobj.htmhttp://../sqlp/rbafyaddconstraints.htmhttp://../dbp/rbaforzahfcof.htmhttp://../rzatc/rzatccreateobj.htmhttp://../sqlp/rbafyaddor.htmhttp://../dbp/rbaforzahfrce.htmhttp://../rzatc/rzatccreateobj.htmhttp://../dbp/rbaforzahfrcy.htmhttp://../rzatc/rzatccreateobj.htmhttp://../sqlp/rbafyaddor.htmhttp://../dbp/rbaforzahfrc0.htmhttp://../rzatc/rzatccreateobj.htmhttp://../sqlp/rbafycheckcon.htmhttp://../dbp/rbaforzahfcod.htmhttp://../rzatc/rzatccreateobj.htmhttp://../sqlp/rbafycheckcon.htmhttp://../dbp/rbaforzahfcof.htmhttp://../rzatc/rzatccheckpend.htmhttp://../rzajp/rzajpkickoff.htmhttp://../rzajp/rzajpkickoff.htmhttp://../rzajp/rzajpkickoff.htmhttp://../rzajp/rzajpkickoff.htmhttp://../sqlp/rbafywudfextern.htmhttp://../sqlp/rbafywudfextern.htmhttp://../sqlp/rbafywudfextern.htmhttp://../sqlp/rbafydfnid.htmhttp://../sqlp/rbafydfnid.htmhttp://../dbp/rbaforzahftrb.htmhttp://../dbp/rbaforzahftrb.htmhttp://../cli/rzadphdovv.htmhttp://../cli/rzadphdovv.htmhttp://../rzajp/rzajpkickoff.htmhttp://../rzajp/rzajpkickoff.htmhttp://../rzajp/rzajpkickoff.htmhttp://../cli/rzadphdovv.htmhttp://../dbp/rbaforzahftrb.htmhttp://../sqlp/rbafydfnid.htmhttp://../sqlp/rbafywudfextern.htmhttp://../rzajp/rzajpkickoff.htmhttp://../rzatc/rzatccheckpend.htmhttp://../dbp/rbaforzahfcof.htmhttp://../sqlp/rbafycheckcon.htmhttp://../rzatc/rzatccreateobj.htmhttp://../dbp/rbaforzahfcod.htmhttp://../sqlp/rbafycheckcon.htmhttp://../rzatc/rzatccreateobj.htmhttp://../dbp/rbaforzahfrc0.htmhttp://../sqlp/rbafyaddor.htmhttp://../rzatc/rzatccreateobj.htmhttp://../dbp/rbaforzahfrcy.htmhttp://../rzatc/rzatccreateobj.htmhttp://../dbp/rbaforzahfrce.htmhttp://../sqlp/rbafyaddor.htmhttp://../rzatc/rzatccreateobj.htmhttp://../dbp/rbaforzahfcof.htmhttp://../sqlp/rbafyaddconstraints.htmhttp://../rzatc/rzatccreateobj.htmhttp://../dbp/rbaforzahfcod.htmhttp://../sqlp/rbafyconstex.htmhttp://../rzatc/rzatccreateobj.htmhttp://../dbp/rbaforzahftrp.htmhttp://../db2/rbafzmstdropst.htmhttp://../rzatc/rzatccreateobj.htmhttp://../dbp/rbaforzahftrv.htmhttp://../rzatc/rzatccreateobj.htmhttp://../sqlp/rbafysqltrig.htmhttp://../dbp/rbaforzahftrb.htmhttp://../sqlp/rbafydb2triggers.htmhttp://../rzatc/rzatccreateobj.htmhttp://../dbp/rbaforzahftrb.htmhttp://../rzatc/rzatccreateobj.htmhttp://../cl/addpftrg.htmhttp://../dbp/rbaforzahftrn.htmhttp://../rzatc/rzatccreateobj.htm
  • 8/6/2019 iSeries Administration

    12/22

    Backup and recoveryLearn how to plan a backup and recovery strategy, back up your server, manage tape libraries, set updisk protection for your data. This topic also includes information about the Backup, Recovery and MediaServices plug-in to iSeries(TM) Navigator, information about recovering your server, and answers to somefrequently asked questions about backup and recovery.

    Recovering and restoring your database

    See this article in the Database Programming topic for the tasks necessary to recover data.

    Journal managementUse journal management to provide a means by which you can record the activity of objects on yoursystem. This topic provides information how to set up, manage, and troubleshoot system-managedaccess-path protection (SMAPP), local journals, and remote journals on an iSeries server.

    Distributed database administration

    Distributed database administration contains the following topics:

    Plan and designDesign a distributed relational database that will best meet your needs.

    Set up a distributed relational databasePrepare you application requesters and application servers to send and receive work.

    Administration and operations tasksLearn the common tasks that a distributed database administrator performs.

    CommunicationsConfigure distributed relational database communications.

    SecurityGuard your distributed relational database against security problems.

    Data availability and protectionProtect and ensure access to your distributed relational database.

    PerformanceImprove the performance of your distributed relational database.

    Handle problemsResolve problems in your distributed database.

    Write applicationsWrite high-level language programs that use SQL statements for distributed applications.

    Queries and reportsOne of the most common tasks that you perform with your database is to retrieve information. iSeriesservers provide several methods to create and run queries and reports.

    You can use an SQL statement to retrieve information. This SQL statement is called a query. The querysearches the tables stored in your database to find the answer to the question that you posed with yourSQL statement. The answer is expressed as a set of rows, which is referred to as the result set. Once aquery has been run, you can also create a report to display the data provided in your result set. Fordetailed information about creating SQL statements, see the SQL programming topic.

    6 iSeries: Administration

    http://../rzaiu/rzaiuicbackup.htmhttp://../dbp/rbaforzahfpra.htmhttp://../dbp/rbaforzahfpra.htmhttp://../dbp/rbaforzahfpra.htmhttp://../dbp/rbaforzahfpra.htmhttp://../rzaki/rzakikickoff.htmhttp://../rzaki/rzakikickoff.htmhttp://../ddp/rbal1plan.htmhttp://../ddp/rbal1setup.htmhttp://../ddp/rbal1setup.htmhttp://../ddp/rbal1setup.htmhttp://../ddp/rbal1setup.htmhttp://../ddp/rbal1admin.htmhttp://../ddp/rbal1comm.htmhttp://../ddp/rbal1secure.htmhttp://../ddp/rbal1recover.htmhttp://../ddp/rbal1recover.htmhttp://../ddp/rbal1recover.htmhttp://../ddp/rbal1perform.htmhttp://../ddp/rbal1problem.htmhttp://../ddp/rbal1problem.htmhttp://../ddp/rbal1program.htmhttp://../ddp/rbal1program.htmhttp://../sqlp/rbafykickoff.htmhttp://../sqlp/rbafykickoff.htmhttp://../ddp/rbal1program.htmhttp://../ddp/rbal1problem.htmhttp://../ddp/rbal1perform.htmhttp://../ddp/rbal1recover.htmhttp://../ddp/rbal1secure.htmhttp://../ddp/rbal1comm.htmhttp://../ddp/rbal1admin.htmhttp://../ddp/rbal1setup.htmhttp://../ddp/rbal1plan.htmhttp://../rzaki/rzakikickoff.htmhttp://../dbp/rbaforzahfpra.htmhttp://../rzaiu/rzaiuicbackup.htm
  • 8/6/2019 iSeries Administration

    13/22

    In addition to using SQL, you can use other functions and products to create and run queries andreports. See the following manuals for detailed information.

    v Query for iSeries

    v Query Management Programming

    v iSeries Query Manager

    In addition, the iSeries Navigator interface provides SQL Assist, which can be used to create SQLstatements. SQL Assist helps you to build SQL Select, Insert, Update, and Delete statements. See BuildingSQL statements with SQL Assist for more information.

    Changes to Query for iSeriesIn V5R3, the Query for iSeries manual was not updated,but numerous functional updates were made tothe product. These updates are summarized below:

    v Support for BINARY, VARBINARY, BLOB, CLOB, DBCLOB, and ROWID data types.

    v Support for larger numeric and decimal numbers, plus support for large numeric literals.

    v The BINARY, VARBINARY, HEX, and LENGTHbuilt-in functions were added. They are describedbelow.

    v The VARCHAR function now supports conversion from CLOB to VARCHAR.

    v The VARGRAPHIC function now supports conversion from CLOB to DBCS graphic, CLOB to UCS2graphic, DBCLOB to DBCS graphic, and DBCLOB to UCS2 graphic.

    A binary constant is used for comparing a literal with a binary field (BINARY, VARBINARY, or BLOB).Binary constants are represented with an X followed by a sequence of characters that starts and endswith a string delimiter. The characters between the string delimiters must be an even number ofhexadecimal digits. A hexadecimal digit is a digit or any of the letters A through F (uppercase andlowercase), as shown in the following example:

    Field Test Valuebinarycol eq X12AF

    BINARY built-in function for Query (added):

    The BINARY function returns a BINARY representation of a string of any type. The form is:

    >>-BINARY--(--string-expression--+-----------+--)-------------->>-VARBINARY--(--string-expression--+-----------+--)----------->>-HEX--(--expression--)--------------------------------------->>-LENGTH--(--expression--)------------------------------------>