In order to create a distributed file, you must do the following on each system on which parts of the distributed file will exist:
For the primary system, you need to do the following:
For example, suppose you have two systems, and you want each one to contain part of a distributed file. Assume:
To create the relational database directory entries on system OS400SYS1, you would enter the following commands:
ADDRDBDIRE RDB(OS400SYS1) RMTLOCNAME(*LOCAL) TEXT('local database RDB directory entry') ADDRDBDIRE RDB(OS400SYS2) RMTLOCNAME(AS400SYS2) TEXT('remote database RDB directory entry')
To create the library DISTRIBUTE on OS400SYS1, enter the CRTLIB command.
To create the relational database directory entries on system OS400SYS2, you would enter the following commands:
ADDRDBDIRE RDB(OS400SYS2) RMTLOCNAME(*LOCAL) TEXT('local database RDB directory entry') ADDRDBDIRE RDB(OS400SYS1) RMTLOCNAME(AS400SYS1) TEXT('remote database RDB directory entry')
To create the library DISTRIBUTE on OS400SYS2, enter the CRTLIB command.
On your primary system, assume:
Then, to create the node group on system OS400SYS1, use the following command:
CRTNODGRP NODGRP(DISTRIBUTE/NODEGROUP) RDB(OS400SYS1 AS400SYS2) TEXT('node group for distributed file')
The DDS for the Create Physical File (CRTPF) command (contained in source file QDDSSRC, in library DISTRIBUTE) is:
....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 A R CUSTREC A CUSTOMERNO 9S 0 ALIAS(CUSTOMER_NUMBER) A FIRSTNAME 15A ALIAS(CUSTOMER_FIRST_NAME) A LASTNAME 15A ALIAS(CUSTOMER_LAST_NAME) A ADDRESS 20A ALIAS(CUSTOMER_ADDRESS) A ACCOUNTNO 9S 0 ALIAS(CUSTOMER_ACCOUNT_NUMBER) |
The DDS field CUSTOMERNO is used below as the partitioning key for the distributed file.
CRTPF FILE(DISTRIBUTE/CUSTMAST) SRCFILE(DISTRIBUTE/QDDSSRC) SRCMBR(CUSTMAST) NODGRP(DISTRIBUTE/NODEGROUP) PTNKEY(CUSTOMERNO)
When the Create Physical File (CRTPF) command completes on the primary system, the file is created on the primary system as well as on all of the other relational databases in the node group. After the file has been created, changes to the node group will no longer affect the distributed file.
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.