Beispiel: Datenentladung mit der Generierung eines Hochladebefehls für eine Dateisystemumgebung
Ausführungsbericht:
[i1110@pc-l-0037 ~]$ db2hpu -i i1110 -f sysin
INZM031I Optim High Performance Unload for Db2 06.05.00.002.05(220518)
64 bits (Linux pc-l-0037 5.3.18-59.10-preempt #1 SMP PREEMPT Fri Jun 25 12:36:56 (6856d31) x86_64)
INZI473I Memory limitations: 'unlimited' for virtual memory and 'unlimited' for data segment
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----
000001 GLOBAL CONNECT TO SAMPLE;
000002 UNLOAD TABLESPACE
000003 SELECT * FROM employee;
000004 LOADDEST(OBJECT_STORAGE FILESYSTEM "fs_alias")
000005 OUTFILE("outfile")
000006 LOADFILE("loadfile")
000007 FORMAT DEL;
INZU462I HPU control step start: 05/18/2022 09:56:43.695.
INZU463I HPU control step end : 05/18/2022 09:56:43.779.
INZU464I HPU run step start : 05/18/2022 09:56:44.075.
INZU410I HPU utility has unloaded 42 rows on pc-l-0037 host for I1110.EMPLOYEE in outfile.
INZU684I HPU utility has generated an upload command for the FILESYSTEM destination in the loadfile file.
INZU465I HPU run step end : 05/18/2022 09:56:44.078.
INZI441I HPU successfully ended: Real time -> 0m0.383293s
User time -> 0m0.042532s : Parent -> 0m0.042532s, Children -> 0m0.000000s
Syst time -> 0m0.019332s : Parent -> 0m0.019332s, Children -> 0m0.000000s
Zugehöriger Abschnitt FileSystem in der Datei db2hpu.dest :
[FileSystem]
#Common params
alias=fs_alias
privatekey=/home/i1110/i1110_lat111_private_key.pem
user=i1110
url=lat111
path=/tmpAuszug aus der generierten Ausgabedatei:
[i1058@lat111 ~]$ cat outfile
"000010","CHRISTINE","I","HAAS","A00","3978",19950101,"PRES ",18,"F",19630824,+0152750.00,+0001000.00,+0004220.00
...
"200340","ROY","R","ALONZO","E21","5698",19970705,"FIELDREP",16,"M",19560517,+0031840.00,+0000500.00,+0001907.00Generierter Hochladebefehl:
[i1110@pc-l-0037(el040701_dev:) ~]$ cat loadfile
#!/bin/sh
echo Start uploading ...
scp -i "/home/i1110/i1110_lat111_private_key.pem" "outfile" i1110@lat111:/tmp > "EMPLOYEE.msg" 2>&1
RC=$?
if [ $RC -ne 0 ]
then
echo "An error occurred while processing the 'outfile' file. The 'EMPLOYEE.msg' file contains the associated execution report."
else
echo "The 'outfile' file has been processed successfully. The 'EMPLOYEE.msg' file contains the associated execution report."
fi
exit $RC