Entering content frame

Procedure documentation Call Options of the Loader CLI Locate the document in the library structure

You can call the Loader using the Loader CLI Client (LOADERCLI). By specifying the corresponding options, you can control the settings of the operating mode and transfer connection information and so on.

Procedure

You can specify options when you call the Loader CLI.

loadercli [<options>]

Call up the help to get an overview of all options.

loadercli -h

Explanation

The input to the Loader can happen via three operating modes: interactive transport mode, command file mode and session mode.

In transport mode the user is interactively prompted for input to export application data from one database instance and import it into another database instance. The input parameters and the loader configuration file are used to generate and execute the syntax of the loader commands.

The generated Loader commands are optionally displayed on the console and the user can then use them as templates for commands he has written himself. In the actual transport mode, no knowledge of the loader syntax is required.

In command file mode, a command file written by the user is processed sequentially. In contrast to transport mode, the command file can contain any sequence of Loader commands and SQL statements. However, in most cases a slight modification of the Loader commands generated in transport mode will suffice.

In session mode the user can transfer the Loader commands and SQL statements to the Loader directly via the console.

Options for Setting up the Operating Mode

The option that is required for determining the required operating mode always has to be specified.

options

-p
[<connect_options>]
[<transport_options>]

Loader CLI transferred into transport mode, if you specify option –p.

See also:
Transport Mode

<transport_options>

Transport Mode: Options

-b <command_file>
[<connect_options>]
[<in_output_options>]
[<version_options>]

Loader CLI is transferred into command file mode, if you specify option –b.

See also: Command File Mode

<command_file>

Command File

[<connect_options>]
[<in_output_options>]
[<version_options>]

Loader CLI is transferred into session mode, if you specify neither option –p nor option –b.

See also:
Session Mode

Options for Transferring Version Information

Version information can be transferred in all operation modes.

connect_options

-d[SRC|TRG] <database_name>

Name of database instance

-u[SRC|TRG] <database_user>[,<password>]

Name and password of the database user

-n[SRC|TRG] <database_computer>[:<port>]

Name of database computer

-s[SRC|TRG] <database_schema>

Name of the schema

-e <encryption>

Encryption method.

You have to use the entries SRC and TRG in transport mode. They are not available in command file and session mode.

See also:

Options for Establishing a Connection

Options for Controlling Input and Output

You cannot specify options for controlling input and output in transport mode.

in_output_options

-o[w|a] <file_name>

Name of the output file

-cs <separator>

Specifies a command separator

-ps <number><string>

Specifies a substitution parameter

-E <number>

Maximum permitted number of errors

See also:

Options for Input and Output

Options for Determining Version Information

You cannot specify options for determining version information in transport mode.

version_options

-V

Version of the Loader server

-v

Version of the Loader CLI

-R <dependent_path>

Directory that contains the programs that depend on the version of the database software

See also:

Options for Determining Versions Information

Examples

Example

Calling the Loader in Transport Mode

loadercli –p –t export -dSRC demodb -uSRC mona,red –nSRC genua –sSRC hotel

The Loader establishes a connection to database instance DEMODB for user MONA to export data from the schema HOTEL. The further input interactively happens in transport mode.

Example

Calling the Loader in Command File Mode

loadercli -b command.dat -d demodb -u mona,red –E 20

The Loader establishes a connection to the database instance DEMOB for the user MONA. The Loader processes the commands and statements contained in the command file command.dat. If errors occur (return code <> 0) in doing this, the processing of the command file is terminated as soon as 20 error messages have appeared.

Example

Calling the Loader in Session Mode

loadercli –d DEMODB -u mona,red

The Loader establishes a connection to the database instance DEMOB for the user MONA. The Loader then waits for the commands and SQL statements in the command line, and processes them.

See also:

Transport Mode: Examples

Result

Before it connects to the database instance, the Loader CLI first evaluates the relevant options. The Loader then executes the commands and SQL statements in the command file (or those entered interactively).

In all operation modes the Loader writes the log file  loader.prt and additional information if appropriate.

Errors

If errors occur when commands or SQL statements are processed, the way in which the Loader responds depends on the operation mode in which it was used.

·        Transport mode: The Loader stops processing the commands and SQL statements when an error occurs. Detailed information is written to log files. For the export and import the errors are written to log file loader.prt. In case of a transport there is a separate log file for the export and the import.

·        Command file mode: The Loader stops processing commands and SQL statements after a defined number of errors, and exits. You can use the option –E to define the number of errors that the Loader ignores before it stops processing commands. If you do not use the optionE, the Loader stops running after the first command with an error. You cannot react to the errors when you are using the Loader CLI.

·        Session mode; The Loader reports the error that has occurred and then awaits further input for processing.

Note

If you want to respond to errors, the Loader functions are available as a library for the Perl and Python script languages.

See also:

Perl Manual, SAP::DBTech::loader Module

Python Manual, Modul sdb.loader

 

Leaving content frame