ibm-information-center/dist/eclipse/plugins/i5OS.ic.sqlp_5.4.0.1/rbafydlcommands.htm

163 lines
9.4 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="reference" />
<meta name="DC.Title" content="Commands used for working with DataLinks" />
<meta name="abstract" content="Support for the DataLink data type can be broken down into three different components." />
<meta name="description" content="Support for the DataLink data type can be broken down into three different components." />
<meta name="DC.subject" content="data types, DataLinks, commands used" />
<meta name="keywords" content="data types, DataLinks, commands used" />
<meta name="DC.Relation" scheme="URI" content="rbafydatalinks.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="rbafydlcommands" />
<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>Commands used for working with DataLinks</title>
</head>
<body id="rbafydlcommands"><a name="rbafydlcommands"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Commands used for working with DataLinks</h1>
<div><p>Support for the DataLink data type can be broken down into three
different components.</p>
<div class="section"> <ol><li>The DB2<sup>®</sup> database
support has a data type called DATALINK. This can be specified
on SQL statements such as CREATE TABLE and ALTER TABLE. The column cannot
have any default other than NULL. Access to the data must be using SQL interfaces.
This is because the DataLink itself is not compatible with any host variable
type. SQL scalar functions can be used to retrieve the DataLink value in
character form. There is a DLVALUE scalar function that must be used in SQL
to INSERT and UPDATE the values in the column.</li>
<li>The DataLink File Manager (DLFM) is the component that maintains the link
status for the files on a server, and keeps track of meta-data for each file.
This code handles linking, unlinking, and commitment control issues. An
important aspect of DataLinks is that the DLFM need not be on the same physical
system as the SQL table that contains the DataLink column. So an SQL table
can link an object that resides in either the same system's integrated file
system, or a remote server's integrated file system.</li>
<li>The DataLink filter must be run when the file system tries operations
against files that are in directories designated as containing linked objects.
This component determines if the file is linked, and optionally, if the user
is authorized to access the file. If the file name includes an access token,
the token will be verified. Since there is extra overhead in this filter
process, it is only run when the accessed object exists in one of the directories
within a DataLink prefix. See the discussion below on prefixes.</li>
</ol>
</div>
<div class="section"><p>When working with DataLinks, there are several steps that must
be taken to properly configure the system: </p>
<ul><li>TCP/IP must be configured on any systems that are going to be used when
working with DataLinks. This includes the systems on which the SQL tables
with DataLink columns are going to be created, as well as the systems that
will contain the objects to be linked. In most cases, this will be the same
system. Since the URL that is used to reference the object contains a TCP/IP
server name, this name must be recognized by the system that is going to contain
the DataLink. The command CFGTCP can be used to configure the TCP/IP names,
or to register a TCP/IP name server. </li>
<li>The system that contains the SQL tables must have the Relational Database
Directory updated to reflect the local database system, and any optional remote
systems. The command WRKRDBDIRE can be used to add or modify information
in this directory. For consistency, it is recommended that the same names
be used as the TCP/IP server name and the Relational Database name. </li>
<li>The DLFM server must be started on any systems that will contain objects
to be linked. The command STRTCPSVR *DLFM can be used to start the DLFM server.
The DLFM server can be ended by using the CL command ENDTCPSVR *DLFM.</li>
</ul>
</div>
<div class="section"><p>Once the DLFM has been started, there are some steps needed to
configure the DLFM. These DLFM functions are available via an executable
script that can be entered from the QShell interface. To get to the interactive
shell interface, use the CL command QSH. This will open a command entry screen
from which you can enter the DLFM script commands. The script command dfmadmin
-help can be used to display help text and syntax diagrams. For the most
commonly used functions, CL commands have also been provided. Using the CL
commands, most or all of the DLFM configuration can be accomplished without
using the script interface. Depending on your preferences, you can choose
to use either the script commands from the QSH command entry screen or the
CL commands from the CL command entry screen. </p>
</div>
<div class="section"><p>Since these functions are meant for a system administrator or
a database administrator, they all require the *IOSYSCFG special authority. </p>
</div>
<div class="section"></div>
<div class="section"><h4 class="sectiontitle">Add a prefix</h4><p>A prefix is a path or directory that
will contain objects to be linked. When setting up the Data Links File Manager
(DLFM) on a system, the administrator must add any prefixes that will be used
for DataLinks. The script command dfmadmin -add_prefix is used to add prefixes.
The CL command to add prefixes is Add Prefix to DataLink File Manager (ADDPFXDLFM)
command.</p>
<p>For instance, on server TESTSYS1, there is a directory called
/mydir/datalinks/ that contains the objects that will be linked. The administrator
uses the command ADDPFXDLFM PREFIX(('/mydir/datalinks/')) to add the prefix.
The following links for URLs are valid since their path beings with a valid
prefix:</p>
</div>
<div class="example"> <pre>http://TESTSYS1/mydir/datalinks/videos/file1.mpg
or
file://TESTSYS1/mydir/datalinks/text/story1.txt </pre>
</div>
<div class="section"><p>It is also possible to remove a prefix using the script command
dfmadmin -del_prefix. This is not a commonly used function since it can only
be run if there are no linked objects anywhere in the directory structure
contained within the prefix name.</p>
</div>
<div class="section"> <div class="note"><span class="notetitle">Notes:</span> <ol><li>The following directories, or any of their subdirectories, should not
be used as prefixes for DataLinks: <ul><li>/QIBM</li>
<li>/QReclaim</li>
<li>/QSR</li>
<li> /QFPNWSSTG</li>
</ul>
</li>
<li>Additionally, common base directories such as the following should not
be used unless the prefix is a subdirectory within one of the base directories: <ul><li>/home</li>
<li>/dev</li>
<li>/bin</li>
<li>/etc</li>
<li>/tmp</li>
<li>/usr</li>
<li>/lib</li>
</ul>
</li>
</ol>
</div>
</div>
<div class="section"><h4 class="sectiontitle">Add a host database</h4><p>A host database is a relational
database system from which a link request originates. If the DLFM is on the
same system as the SQL tables that will contain the DataLinks, then only the
local database name needs to be added. If the DLFM will have link requests
coming from remote systems, then all of their names must be registered with
the DLFM. The script command to add a host database is dfmadmin -add_db and
the CL command is Add Host Database to DataLink File Manager (ADDHDBDLFM)
command. This function also requires that the libraries containing the SQL
tables also be registered.</p>
<div class="p">For instance, on server TESTSYS1, where you
have already added the /mydir/datalinks/ prefix, you want SQL tables on the
local system in either library TESTDB or PRODDB to be allowed to link objects
on this server. Use the following command: <pre>ADDHDBDLFM HOSTDBLIB((TESTDB) (PRODDB)) HOSTDB(TESTSYS1)</pre>
</div>
</div>
<div class="section"><p>Once the DLFM has been started, and the prefixes and host database
names have been registered, you can begin linking objects in the file system. </p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafydatalinks.htm" title="The DataLink data type is one of the basic building blocks for extending the types of data that can be stored in database files. The idea of a DataLink is that the actual data stored in the column is only a pointer to the object.">Use DataLinks</a></div>
</div>
</div>
</body>
</html>