Database copy from Progress Program.

GVProgress

New Member
Does anyone know of a method to programatically copy a database?
I do not want to use OS-COPY and OS-COMMAND using proutil, prostrct, procopy.
Is there any other way? Sample code will be helpful.
 
Why? What are you trying to do. From a programming point there can be a lot of ways to do it, but may not be the correct approach depending on what you want to do.
 
Through a program I want to make a copy of existing database at another location ready to run. I have a current model of online back up which is posing some practical problems.
Hence looking at an alternative solution.
 
Doing that from within a program wouldn't be a good solution. Have you considered/setup After-Imaging. Is this copy that you want in a different location used for reporting or is it for Disaster Recovery purpose. What version of Progress are you running and how large are your databases.
 
Disaster recovery, but triggered by the application and not a DBA. Some thing that can be used as a snapshot of previos day if required.
Using OE 10.2A size over 1GB
 
You cannot avoid using at least some external commands.

At a minimum you need to create an empty db. There is no way to do that purely from the 4GL.

After that you need to load the schema. You can call data dictionary routines to do that.

You could then use various techniques to copy the table data from one db to another.

However... this would be a really wrong-headed way to approach disaster recovery. It is going to be a royal pain to setup and maintain.

What you really want is after-imaging combined with a roll-forward of the ai logs. Or perhaps OpenEdge Replication (if you want a "hot spare" available in real-time).
 
FWIW, years ago I used to do this all the time back before we had temp-tables. I had an empty database sitting around with a couple of useful tables in it and I would have the program copy it and attach to it single user, run the function (mostly reports) and then disconnect and delete the database.

But, Tom's right, not for this purpose.
 
Back
Top