Copy The Database Structure(without Data) through commandline utility

AKumar

New Member
Hi,

I have a database and want to copy the structure not data through command-line utility. I can make the .df file through the DataBase Administration Tools but i want to copy or make the database structure file through comaand0-line utility so i can get the schema with tables and no data.

Please send me the help and valuable suggestions.

Regards,
AKumar
 
checkout the dump and reload routines in the progress help/KB
you should probably want to "procopy empty" or "procreate something"
from the ST-file from the original db
and then load the df (and perhaps _users).
 
I understand your message to mean you want to dump the data definitions from the command line.

The 4GL program that dumps the df is prodict/dump_df.p.

Unfortunately this takes parameters, so you will need to create a wrapper .p which calls dump_df with your chosen parameters (eg. 'ALL' for all tables), and call 'wrapper.p' (whatever) from the command line/script.

Here's an earlier message from the Peg which gives you the outline in a little more detail...

http://www.peg.com/lists/peg/history/200110/msg01691.html
 
Hello,

I do by its internal working of dump_df, but i want to know that it is possible that if i am taking backup of databse (probkup command line utility) and crating of database with prodb command line utility can i pass any parameter so that i can make a .df through comaandline utility.

Please send your valuable suggestion and help for my doubt.

Regards,
AKumar


I understand your message to mean you want to dump the data definitions from the command line.

The 4GL program that dumps the df is prodict/dump_df.p.

Unfortunately this takes parameters, so you will need to create a wrapper .p which calls dump_df with your chosen parameters (eg. 'ALL' for all tables), and call 'wrapper.p' (whatever) from the command line/script.

Here's an earlier message from the Peg which gives you the outline in a little more detail...

http://www.peg.com/lists/peg/history/200110/msg01691.html[/quote]
 
I don't know what you are missing?

Lee's post (and link the to PEG message) indicates what you have to do. The PEG message illustrates how to run the dump_df via command line?
 
Perhaps Gordon, I have misunderstood him/her.


Right, let's see. You want to dump or load a df from the command line.

Possibly you also mean you want to pass a list of tables to dump at the same time.


A couple of things first:

probkup and prodb are red herrings (means: irrelevant) - you will not dump or load the df with them.

You can though put these in the same script as the line that calls your dump/load script.



Step 1:

You need to create a script, called, say, "dumpdf.sh".
This script will call the wrapper program suggested earlier (eg. "mpro -b /path/mydb -p dumpmydb.p" from the Peg link).



Step 2:
If you want to pass parameters when you call it (eg: "dumpdf 'table1,table3,table22' "), you can pass these parameters to dumpmydb.p within the script, then grab them within dumpmydb.p using SESSION-PARAMETER, or OS-GETENV("parameter").

You then convert these parameters into the correct format for prodict/dump_df.p, and call that - all within dumpmydb.p.

I'm afraid I don't have the time or expertise to write the script for you, but
The ever wonderful Peg has examples of Step 2:

http://www.peg.com/lists/peg/history/200405/thrd2.html#00628


I hope this helps you do what you want to.
 
Back
Top