LOADOPT
Utilice la opción LOADOPT para pasar opciones específicas al mandato Load de Db2® .
Puede utilizar esta opción para generar un mandato de carga de Db2 con opciones específicas. También puede utilizar esta opción al realizar una migración de datos automática.
- LOADOPT
- Sintaxis
- LOADOPT (opciones_carga)
- Variable
- opción_carga
- Valor predeterminado
- Ninguna.
Ejemplo
El siguiente ejemplo ilustra el uso de la opción LOADOPT en un archivo de control:GLOBAL CONNECT TO SAMPLE;
UNLOAD TABLESPACE
SELECT * FROM EMPLOYEE;
OUTFILE("outfile")
LOADFILE("loadfile")
LOADOPT (STATISTICS USE PROFILE,
LOCK WITH FORCE,
DATA BUFFER 100,
COPY YES (TO “/dir1”, “/dir2”))
FORMAT DEL INTO EMP_TARGET;Cuando Optim High Performance Unload se ejecuta con el archivo de control, se genera el siguiente informe de ejecución:INZM031I Optim High Performance Unload for Db2 06.01.00.001(120215)
64 bits 02/15/2012 (Linux lat194 x86_64)
INZI473I Memory limitations: 'unlimited' for virtual memory and 'unlimited' for data segment
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+
000001 GLOBAL CONNECT TO SAMPLE;
000002 UNLOAD TABLESPACE
000003 SELECT * FROM EMPLOYEE;
000004 OUTFILE("outfile")
000005 LOADFILE("loadfile")
000006 LOADOPT (STATISTICS USE PROFILE,
000007 LOCK WITH FORCE,
000008 DATA BUFFER 100,
000009 COPY YES (TO “/dir1”, “/dir2”))
000010 FORMAT DEL INTO EMP_TARGET;
000011
INZU462I HPU control step start: 10:55:35.262.
INZU463I HPU control step end : 10:55:36.645.
INZU464I HPU run step start : 10:55:36.840.
INZU410I HPU utility has unloaded 42 rows on lat194 host for I910.EMPLOYEE in outfile.
INZU442I HPU utility has generated the LOAD file loadfile (LRECL=0).
INZU465I HPU run step end : 10:55:36.895.
INZI441I HPU successfully ended: Real time -> 0m1.632913sy se genera el siguiente mandato de DB2 Load:LOAD FROM "outfile" OF DEL
MODIFIED BY CODEPAGE=1208
INSERT INTO "EMP_TARGET" ("EMPNO","FIRSTNME","MIDINIT","LASTNAME","WORKDEPT","PHONENO","HIREDATE","JOB","EDLEVEL","SEX",
"BIRTHDATE","SALARY","BONUS","COMM")
STATISTICS USE PROFILE
COPY YES TO “/dir1”, “/dir2”
DATA BUFFER 100
LOCK WITH FORCE;Para
una migración automática con una opción LOADOPT, la ejecución de DB2 Load subyacente tendrá en
cuenta las opciones LOADOPT especificadas.