202 lines
13 KiB
HTML
202 lines
13 KiB
HTML
<?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(&ACTIVATE)
|
|
DCL VAR(&ACTIVATE) TYPE(*CHAR) LEN(7)
|
|
|
|
/* Declare Entry Types Variables to Compare with &RWTYPE */
|
|
DCL &LOCAL *CHAR 1
|
|
DCL &SNA *CHAR 1
|
|
DCL &IP *CHAR 1
|
|
DCL &ARD *CHAR 1
|
|
DCL &ARDSNA *CHAR 1
|
|
DCL &ARDIP *CHAR 1
|
|
DCL &RWTYPE *CHAR 1
|
|
DCL &RWRDB *CHAR 18
|
|
DCL &RWRLOC *CHAR 8
|
|
DCL &RWTEXT *CHAR 50
|
|
DCL &RWDEV *CHAR 10
|
|
DCL &RWLLOC *CHAR 8
|
|
DCL &RWNTID *CHAR 8
|
|
DCL &RWMODE *CHAR 8
|
|
DCL &RWTPN *CHAR 8
|
|
DCL &RWSLOC *CHAR 254
|
|
DCL &RWPORT *CHAR 14
|
|
DCL &RWDPGM *CHAR 10
|
|
DCL &RWDLIB *CHAR 10
|
|
|
|
DCLF FILE(RDBSAV/RDBDIRM) /* SEE PROLOG CONCERNING THIS */
|
|
IF COND(&ACTIVATE = SAVE) THEN(GOTO CMBLBL(SAVE))
|
|
IF COND(&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 &LOCAL '0' /* Local RDB (one per system) */
|
|
CHGVAR &SNA '1' /* APPC entry (no ARD pgm) */
|
|
CHGVAR &IP '2' /* TCP/IP entry (no ARD pgm) */
|
|
CHGVAR &ARD '3' /* ARD pgm w/o comm parms */
|
|
CHGVAR &ARDSNA '4' /* ARD pgm with APPC parms */
|
|
CHGVAR &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 (&RWTYPE = &LOCAL) THEN( +
|
|
QSYS/ADDRDBDIRE RDB(&RWRDB) RMTLOCNAME(&RWRLOC) TEXT(&RWTEXT) )
|
|
|
|
ELSE IF (&RWTYPE = &SNA) THEN( +
|
|
QSYS/ADDRDBDIRE RDB(&RWRDB) RMTLOCNAME(&RWRLOC) TEXT(&RWTEXT) +
|
|
DEV(&RWDEV) LCLLOCNAME(&RWLLOC) +
|
|
RMTNETID(&RWNTID) MODE(&RWMODE) TNSPGM(&RWTPN) )
|
|
|
|
ELSE IF (&RWTYPE = &IP) THEN( +
|
|
QSYS/ADDRDBDIRE RDB(&RWRDB) RMTLOCNAME(&RWSLOC *IP) +
|
|
TEXT(&RWTEXT) PORT(&RWPORT) )
|
|
|
|
ELSE IF (&RWTYPE = &ARD) THEN( +
|
|
QSYS/ADDRDBDIRE RDB(&RWRDB) RMTLOCNAME(&RWRLOC) TEXT(&RWTEXT) +
|
|
ARDPGM(&RWDLIB/&RWDPGM) )
|
|
|
|
ELSE IF (&RWTYPE = &ARDSNA) THEN( +
|
|
QSYS/ADDRDBDIRE RDB(&RWRDB) RMTLOCNAME(&RWRLOC) TEXT(&RWTEXT) +
|
|
DEV(&RWDEV) LCLLOCNAME(&RWLLOC) +
|
|
RMTNETID(&RWNTID) MODE(&RWMODE) TNSPGM(&RWTPN) +
|
|
ARDPGM(&RWDLIB/&RWDPGM) )
|
|
|
|
ELSE IF (&RWTYPE = &ARDIP) THEN( +
|
|
QSYS/ADDRDBDIRE RDB(&RWRDB) RMTLOCNAME(&RWSLOC *IP) +
|
|
TEXT(&RWTEXT) PORT(&RWPORT) +
|
|
ARDPGM(&RWDLIB/&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> |