## Export

Im Folgenden sollen einige Beispiele des Exports von Daten mit dem Loader CLI im Transportmodus vorgestellt werden.

### Voraussetzungen

Eine Beschreibung der Voraussetzungen finden Sie im Abschnitt Transportmodus.

### Export ausführen

Sie wollen aus der Datenbank DEMODB die Tabelle HOTEL des Schemas HOTEL des Benutzers MONA exportieren. Die Anwendungsdaten sollen dabei als Dateien im CSV-Format exportiert werden. Die Werte der Spalte INFO vom Datentyp LONG der Tabelle HOTEL sollen pro Datensatz in eine separate Datei exportiert werden.

loadercli -p

Package history: C:\Documents and Settings\anna\Application Data\sdb\loader\log\transport.log
Package path: c:\transport
Package name: 200603 12161616

Step 1: Enter a package path
Package path: c:\transport

Step 2: Enter a package comment
Package comment: export

Step 3: What do you want to do
[1] Transport from a source database into a target database
[2] Export from a source database
[3] Import into a target database

Step 3: 2

Step 4: What do you want to do
[1] Choose an export package
[2] Create an export package

Step 4: 2

Step 5: Enter the source database connection
Database computer : genua
Database name : demodb
Database user : mona
Password : red

Step 6: Choose what you want include into the package
[1] Complete user; one file per user
[2] Complete user; one file per user, excluding some tables
[3] Complete user; one file per table
[4] Complete user; one file per table, excluding some tables
[5] Complete schema; one file per schema
[6] Complete schema; one file per schema, excluding some tables
[7] Complete schema; one file per table
[8] Complete schema; one file per table, excluding some tables
[9] Schema tables ; one file per table

Step 6: 9

Step 7: Enter the source database connection
Database schema : hotel

Step 8: Enter the table names you want include into the package

[1] hotel

[2]

Step 9: Choose the transformation streams
[1] Catalog and data
[2] Catalog
[3] Data

Step 9: 1

Step 10: Do you want to specify the data streamformat
[1] Yes
[2] No

Step 10: 1

Step 11: How do you want to export the datastream
[1] Comma separated values; one file per lob column
[2] Comma separated values; one file per lob value
[3] Fixed width values; one file per lob column
[4] Fixed width values; one file per lob value
[5] Platform independent loader records format (with logging)
[6] Platform independent database page format(without logging, backup necessary)

Step 11: 2

Step 12: How do you want to import the data
[1] Row by row (with logging)
[2] Row by page (without logging, backup necessary)

Step 12: 1

Step 13: The package can be executed or generated now.
[1] Execute package to transport data now
[2] Generate package to transport data later

Step 13: 1

Export package name : 200603 12161616
Export package comment : export
Export package creation : 200603 12161616
Export package execution : 200603 12161616
Export package path : c:\transport
Export package status [-T]: EXECUTE
Export direction [-t]: EXPORT
Export package [-p]: TABLE
Export part [-P]: TABLE
Export streams [-s]: CATALOG,DATA,PACKAGE
Export format [-f]: CSV
Export format [-F]: ROW
Export encoding [-c]:
Export lobcolumn [-l]: COLUMNVALUE
Source database computer [-nSRC]: GENUA
Source database name [-dSRC]: DEMODB
Source database user [-uSRC]: MONA
Source database table : "HOTEL"."HOTEL"

Step 14: Continue
[1] OK
[2] CANCEL

Step 14: 1

EXPORT TABLE "HOTEL"
CATALOG OUTSTREAM FILE 'HOTEL.CATALOG' DDL
DATA OUTSTREAM FILE 'HOTEL.DATA' CSV
Start 1 MAXROWS
LOB OUTSTREAM FILE "INFO" 'HOTEL_INFO.DATA###'
;

Package execution time : 10.039s
Package execution log : loader_200603 12161616.log
Package name : 200603 12161616

Die Loader-Kommandos, die während der Ausführung des Exportpakets 200603 12161616 abgearbeitet werden, können Sie in der Protokolldatei loader_200603 12161616.log einsehen.

#### Export erneut ausführen

Wenn Sie den soeben ausgeführten Export erneut ausführen möchten, geben Sie beim Aufruf des Loader CLI den Namen des Exportpakets an:

loadercli –p 20060312161616

Step 1: Enter the source database connection
Database computer : genua
Database name : demodb
Database user : mona
Password : red

Export package name : 200603 12161616
Export package comment : export
Export package creation : 200603 12161616
Export package execution : 200603 12171717
Export package path : c:\transport
Export package status [-T]: EXECUTE
Export direction [-t]: EXPORT
Export package [-p]: 200603 12161616
Export part [-P]: TABLE
Export streams [-s]: CATALOG,DATA,PACKAGE
Export format [-f]: CSV
Export format [-F]: ROW
Export encoding [-c]:
Export lobcolumn [-l]: COLUMNVALUE
Source database computer [-nSRC]: GENUA
Source database name [-dSRC]: DEMODB
Source database user [-uSRC]: MONA
Source database table : "HOTEL"."HOTEL"

EXPORT TABLE "HOTEL"
CATALOG OUTSTREAM FILE 'HOTEL.CATALOG' DDL
DATA OUTSTREAM FILE 'HOTEL.DATA' CSV
Start 1 MAXROWS
LOB OUTSTREAM FILE "INFO" 'HOTEL_INFO.DATA###'
;

