ibm-information-center/dist/eclipse/plugins/i5OS.ic.ddp_5.4.0.1/rbal1savrdbd.htm

202 lines
13 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="task" />
<meta name="DC.Title" content="Save and restore relational database directories" />
<meta name="abstract" content="The relational database directory is not an iSeries object. Instead it is made up of files that are opened by the server at IPL time." />
<meta name="description" content="The relational database directory is not an iSeries object. Instead it is made up of files that are opened by the server at IPL time." />
<meta name="DC.subject" content="saving, relational database directory, creating an output file, command, DSPRDBDIRE (Display Relational Database Directory Entry), Display Relational Database Directory Entry (DSPRDBDIRE), command, CL, DSPRDBDIRE (Display Relational Database Directory Entry), Display Relational Database Directory Entry (DSPRDBDIRE), relational database directory entry, displaying, ADDRDBDIRE (Add Relational Database Directory Entry), Add Relational Database Directory Entry (ADDRDBDIRE), ADDRDBDIRE (Add Relational Database Directory Entry), Add Relational Database Directory Entry (ADDRDBDIRE), adding, RSTOBJ (Restore Object), Restore Object (RSTOBJ), Restore Object (RSTOBJ), object, restoring" />
<meta name="keywords" content="saving, relational database directory, creating an output file, command, DSPRDBDIRE (Display Relational Database Directory Entry), Display Relational Database Directory Entry (DSPRDBDIRE), command, CL, DSPRDBDIRE (Display Relational Database Directory Entry), Display Relational Database Directory Entry (DSPRDBDIRE), relational database directory entry, displaying, ADDRDBDIRE (Add Relational Database Directory Entry), Add Relational Database Directory Entry (ADDRDBDIRE), ADDRDBDIRE (Add Relational Database Directory Entry), Add Relational Database Directory Entry (ADDRDBDIRE), adding, RSTOBJ (Restore Object), Restore Object (RSTOBJ), Restore Object (RSTOBJ), object, restoring" />
<meta name="DC.Relation" scheme="URI" content="rbal1saverestore.htm" />
<meta name="DC.Relation" scheme="URI" content="rbal1rddsetupexample.htm" />
<meta name="DC.Relation" scheme="URI" content="../cl/addrdbdire.htm" />
<meta name="DC.Relation" scheme="URI" content="../cl/dsprdbdire.htm" />
<meta name="DC.Relation" scheme="URI" content="../cl/rstobj.htm" />
<meta name="DC.Relation" scheme="URI" content="../cl/savobj.htm" />
<meta name="DC.Relation" scheme="URI" content="../cl/savsys.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rbal1savrdbd" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>Save and restore relational database directories</title>
</head>
<body id="rbal1savrdbd"><a name="rbal1savrdbd"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Save and restore relational database directories</h1>
<div><p>The relational database directory is not an <span class="keyword">iSeries™</span> object.
Instead it is made up of files that are opened by the server at IPL time.</p>
<div class="section"> <p>Because of this, the <span class="cmdname">Save Object (SAVOBJ)</span> command
cannot be used to directly save these files. You can save the relational database
directory by creating an output file from the relational database directory
data. This output file can then be used to add entries to the directory again
if it is damaged.</p>
<p>When entries have been added and you want to save
the relational database directory, specify the OUTFILE parameter on the <span class="cmdname">Display
Relational Database Directory Entry (DSPRDBDIRE)</span> command to send
the results of the command to an output file. The output file can be saved
to tape or a save file and restored to the server. If your relational database
directory is damaged or your server needs to be recovered, you can restore
the output file that contains relational database entry data using a control
language (CL) program. The CL program reads data from the restored output
file and creates the CL commands that add entries to a new relational database
directory.</p>
<p>For example, the relational database directory for the Spiffy
Corporation MP000 server is sent to an output file named RDBDIRM as follows:
</p>
<pre>DSPRDBDIRE OUTPUT(*OUTFILE) OUTFILE(RDBDIRM)</pre>
<p>The
sample CL program that follows reads the contents of the output file RDBDIRM
and recreates the relational database directory using the <span class="cmdname">Add Relational
Database Directory Entry (ADDRDBDIRE)</span> command. Note that the old
directory entries are removed before the new entries are made. </p>
<div class="note"><span class="notetitle">Note:</span> By
using the code examples, you agree to the terms of the <a href="codedisclaimer.htm">Code license and disclaimer information</a>.</div>
<pre> /******************************************************************/
/* - Restore RDB Entries from output file created with: - */
/* - DSPRDBDIRE OUTPUT(*OUTFILE) OUTFILE(RDBDIRM) - */
/* - FROM A V4R2 OR LATER LEVEL OF OS/400 or i5/OS - */
/******************************************************************/
PGM PARM(&amp;ACTIVATE)
DCL VAR(&amp;ACTIVATE) TYPE(*CHAR) LEN(7)
/* Declare Entry Types Variables to Compare with &amp;RWTYPE */
DCL &amp;LOCAL *CHAR 1
DCL &amp;SNA *CHAR 1
DCL &amp;IP *CHAR 1
DCL &amp;ARD *CHAR 1
DCL &amp;ARDSNA *CHAR 1
DCL &amp;ARDIP *CHAR 1
DCL &amp;RWTYPE *CHAR 1
DCL &amp;RWRDB *CHAR 18
DCL &amp;RWRLOC *CHAR 8
DCL &amp;RWTEXT *CHAR 50
DCL &amp;RWDEV *CHAR 10
DCL &amp;RWLLOC *CHAR 8
DCL &amp;RWNTID *CHAR 8
DCL &amp;RWMODE *CHAR 8
DCL &amp;RWTPN *CHAR 8
DCL &amp;RWSLOC *CHAR 254
DCL &amp;RWPORT *CHAR 14
DCL &amp;RWDPGM *CHAR 10
DCL &amp;RWDLIB *CHAR 10
DCLF FILE(RDBSAV/RDBDIRM) /* SEE PROLOG CONCERNING THIS */
IF COND(&amp;ACTIVATE = SAVE) THEN(GOTO CMBLBL(SAVE))
IF COND(&amp;ACTIVATE = RESTORE) THEN(GOTO CMDLBL(RESTORE))
SAVE:
CRTLIB RDBSAV
DSPRDBDIRE OUTPUT(*OUTFILE) OUTFILE(RDBSAV/RDBDIRM)
GOTO CMDLBL(END)
RESTORE:
/* Initialize Entry Type Variables to Assigned Values */
CHGVAR &amp;LOCAL '0' /* Local RDB (one per system) */
CHGVAR &amp;SNA '1' /* APPC entry (no ARD pgm) */
CHGVAR &amp;IP '2' /* TCP/IP entry (no ARD pgm) */
CHGVAR &amp;ARD '3' /* ARD pgm w/o comm parms */
CHGVAR &amp;ARDSNA '4' /* ARD pgm with APPC parms */
CHGVAR &amp;ARDIP '5' /* ARD pgm with TCP/IP parms */
RMVRDBDIRE RDB(*ALL) /* Clear out directory */
NEXTENT: /* Start of processing loop */
RCVF /* Get a directory entry */
MONMSG MSGID(CPF0864) EXEC(DO) /* End of file processing */
QSYS/RCVMSG PGMQ(*SAME (*)) MSGTYPE(*EXCP) RMV(*YES) MSGQ(*PGMQ)
GOTO CMDLBL(LASTENT)
ENDDO
/* Process entry based on type code */
IF (&amp;RWTYPE = &amp;LOCAL) THEN( +
QSYS/ADDRDBDIRE RDB(&amp;RWRDB) RMTLOCNAME(&amp;RWRLOC) TEXT(&amp;RWTEXT) )
ELSE IF (&amp;RWTYPE = &amp;SNA) THEN( +
QSYS/ADDRDBDIRE RDB(&amp;RWRDB) RMTLOCNAME(&amp;RWRLOC) TEXT(&amp;RWTEXT) +
DEV(&amp;RWDEV) LCLLOCNAME(&amp;RWLLOC) +
RMTNETID(&amp;RWNTID) MODE(&amp;RWMODE) TNSPGM(&amp;RWTPN) )
ELSE IF (&amp;RWTYPE = &amp;IP) THEN( +
QSYS/ADDRDBDIRE RDB(&amp;RWRDB) RMTLOCNAME(&amp;RWSLOC *IP) +
TEXT(&amp;RWTEXT) PORT(&amp;RWPORT) )
ELSE IF (&amp;RWTYPE = &amp;ARD) THEN( +
QSYS/ADDRDBDIRE RDB(&amp;RWRDB) RMTLOCNAME(&amp;RWRLOC) TEXT(&amp;RWTEXT) +
ARDPGM(&amp;RWDLIB/&amp;RWDPGM) )
ELSE IF (&amp;RWTYPE = &amp;ARDSNA) THEN( +
QSYS/ADDRDBDIRE RDB(&amp;RWRDB) RMTLOCNAME(&amp;RWRLOC) TEXT(&amp;RWTEXT) +
DEV(&amp;RWDEV) LCLLOCNAME(&amp;RWLLOC) +
RMTNETID(&amp;RWNTID) MODE(&amp;RWMODE) TNSPGM(&amp;RWTPN) +
ARDPGM(&amp;RWDLIB/&amp;RWDPGM) )
ELSE IF (&amp;RWTYPE = &amp;ARDIP) THEN( +
QSYS/ADDRDBDIRE RDB(&amp;RWRDB) RMTLOCNAME(&amp;RWSLOC *IP) +
TEXT(&amp;RWTEXT) PORT(&amp;RWPORT) +
ARDPGM(&amp;RWDLIB/&amp;RWDPGM) )
GOTO CMDLBL(NEXTENT)
LASTENT:
RETURN
DLTLIB RDBSAV
END
ENDPGM</pre>
<p>There is an alternate method of restoring the directory,
for the case when no output file of the type described previously
is available. This method is to extract the object from a saved server and
restore it to some other library and then manually enter the entries in it
with the <span class="cmdname">Add Relational Database Directory Entry (ADDRDBDIRE)</span> command. </p>
<p>The
files that make up the relational database directory are saved when a <span class="cmdname">Save
System (SAVSYS)</span> command is run. The physical file that contains
the relational database directory can be restored from the save media to your
library with the following <span class="cmdname">Restore Object (RSTOBJ)</span> command: </p>
<pre>RSTOBJ OBJ(QADBXRDBD) SAVLIB(QSYS)
DEV(TAP01) OBJTYPE(*FILE)
LABEL(Q<em>pppppppvrmxx</em>0003)
RSTLIB(your lib)</pre>
<p>In this example, the relational
database directory is restored from tape. The characters <em>ppppppp</em> in
the LABEL parameter represent the product code of <span class="keyword">i5/OS™</span> (for
example, 5722SS1 for Version 5 Release 3). The <em>vrm</em> in the LABEL parameter
is the version, release, and modification level of <span class="keyword">i5/OS</span>.
The <em>xx</em> in the LABEL parameter is the last two digits of the current
server language value. For example, 2924 is for the English language; therefore,
the value of <em>xx</em> is 24.</p>
<p>After you restore this file to your library,
you can use the information in the file to manually re-create the relational
database directory.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbal1saverestore.htm" title="Saving and restoring data and programs allows recovery from a program or server failure, exchange of information between servers, or storage of objects or data offline. A sound backup policy at each server in the distributed relational database network ensures that a server can be restored and made available to network users quickly in the event of a problem.">Save and restore processing for a distributed relational database</a></div>
</div>
<div class="relref"><strong>Related reference</strong><br />
<div><a href="rbal1rddsetupexample.htm" title="The Spiffy Corporation network provides an example to illustrate how the relational database directory is used on servers in a distributed relational database network and show how each is set up. The example assumes the use of Advanced Program-to-Program Communication (APPC) for communications, as opposed to TCP/IP, which would be simpler to set up.">Example: Set up a relational database directory</a></div>
</div>
<div class="relinfo"><strong>Related information</strong><br />
<div><a href="../cl/addrdbdire.htm">Add Relational Database Directory Entry (ADDRDBDIRE) command</a></div>
<div><a href="../cl/dsprdbdire.htm">Display Relational Database Directory Entry (DSPRDBDIRE) command</a></div>
<div><a href="../cl/rstobj.htm">Restore Object (RSTOBJ) command</a></div>
<div><a href="../cl/savobj.htm">Save Object (SAVOBJ) command</a></div>
<div><a href="../cl/savsys.htm">Save System (SAVSYS) command</a></div>
</div>
</div>
</body>
</html>