Considering TD space, we planned to export the old data to dat file and when ever we required load it again. I am using below fexport script to export data with MLOAD option.
.BEGIN EXPORT SESSIONS 20;
.EXPORT OUTFILE temp.dat
LOCKING ROW FOR ACCESS
SELECT * FROM DB.TABLE_NAME;
> dat file data is not readable format (see sample data below).
0 2916221161¹4 1130ÓL
02111211030Ï Õ·1 1230Ó/
> Row count also not matching with table record count.
Can you please clarify for the below questions.
1. How to ensure exported dat file is correct upon successful completion of my job.
2. Can I load sample 100 records adding some condition in MLOAD script. If yes please let me know the option and where to change in the mload script.
Please help me Fast export with MLSCRIPT option (all the details are mentioned above):
Why the O/P file is not redable format?
How to ensure the O/P file is correct?
How to load sample data from O/P file to table?
Thanks in advance.
By default, data exported from the Teradata database is output in binary format.
If you would like to know more about this, please refer to the FastExport Reference Manual.
The FastExport utility cannot output the data in delimited format.
If the resulting data file is binary, you can do one of 2 things:
1. look at the binary data file and see if it is correct.
2. take the output file and re-load it into a new database table and check to see if it is correct.
If you are trying to load a subset of rows, please check the MultiLoad documentation for the necessary commands to achieve that.
I am not sure this forum is the correct place to teach someone how to look at binary data to see if the data is correct.
You have to know how to interpret the values for each byte.
Obviously, if your schema is:
the first 4 bytes will represent the integer and the next 10 bytes after that will represent the value for F2.