Package execution time : 2.152s
Package execution log : loader_200603 12171717.log
Package name : 200603 12161616

Die Loader-Kommandos, die während der Ausführung des Exportpakets 200603 12161616 abgearbeitet werden, können Sie in der Protokolldatei loader_200603 12171717.log einsehen.

#### Exportpaket generieren

Wenn Sie ein Exportpaket nur generieren, jedoch noch nicht ausführen wollen, verfahren Sie wie folgt:

loadercli –p

Package history: C:\Documents and Settings\anna\Application Data\sdb\loader\log\transport.log
Package path: c:\transport
Package name: 200603 22101010

Step 1: Enter a package path
Package path: c:\transport

Step 2: Enter a package comment
Package comment: export_generate

Step 3: What do you want to do
[1] Transport from a source database into a target database
[2] Export from a source database
[3] Import into a target database

Step 3: 2

Step 4: What do you want to do
[1] Choose an export package (updates data)
[2] Create an export package

Step 4: 2

Step 5: Enter the source database connection
Database computer : genua
Database name : demodb
Database user : mona
Password : red

Step 6: Choose what you want include into the package
[1] Complete user; one file per user
[2] Complete user; one file per user, excluding some tables
[3] Complete user; one file per table
[4] Complete user; one file per table, excluding some tables
[5] Complete schema; one file per schema
[6] Complete schema; one file per schema, excluding some tables
[7] Complete schema; one file per table
[8] Complete schema; one file per table, excluding some tables
[9] Schema tables ; one file per table

Step 6: 9

Step 7: Enter the source database connection
Database schema : hotel

Step 8: Enter the table names you want include into the package

[1] hotel

[2]

Step 9: Choose the transformation streams
[1] Catalog and data
[2] Catalog
[3] Data

Step 9: 1

Step 10: Do you want to specify the data streamformat
[1] Yes
[2] No

Step 10: 1

Step 11: How do you want to export the datastream
[1] Comma separated values; one file per lob column
[2] Comma separated values; one file per lob value
[3] Fixed width values; one file per lob column
[4] Fixed width values; one file per lob value
[5] Platform independent loader records format (with logging)
[6] Platform independent database page format(without logging, backup necessary)

Step 11: 2

Step 12: How do you want to import the data
[1] Row by row (with logging)
[2] Row by page (without logging, backup necessary)

Step 12: 1

Step 13: The package can be executed or generated now.
[1] Execute package to transport data now
[2] Generate package to transport data later

Step 13: 2

Export package name : 20060322 101010
Export package comment : export_generate
Export package creation : 20060322 101010
Export package execution : 20060322 101010
Export package path : c:\transport
Export package status [-T]: EXECUTE
Export direction [-t]: GENERATE
Export package [-p]: TABLE
Export part [-P]: TABLE
Export streams [-s]: CATALOG,DATA,PACKAGE
Export format [-f]: CSV
Export format [-F]: ROW
Export encoding [-c]:
Export lobcolumn [-l]: COLUMNVALUE
Source database computer [-nSRC]: GENUA
Source database name [-dSRC]: DEMODB
Source database user [-uSRC]: MONA
Source database table : "HOTEL"."HOTEL"

Step 14: Continue
[1] OK
[2] CANCEL

Step 14: 1

EXPORT TABLE "HOTEL"
CATALOG OUTSTREAM FILE 'HOTEL.CATALOG' DDL
DATA OUTSTREAM FILE 'HOTEL.DATA' CSV
Start 1 MAXROWS
LOB OUTSTREAM FILE "INFO" 'HOTEL_INFO.DATA###'
;

Package execution time : 11.195s
Package name : 20060322 101010

#### Generiertes Exportpaket ausführen

Wenn Sie ein generiertes Exportpaket ausführen möchten, geben Sie beim Aufruf des Loader CLI den Namen des Exportpakets an:

loadercli –p 20060322101010

Step 1: Enter the source database connection
Database computer : genua
Database name : demodb
Database user : mona
Password : red

Export package name : 200603 22101010
Export package comment : export_generate
Export package creation : 200603 22101010
Export package execution : 200603 22121212
Export package path : c:\transport
Export package status [-T]: EXECUTE
Export direction [-t]: EXPORT
Export package [-p]: 200603 22101010
Export part [-P]: TABLE
Export streams [-s]: CATALOG,DATA,PACKAGE
Export format [-f]: CSV
Export format [-F]: ROW
Export encoding [-c]:
Export lobcolumn [-l]: COLUMNVALUE
Source database computer [-nSRC]: GENUA
Source database name [-dSRC]: DEMODB
Source database user [-uSRC]: MONA
Source database table : "HOTEL"."HOTEL"

EXPORT TABLE "HOTEL"
CATALOG OUTSTREAM FILE 'HOTEL.CATALOG' DDL
DATA OUTSTREAM FILE 'HOTEL.DATA' CSV
Start 1 MAXROWS
LOB OUTSTREAM FILE "INFO" 'HOTEL_INFO.DATA###'
;

Package execution time : 2.058s
Package execution log : loader_20060322121212.log
Package name : 200603 22101010

Die Loader-Kommandos, die während der Ausführung des Exportpakets 200603 22101010 abgearbeitet werden, können Sie in der Protokolldatei loader_20060322121212.log einsehen.

Siehe auch:

Import

Transport

Kommandodateimodus

Sitzungsmodus

Loader, Protokolldatei