GO Loader Aviation 1.2 is here! Take a look at what's new.
Skip to end of metadata
Go to start of metadata

Example Agent Calls

Prior to running GO Loader Agent you should have edited the GO Loader Agent environment variable script

Accessing Command Line Help

The easiest method to check that you're Agent setup is correct is to run the GO Loader Agent Help command, to return a list of all the commands Agent supports. To do this, review the GO Loader Agent Help Commands page.

GOLoader.bat AGENT help

Creating Tables

In most scenarios you would have already used GO Loader Studio to create your database tables, if not you can use create_all_tables command, on Windows:

GOLoader.bat AGENT create_all_tables -project "C:\example\my_project.glp" -load_list_dir "C:\example\my_log_dir"

Loading Data

With tables created you can load data is two ways:

Load typeGO Loader Agent Example
Single File
GOLoader.bat AGENT load C:\example\my_file.gml -project "C:\example\my_project.glp" -load_list_dir "C:\example\my_log_dir"
All files in a directory
GOLoader.bat AGENT load C:\example\my_data_dir -project "C:\example\my_project.glp" -load_list_dir "C:\example\my_log_dir"

Creating Indices

With the data load you will need to create the indices, on windows:

GOLoader.bat AGENT create_all_indices -project "C:\gl_data\my_project.glp" -load_list_dir "C:\example\my_log_dir"

These are the three most popular Agent commands, here's a full list:

Agent Command Reference

Table Management

create_table <tablename>

Creates the named table in the database. The table must exist in the project being used.

create_all_tables

Creates all tables specified in the project file.

drop_table <tablename>

Drops the named table from the database. The table must exist in the project being used.

drop_all_tables

Drops the all tables specified in the project file from the database.

Loading Files

load <gml file|directory>

Loads data, according to the translation specified in a project file. If a GML file name is specified then that file is loaded. If a directory is specified then GO Loader will search that directory and all sub-directories for GML files and load them all.

 

REQUIRED FOR COU LOADS

load <gml file|directory> -load_as_cou 

Loads data as COU, according to the translation specified in a project file. If a GML file name is specified then that file is loaded. If a directory is specified then GO Loader will search that directory and all sub-directories for GML files and load them all.

Example
rem Load COU data
call GOLoader.bat AGENT load "%DATA_HOME%" -project "%PROJECT%" -load_list_dir "%LOG_HOME%\LOAD" -load_as_cou

load_url <gml source specified by URL>

Loads data from the url specified, according to the translation specified in a project file. Differs from the 'load' command in that the gml source is specified as a URL.

remove_duplicates

This command deletes all features where the feature ids (fids) are duplicated in your data. This duplication can occur if you are supplied with data where the same fid occurs in multiple files, for example geographic chunking in OS MasterMap from Ordnance Survey. Before running the duplicate removal process you should first create all the indices required for duplicated removal using the create_indicies remove_duplicates command.

If you have a large amount of data and do not have the appropriate indices in place remove_duplicates will be very slow and can even takes days to complete.

Index Management

create_index <indexname>

Creates the named index in the database. The index must exist in the project being used.

create_all_indices

Creates all indices specified in the project file.

create_indices <index_type>

Creates all of the indexes of the index type specified. Valid values of <index_type> are:

  • 'all' : All types of index,
  • 'cou' : All indices required to apply change only update,
  • 'remove_duplicates' : All indices required for duplicate removal ,
  • 'fid' : Feature Id Indexes,
  • 'spatial' : All Spatial indices,
  • 'foreign_key' : All Foreign Key indices,
  • 'primary_key' : All primary key constraints,
  • 'feature_reference' : All Reference To Feature indices,
  • 'archive' : All Archive Start date and Archive End date indices,
  • 'primary_key_copy' : All primary copy key indices.

drop_index <indexname>

Drops the named index from the database. The index must exist in the project being used.

drop_all_indices

Drops the all indices specified in the project file from the database.

drop_indices <index_type>

Drops all of the indexes of the index type specified.

  • 'all' : All types of index,
  • 'cou' : All indices required to apply change only update,
  • 'remove_duplicates' : All indices required for duplicate removal ,
  • 'fid' : Feature Id Indexes,
  • 'spatial' : All Spatial indices,
  • 'foreign_key' : All Foreign Key indices,
  • 'primary_key' : All primary key constraints,
  • 'feature_reference' : All Reference To Feature indices,
  • 'archive' : All Archive Start date and Archive End date indices,
  • 'primary_key_copy' : All primary copy key indices.

Applying a COU

reset_cou_session

GO Loader has specific support for OS Change Only Update (COU). When you receive updates in this way you can apply them to you database by loading the files with GO Loader. However, OS COU must be enabled in the 'Loader Configuration' tab of the project being used. Before you apply each set of change files you must reset the COU session. During loading of change files GO Loader uses a number of tables to keep track of changes. Resetting the COU session will ensure that the tables exist and are empty.

You should reset the COU session only once for each set of change files you load (a set of change files being all the files supplied for a particular date for your entire OS product holding).

Archive COU by USERDATE

reset_cou_session_userdate

GO Loader has specific support for Archiving OS Change Only Update (COU). If you wish to Archive your data using a user defined date (userdate) then you need to reset your session by userdate. This is usually the supply date on the DVD.

User date = The archiving user start date (YYYY-MM-DD)

GO Loader Tools

show_tools

Shows a list of the GOLoader tools that are currently available (the jar files for any GO Loader tools must have been placed in the 'tools' subdirectory of the GO Loader installation directory in order to be available).

tool <which_tool> <tool_command> <tool_arguments>

Runs post processing GO Loader Tools via Agent command line. Read Using Tools with Agent for more detailed information

The argument <which tool> is used to specify which GO Loader tool should be invoked. For example, to use the 'FVDS' Tool, use the value 'FVDS' for <which tool>, or 'ITN' for the 'ITN' tool, and 'OSM' for the OSM tool.

Not all tools run with Agent so please check the documentation of the individual tool.

Agent Command Line Parameters

Parameters, such as -project and -load_list_dir, can be set after the command.

Parameters are separated from the command by a space, and prefixed with '-' before the value.

For example:
GOLoader.bat AGENT load C:\data\mydatafile.gml -project C:\goloaderprojects\myproject.glp -load_list_dir C:\logdirectory

 

Some parameters are mandatory (M), while others are optional (O).

 

Here's a full list of parameters:

-project <project file path> (M)

The file name of the project file to be used. This parameter is mandatory.

-load_list_dir <log directory path> (O)

Log files will be placed directly into the directory specified in this parameter. If this parameter is not specified the values set up in the GO Loader Studio 'Loader Configuration' are used.

-load_method <load method> (O)

Valid values for this parameter are "jdbc" and "sqlloader". If "jdbc" is specified GO Loader Agent will load directly to the database. If "sqlloader" is specified SQL*Loader files will be produced. If this parameter is not specified the settings from GO Loader Studio 'Loader Configuration' are used.

-sql_loader_output_dir <output directory> (O)

If SQL*Loader files are produced they will be placed directly into the directory specified in this parameter. If this parameter is not specified and SQL*Loader files are produced the path specified in the GO Loader Studio 'Loader Configuration' are used.

 

  • No labels