Problem:
The question was asked:
How to back up your SYSTEM location so that you can preserve it through multiple uninstalls and reinstalls.
This can be accomplished using XDB utilities and here is how:
Resolution:
Essentially what you need is to preserve three types of information in the SYSTEM location: Local locations, Link locations, Server-to-server locations. Link is easy; you can off-load your Link settings by executing Gateway Profile Utility (GPRF40N) with batch command GENERATEFILE. You can do so by typing the following at a MFE command prompt:
GPRF40N USERNAME=user_name PASSWORD= password GENERATEFILE=C:\\TMP\\GROF.OUT
where user_name can be any user registered at your XDB Server.
Local and server-to-server locations can be preserved with two SQL Wizard Exports from the SYSTEM location.
** Screen prints of these have been added as attachments to the KB article.
If you have to do this process repeatedly, you could combine these two exports into a single export file and run it as a batch.
[EXPORT]
Table = SYSTEM.SYSIBM.SYSLOCATIONS;
Where = "LOCTYPE=''X'' AND LOCATION NOT IN (''SYSTEM'', ''MAINTAIN'', ''TUTORIAL'')";
Filename = C:\\MFUSER30\\CONFIG\\LOCATIONS.SQL;
Format = SQL;
Replace = y;
Fields = LOCATION,LOCTYPE,LINKNAME,LINKATTR;
Sql_opts = INSERT;
Src_Ascii_Codepage = 0;
Dst_Ascii_Codepage = 0;
On_error = Prompt;
[EXPORT]
Table = SYSTEM.SYSXDB.SYSLOCALS;
Where = "LOCATION NOT IN (''SYSTEM'', ''MAINTAIN'', ''TUTORIAL'')";
Filename = C:\\MFUSER30\\CONFIG\\LOCATIONS.SQL;
Format = SQL;
Replace = n;
Fields = LOCATION,CREATOR,LOCALTYPE,SYSTEMAUTHID,FWDLOGNAME,FWDLOGON,XDBSYSTABLES,SORTSEQUENCE,REMARKS,DBPATH,FWDPATH,ONLINE,CODEPAGE,COUNTRY,LOCALDATEPIC,LOCALTIMEPIC,RULES,DECIMALPOINT,DEC31,APOSTSQL,AO_CCSID,E_CCSID;
Sql_opts = INSERT;
Src_Ascii_Codepage = 0;
Dst_Ascii_Codepage = 0;
On_error = Prompt;
In this file, I've highlighted in bold the changes I made by hand. You'll need to run the two Exports separately or add them to a single batch Export script in the order shown; this ensures that the resulting SQL script (LOCATIONS.SQL in this example) will contain records from both SYSIBM.SYSLOCATIONS and SYSXDB.SYSLOCALS. A benefit of using a SQL script is that it allows you to modify the paths used in your so you can move the locations around at the same time you are switching to a new SYSTEM location. By running the SQL script and a GPRF40N USEFILE command, you will have done everything to get your new SYSTEM location set up. Here is the syntax for GPROF USEFILE command:
GPRF40N USERNAME=user_name PASSWORD= password USEFILE=C:\\TMP\\GROF.OUT
After applying the changes, the final step would be shut down the server and restart the server.
Since both SQL Wizard and GPROF have batch capability, you can simplify the process by making batch scripts that will take care of all these steps for you.
Attachments:
#EnterpriseDeveloper
#MFDS



