Ejemplo: descarga de datos con la generación de un mandato de carga para un destino Swift (sin el uso de variables de entorno)
Para este ejemplo, Optim™ High Performance Unload descargará los datos con la generación de un comando de carga para un destino Swift, con los datos de la cuenta en el archivo db2hpu.dest.
Informe de ejecución:
[i1058@lat111 ~]$ db2hpu -i i1058 -f /home/i1058/sysin
INZM031I Optim High Performance Unload for Db2 06.01.00.001(171127)
64 bits 11/28/2017 (Linux lat111 3.10.0-327.36.1.el7.x86_64 #1 SMP Wed Aug 17 03:02:37 EDT 2016 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 LOCK NO QUIESCE NO
000004
000005 SELECT * FROM EMPLOYEE;
000006 OUTFILE("outfile")
000007 LOADFILE("loadfile")
000008 LOADDEST(OBJECT_STORAGE SWIFT "SWIFT_USER1" WITH STANDARD AUTH)
000009
000010 FORMAT DEL;
INZU462I HPU control step start: 11/28/2017 14:39:29.336.
INZU463I HPU control step end : 11/28/2017 14:39:29.501.
INZU464I HPU run step start : 11/28/2017 14:39:29.533.
INZU410I HPU utility has unloaded 42 rows on lat111 host for I1058.EMPLOYEE in outfile.
INZU684I HPU utility has generated an upload command for the SWIFT destination in the loadfile file.
INZU465I HPU run step end : 11/28/2017 14:39:29.561.
INZI441I HPU successfully ended: Real time -> 0m0.225142s
User time -> 0m0.233890s : Parent -> 0m0.233890s, Children -> 0m0.000000s
Syst time -> 0m0.031985s : Parent -> 0m0.031985s, Children -> 0m0.000000s
Associated Swift section in the db2hpu.dest file:
[Swift]
alias=SWIFT_USER1
auth_version=3
container=container1
user=user1
url=http://lat124.domain.com:5000/v3
domain=default
project=hpu
region=RegionOneExtracto del archivo de salida generado:
[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.00Mandato de carga generado:
[i1058@lat111 ~]$ cat loadfile
#!/bin/sh
echo "Enter password for user 'user1':"
read -s password
echo Start uploading ...
swift --auth-version 3 --os-auth-url http://lat124.domain.com:5000/v3 --os-username "user1" --os-password "$password" --os-project-name "hpu" --os-user-domain-name "default" --os-project-domain-name "default" --os-region-name "RegionOne" upload "container1" --object-name "outfile" "outfile" > "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