Decommissioning a Pedon Database
This document discusses a procedure for decommissioning a pedon database. By
that we mean, saving all of the data in a pedon database, and then dropping that
database, permanently.
For the process of decommissioning a pedon database to prepare its data for
conversion into NASIS, we are recommending that you save your pedon data in two
different export formats. One way is via the export function of the pedon
program. The other way is to do a dbexport (an Informix utility) of your pedon
database. Some of you may have already decommissioned a pedon database and saved
your data by using the pedon program export. If you have, this export will
obviously have to suffice.
The first part of this document discusses the procedure for decommissioning a
pedon database at length. A cookbook listing of these procedures is provided at
the end of this document. If you need any help with the procedures described in
this document, please contact either Tammy Cheever or Steve Speidel at the Soils
Hotline at (402) 437-5379 and (402) 437-5378 respectively.
Before You Export Your Pedon Data
In our work in testing our pedon to NASIS conversion program, we found that
at least one of the databases that provided our test data was corrupted. We
didn't find this out until after the dbexport was performed. Fortunately there
is an Informix utility (bcheck) to repair corrupted databases. It is safe to run
this utility, even if your database is not corrupted. We recommend that you run
this utility regardless of whether or not you think that your pedon database
might be corrupted.
In order to run the Informix utility to repair a corrupted pedon database, as
well as to be able to run the Informix utility dbexport, you must be logged in
as “informix”, and your shell environment must be properly configured.
Two things are required to establish your Informix environment. The
environmental variable INFORMIXDIR must contain the name of the directory where
Informix is installed. This is typically /usr/informix or usr/informix5. The
other environmental requirement is that the Informix bin directory must be in
your path.
Example: Suppose that Informix was installed to /usr/informix5. The following
commands, for Bourne shell, would establish the correct Informix environment.
INFORMIXDIR=/usr/informix5
export INFORMIXDIR
PATH=$INFORMIXDIR/bin:$PATH
export PATH
After you have established the correct Informix environment, you must
determine where the pedon program was installed. This could be almost anywhere
on your system, but we have often found it in /usr/sdis, /usr/soils/sdis or
/soils/sdis.
Steve Speidel suggests that the easiest way to establish your Informix
environment is to enter the following command:
. /usr/lbin/pedon (Bourne shell)
This command should establish both your Informix environment and a group of
pedon program environmental variables. The environmental variable SDIS points to
the root directory where the pedon program was installed.
From the directory where pedon was installed, cd into DBS/sdis.dbs. After you
have positioned yourself in DBS/sdis.dbs, issue the following two commands:
bcheck -y *.idx
bcheck -y *.dat
Information will scroll across your screen as this utility runs. The -y
option means “answer yes to all questions”, which means “yes, make any needed
repairs”. Please remember that you must be logged in as “informix” to be able to
run this utility. If you enter a bcheck command and your system responds with
something to the effect “command not found”, your Informix environment is not
properly configured. If you enter a bcheck command and your system responds with
“Error: cannot open C-ISAM file”, you are not logged in as “informix”.
After you have completed this step, you can then do the following exports, in
any order.
Naming Your Export Files
Please make sure the both resulting export files have exactly the same name
prior to any file name extensions. If you do not do this, both exports might
erroneously end up being converted into NASIS resulting in duplicate pedons.
The pedon program export utility restricts the name you select to 10
characters. Given this limitation, here is what we recommend.
As a general guideline, try to assign a file name with the following
components:
The first 5 or 2 characters should be the soil survey area ID, for data from
a project office, or the state alpha FIPS code for data from a state office.
The next 3 characters should be “pdp”. This will help identify this file as a
pedon data export file.
The last character is an optional sequence number to distinguish between
multiple export files created by the same office.
Example 1: The name for the pedon program export file from the Lancaster
Co. NE project office would be “ne109pdp.arc”. The name for the dbexport
export file from the Lancaster Co. NE project office would be
“ne109pdp.tar.z”.
Example 2: The name for the pedon program export file from the Montana
state office would be “mtpdp.arc”. The name for the dbexport export file
from the Montana state office would be “mtdpd.tar.z”.
We will distinguish pedon program exports from dbexports from the same
database by whether the file extension is .arc (pedon program) or .tar.z (dbexport
process).
Export Process 1 - Using the Pedon Program
Before running this procedure, please make sure that you have completed the
procedure described in the section titled “Before You Export Your Pedon Data”.
Also, before you start this procedure, please run the utility named “cr_cleanup”
in the sdis/bin directory. Steve Speidel of the Soils Hotline tells me that
running this utility insures that the data you export will be able to be
successfully imported.
- After running “cr_cleanup”, fire up the pedon program and select
“Transfer” from the main menu, and then select “Export Pedon Data”. Do this
will bring up a dialog box.
- In the dialog box, for “Records to export:”, select “All”.
- For “Export to:”, select “File”.
- For “Path name:”, you can either accept the default or enter the
directory of your choice.
- For “File name:”, enter the name you want to assign to the export file.
(See the section titled “Naming Your Export Files”.) Do not provide a file
extension. The resulting single file will be named “yournamehere.arc”, where
“yournamehere” is the name that you provided.
Export Process 2 - Informix dbexport
Before running this procedure, please make sure that you have completed the
procedure described in the section titled “BEFORE YOU EXPORT YOUR PEDON DATA”.
This dbexport procedure will not work if you have not correctly established your
Informix environment. Also, remember that in order to be able to run the
Informix utility dbexport, you must be logged in as “informix”.
In order to run this utility, you must know the directory where the pedon
program was installed. This could be almost anywhere on your system, but we have
often found it in /usr/sdis, /usr/soils/sdis or /soils/sdis.
To run the dbexport utility, position yourself in a directory where you have
write access. Make sure that a sub-directory by the name of “sdis.exp” does not
already exist in that directory. Once you have done this, issue the following
command:
dbexport /pedon_install_directory/DBS/sdis
Example: If the pedon program was installed in /usr/sdis, you would use
the following comand:
dbexport /usr/sdis/DBS/sdis
This utility will then create a file by the name of “dbexport.out”, and a
sub-directory by the name of “sdis.exp”, in your current working directory.
Information will scroll across your screen as this utility is running.
Once the utility has finished, copy “dbexport.out” into “sdis.exp”, and then
cd into “sdis.exp”.
Next, in the sdis.exp directory, create a text file named “readme.txt” with
the following information:
Export file name prefix (the part of the name before .arc or .tar.z) This
prefix should be common to the both the export file generated by the pedon
program and the export file created by the dbexport process. (See the section
titled “Naming Your Export Files”.)
- Your name
- Your phone number
- Your e-mail address
- The date that you created the export file
- The location of the office that created this export
- A narrative text description of the contents of this export
Now we are going to tar up and compress all of the individual files that
dbexport created, and the “readme.txt” text file that you created, into a single
compressed file using the following commands:
tar cf yournamehere.tar * (creates a file named “yournamehere.tar”)
pack -f yournamehere.tar (creates a file named “yournamehere.tar.z”)
What to do With Your Export Files
The program to convert your pedon data into NASIS is now operational. The
window for converting your pedon data is from August 2000 until NASIS 5.0 is
released, which is currently scheduled to be delivered near the end of 2000.
Pedon data is being converted at the 17 MLRA offices. After you have prepared
your pedon data for conversion, please transfer that data to your MLRA office.
If you have any questions about the procedures described in this document,
please contact either Tammy Cheever or Steve Speidel at the Soils Hotline at
(402) 437-5379 and (402) 437-5378 respectively.
How to Copy the Export Files to Diskette
Most sites that we have worked with are running a version of UNIX where the
system administration utility FACE is available. FACE may be used to format a
floppy diskette. In most cases, the address of the 3.5 inch floppy diskette has
been /dev/rdsk/f03ht.
After you have formatted a floppy diskette, the files may be cpio'ed to
diskette using the following command:
ls yournamehere.arc | cpio -ovcd -O/dev/rdsk/f03ht (for a pedon program
export file)
or
ls yournamehere.tar.z | cpio -ovcd -O/dev/rdsk/f03th (for a dbexport
export file)
Pedon Database Decommissioning Cookbook
- Log in as “informix”.
- Establish your Informix environment by setting INFORMIXDIR and making
sure that $INFORMIXDIR/bin is in your path. The easiest way to do this is to
enter the following Bourne shell command: . /usr/lbin/pedon
- Position yourself in the proper directory and run the two “bcheck”
commands.
- Run the pedon utility “cr_cleanup”.
- Export all data from your pedon database using the Pedon program's
export menu item, into a single file whose name follows our suggested naming
conventions.
- Position yourself in a directory where you have “write” permission and
run the Informix utility “dbexport”: dbexport /pedon_install_directory/DBS/sdis
- Copy “dbexport.out” into the “sdis.exp” directory.
- Position yourself in the “sdis.exp” directory and create the “readme.txt”
file using the guidelines provided in this document.
- Tar up and pack the individual export files into a single file whose
name follows our suggested naming conventions.
- Transfer your pedon data to your MLRA office for conversion to NASIS.
- You may optionally want to do something to insure that the pedon
database for which you just created exports, is never used again to enter
new pedons. The easiest way to insure this would be to delete everything
from the directory where the pedon program was installed, including all
sub-directories. You may wish to not do this until we have verified that
your export files are OK.
|