Need AS400 commands to SAVE and REStore commands to back up and restore JDE tables

babubudengm

Active Member
HI All,

I have searched some commands , they are SAVOBJ, SAVLIB and RESTOBJ. have some confusion with the parameters used by these commands.
our tasks is to back up some of the JDE tables from one of the AS400 server and restore them to another AS400 server.

and SAVE the tables from one Library (business data) and restore them in other LIB.

Please provide commands with options , which generally used for SAving and restoring the tables across different as400 system or different library within same AS400.


Appreciate your help in this regard.

Babu
 

Tom_Davidson

VIP Member
In general:

SAVLIB LIB(PRODDTA) DEV() ...
RSTLIB SAVLIB(PRODDTA) DEV() ...
SAVOBJ OBJ(<object list>) LIB(PRODDTA) DEV() OBJTYPE(*FILE) ...
RSTOBJ OBJ(<object list>) SAVLIB(PRODDTA) DEV() OBJTYPE(*FILE) ...

Your options will vary depending on the device, if you want to restore to the same or a different library, what kind of differences you will allow and if you want to do save while active.
 

babubudengm

Active Member
Hi Tom,

Thanks for sharing the information.

Please correct me if my understandings are wrong.
1.SAVOBJ OBJ(<object list>) LIB(PRODDTA) DEV() OBJTYPE(*FILE) ...

Saving the objects into Library PRODDTA.

2.RSTOBJ OBJ(<object list>) SAVLIB(PRODDTA) DEV() OBJTYPE(*FILE) ...

Restoring the objects from (Source) which library to which library (Destination )?

Source Library is PRODDTA.
Which one is the Destination Library?

Regards,
babu

 

ice_cube210

VIP Member
The destination library is by default *SAVLIB , meaning it will look for PRODDTA again and restore there if such a library is available.

Here is an example of where you will save F0101 F0006 from PRODDTA and restore to CRPDTA

First you need to create a Save File. I will assume you have a library on your server called TMPRST to hold the save file

CRTSAVF FILE(TMPRST/PD_DATA) TEXT('PD DATA TO COPY')

Next you will save the objects to the save file

SAVOBJ OBJ(F0101 F0006) LIB(PRODDTA) DEV(*SAVF) SAVF(TMPRST/PD_DATA)

Now if your CRPDTA library is on a different server , then first create a save file there with the same name and FTP the save file from your source server to the destination server in Bin mode. If CRPDTA is on the same server , then proceed to the next step

Now you will restore the objects to CRPDTA using the RSTOBJ command

RSTOBJ OBJ(F0006 F0101) SAVLIB(PRODDTA) DEV(*SAVF) SAVF(TMPRST/PD_DATA) RSTLIB(CRPDTA)

Here SAVLIB is the library from where the objects came and RSTLIB is where you want them restored to

You can also use OBJ(*ALL) to restore all objects in the save file.
 
Discover how to build no-code data integrations and business process automations.

Michael L.

Well Known Member
Don't forget to use the PVTAUT parameter on the save and restore commands should you want take retain the object level security assuming your not using an authorization list. This will save you from having to do so manually.
 
Top