Вы находитесь на странице: 1из 6

Teradata FastExport Introduction to FastExport

FastExport can work on Unix, AIX, Solaris, Windows 95/2000/NT/XP where client systems are connected to Teradata RDBMS through network. It also runs on Channel-attached client systems with VM and MVS operating systems. FastExport runs in two modes : Interactive and Batch. One FastExport command begins on a new line with a dot (.) character and ends with a semicolon ( ; ) character. These commands perform two kinds of activities when called. The first kind of command is for Support activities such as establish sessions with RDBMS and set the executing environment and so on. The second kind is for Task activities which specify the actual processing that takes place for each FastExport task.

Using FastExport
In interactive mode, FastExport use terminal screen and keyboard as the standard output and input streams. In batch mode, you can use > and < redirect the standard output / input streams. If you want to invoke FastExport in interactive mode, use command :
c:\ncr\fexq

You can invoke it in batch mode by using command


c:\ncr\fexq [options] < infile > outfile

Here, infilename is a FastExport job script file which includes all FastExport commands and SQL statements. The outfile is the output file. But it is not the export data file. We need to specify the export data file by using FastExport command EXPORT OUTFILE. The options include :
-b

/* only print the brief info which can be used to determine success or failure. */ /* the name can be ASCII ( 255 ) and KANJISJIS_0S ( 119 ) */ /* specifies a file into which FastExport write error message */ /* the FastExport Command may be RUN FILE, so you can run a job script */ /* maximal number of sessions */ /* minimal number of sessions */

-c characterset_name -c characterset_code -e filename

-r FastExport Command -M -N

When FastExport is executed, it will check whether you specify the above options with fexq command. If not, it will check whether some option parameters are specified in job scripts. If not again, then check FastExport configuration file. At last, it will use the default setting. So you can write a configuration file to specify these options, the name of the file must be fexpcfg.dat

and it must be placed under the current directory for your FastExport utility software. Or you need to use an environment variable FEXPLIB to specify the directory. In network-attached environment, if you want to terminate the FastExport, please execute LOGOFF command and press CTRL+C. If you want to restart the FastExport jobs, your FastExport will utilize the log table in working database specified by LOGTABLE.

FastExport Example
In this example, we will export the data from the table, students, in the database student_info whose owner is user john. For specify the default environment setting, we create a configuration file, fexpcfg.dat, for the job and let FEXPLIB point to its directory. See the following two figures :

Then we need to edit the FastExport job script file, fexp_script, which is under the directory where FastExport works on.

Because we specify the format of the file which contains the values used as SELECT constraint as BINARY, we need to use some tools such as VC++ studio to edit a binary file. See the following figures :

Now, we can run FastExport to finish the jobs described in fexp_script.

Because we set BRIEF as off in the configuration file, we can see many messages printed on the screen of the client terminal. One message is shown that a log table for FastExport already created in the database student_info. Then we can see the exported data in the file, fexp_expdata.

After executing the export job, we also get the MultiLoad script file mloadscript as the following

Вам также может понравиться