Salesforce

How to generate scripts to run binary dump and load for all tables?

« Go Back

Information

 
TitleHow to generate scripts to run binary dump and load for all tables?
URL NameP124532
Article Number000128036
EnvironmentProduct: Progress
Version: 8.2 and higher, 9.x
Product: OpenEdge
Version: 10.x, 11.x
OS: All supported platforms
Question/Problem Description
How to generate scripts to run binary dump and load for all tables?
Can I automate a binary dump & load?
Is there a script for binary dump & load?
Do I have to do each table separately in a binary dump & load?
How to create scripts to perform a Binary Dump/Load based on database schema
To provide a 4GL program to create a dump.txt script that dumps all of your tables in binary mode, and a load.txt script which will load them.
Binary dump and load scripts
How to generate binary dump and load scripts from 4GL
Steps to Reproduce
Clarifying Information
Error Message
Defect Number
Enhancement Number
Cause
Resolution
ABL/4GL code to run binary dump and load for all tables
  • This functionality is available starting from Progress 8.2x.
  • "DBNAME" will populate the database name
  • To run a parallel binary dump against an online database, break up the list and create several files renaming each with names like load1.sh, load2.sh, etc.  Then run each one of those to perform multiple dump at the same time.
  • After binary loading the data into a new database, remember to rebuild the indexes using IDXBUILD.
  • When running on UNIX, set the execute permission on the command files or specify the shell to use in order to execute the scripts above (eg sh dump.sh or sh load.sh). Set the execute permission on the command files with the following command:
        chmod +x dump.sh load.sh
DEFINE VARIABLE dir-name AS CHARACTER NO-UNDO FORMAT "X(77)".
   DEFINE VARIABLE db-name AS CHARACTER NO-UNDO.
   DEFINE VARIABLE front-end AS CHARACTER NO-UNDO.
   DEFINE VARIABLE outstring AS CHARACTER NO-UNDO FORMAT "X(100)".
   DEFINE VARIABLE delim AS CHARACTER NO-UNDO FORMAT "X(1)".

   DEFINE STREAM dumpcmds.
   DEFINE STREAM loadcmds.

   SET dir-name.

   IF OPSYS = "WIN32" THEN
DO:
        ASSIGN delim = "~\".
       OUTPUT STREAM dumpcmds TO dump.bat.
        OUTPUT STREAM loadcmds TO load.bat.
        ASSIGN front-end = "call proutil " + DBNAME.
   END.
   ELSE
DO:
        ASSIGN delim = "/".
       OUTPUT STREAM dumpcmds TO dump.sh.
        OUTPUT STREAM loadcmds TO load.sh.
       ASSIGN front-end = "proutil " + DBNAME.
   END.

   FOR EACH _file WHERE _file-num > 0 AND _file-num < 32768:
       ASSIGN outstring = front-end + " -C dump " + _file-name + " " + dir-name.
       PUT STREAM dumpcmds outstring SKIP.
       ASSIGN outstring = front-end + " -C load " + dir-name + delim + _file-name + ".bd".
       PUT STREAM loadcmds outstring SKIP.
   END.

   OUTPUT STREAM dumpcmds CLOSE.
   OUTPUT STREAM loadcmds CLOSE.
Workaround
Notes
Keyword Phrase
Last Modified Date12/15/2021 3:51 PM

Powered by