Salesforce

How to programmatically dump and load database definitions (.df's) and data (.d's) files using Data Administration routines ?

Information

 
TitleHow to programmatically dump and load database definitions (.df's) and data (.d's) files using Data Administration routines ?
URL Name15884
Article Number000120727
EnvironmentProduct: OpenEdge
Version: All Supported Versions
OS: All Supported Platforms
Question/Problem Description
How to programmatically dump and load database definitions (.df's) and data (.d's) files?
How to load a .df file without going through the Data Administration Tool?
Dumping and loading .df and .d from outside the Data Administration.
How to use prodict/dump_d.p, prodict/dump_df.p, prodict/load_d.p, prodict/load_df.p?
How to dump and load tables using ABL code ?
How to dump data definitions outside the dictionary?
Sample code to dump and load .df and .d using Data Dictionary routines
Steps to Reproduce
Clarifying Information
Error Message
Defect Number
Enhancement Number
Cause
Resolution

The Data Dictionary source code that Progress supplies to the customers can be used to dump or load data without having to use the Data Dictionary. This can be used to automate or script a dump and load.
The following are basic samples on how to invoke these to dump a .df file (prodict/dump_df.p), dump .d files (prodict/dump_d.p), and to load them again (prodict/load_df.pprodict/load_d.p respectively).

These sample programs consider the case of multiple databases connected by the PROGRESS session, by setting the DICTDB alias to point to the desired database. Delete of the ALIAS at the end is only required if dump/load of other databases follow the code.

    /* dump.p */

CREATE ALIAS DICTDB FOR DATABASE sports.
DISPLAY LDBNAME("DICTDB").

RUN prodict/dump_df.p   ("ALL",
                         "sports.df",
                          "").
/*
Input parameters:
    file-name                : "ALL" or "<file-name> [,<filename>] ..." -> comma-delimited list of table names
    df-file-name             : Name of file to dump to
    code-page                : ?, "", "<code-page>"
               ?             = no conversion
               ""            = default conversion (SESSION:STREAM)
               "<code-page>" =  convert to <code-page>

*/

RUN prodict/dump_d.p ("ALL",".","").
/*
    Input parameters:
    file-name                : "ALL" or "<file-name>"
    dot-d-dir                : directory relative to working-directory
    code-page                : ?, "", "<code-page>"
               ?             = no conversion
               ""            = default conversion (SESSION:STREAM)
               "<code-page>" =  convert to <code-page>
*/

DELETE ALIAS DICTDB. /* Optional */


    /* load.p */

CREATE ALIAS DICTDB FOR DATABASE sports.
DISPLAY LDBNAME("DICTDB").

RUN prodict/load_df.p ("sports.df").
/*
Input Parameters:
    df-file-name             : The name of the .df file to be loaded into DICTDB
*/

RUN prodict/load_d.p ("ALL",".").
/*
Input Parameters:
    file-name                : "ALL" or "<file-name>"
    dot-d-dir                : location of files to load; directory relative to working-directory

*/

DELETE ALIAS DICTDB. /* Optional */


Further documentation is included in the source code for the programs.

The source code of the Data Dictionary routines to dump/load data and definitions is located in dlc/src/prodict, or dlc/src/prodict.pl
Before using these code samples the procedure library named 'prodict.pl' must be extracted following these steps:

1) Make sure the DLC/bin directory is in the path.
2) Default to the SRC directory
3) Run the command extractpl prodict.pl
4) Run the command extractpl adecomm.pl

This will create a prodict and an adecomm directory with these files.

Refer to Article How to extract source codes of data dictionary
 
Progress does not provide support for the modification and/or use of these modules outside of the Data Dictionary.

OpenEdge 10.0 introduced improved support for online schema changes.
The load_df.p procedure provides access to this functionality, with the ability of passing additional parameters in a comma separated string stored in df-file-name. 

The string entry definitions are: "df-file-name,<commit>,<session parameter>". 

Examples:

1. The following code will fail if there are errors in the .df:

       RUN prodict/load_df.p ("sports.df").


2. The following code will ignore any errors and commit the loading of the .df:
       RUN prodict/load_df.p ("sports.df,yes").

3. The following code will allow the loading of new tables/sequences:
       RUN prodict/load_df.p ("sports.df,,NEW OBJECTS").

4. The following code will allow the loading of new tables/sequences AND ignore any errors and commit the loading of the .df:
       RUN prodict/load_df.p ("sports.df,yes,NEW OBJECTS").

If you do not have a Development license, you will need to use the -rx to launch the procedure editor and allow schema changes online (Article How to perform a schema upgrade with a runtime license). 

 

Note: For extremely large schemas it may be required to use the client parameter -s with a large value like 1,000,000 to allow the operation to happen. Consider that this will have high memory consumption. Also it is possible to extract the table names from _file to run individually each of the dump and load processes.

 

If possible, use of proutil's bulk load to load the information for large tables as indicated in the following article:

How to dump and load using the Bulkload utility

Workaround
Notes
Keyword Phrase
Last Modified Date5/5/2025 7:46 PM

Powered by