OTM DM Data Management Guide Release18
OTM DM Data Management Guide Release18
OTM DM Data Management Guide Release18
July 2018
Copyright Notice
Oracle® Transportation and Global Trade Management Cloud Data Management Guide, Release 18
Part No. E95120-01
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
This software and related documentation are provided under a license agreement containing
restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly
permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate,
broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any
form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless
required by law for interoperability, is prohibited.
The information contained herein is subject to change without notice and is not warranted to be error-
free. If you find any errors, please report them to us in writing.
If this is software or related documentation that is delivered to the U.S. Government or anyone
licensing it on behalf of the U.S. Government, then the following notice is applicable:
U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated
software, any programs installed on the hardware, and/or documentation, delivered to U.S.
Government end users are "commercial computer software" pursuant to the applicable Federal
Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication,
disclosure, modification, and adaptation of the programs, including any operating system, integrated
software, any programs installed on the hardware, and/or documentation, shall be subject to license
terms and license restrictions applicable to the programs. No other rights are granted to the U.S.
Government.
This software or hardware is developed for general use in a variety of information management
applications. It is not developed or intended for use in any inherently dangerous applications, including
applications that may create a risk of personal injury. If you use this software or hardware in
dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup,
redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim
any liability for any damages caused by use of this software or hardware in dangerous applications.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be
trademarks of their respective owners.
Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC
trademarks are used under license and are trademarks or registered trademarks of SPARC
International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or
registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group.
This software or hardware and documentation may provide access to or information about content,
products, and services from third parties. Oracle Corporation and its affiliates are not responsible for
and expressly disclaim all warranties of any kind with respect to third-party content, products, and
services unless otherwise set forth in an applicable agreement between you and Oracle. Oracle
Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to
your access to or use of third-party content, products, or services, except as set forth in an applicable
agreement between you and Oracle.
Documentation Accessibility
For information about Oracle's commitment to accessibility, visit the Oracle Accessibility Program
website at http://www.oracle.com/pls/topic/lookup?ctx=acc&id=docacc.
Access to Oracle Support
Oracle customers that have purchased support have access to electronic support through My Oracle
Support. For information, visit http://www.oracle.com/pls/topic/lookup?ctx=acc&id=info or visit
http://www.oracle.com/pls/topic/lookup?ctx=acc&id=trs if you are hearing impaired.
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. iii
Contents
COPYRIGHT NOTICE ................................................................................. III
CONTENTS................................................................................................. IV
TABLES..................................................................................................... VII
PREFACE ..................................................................................................... X
DB.XML.............................................................................................................. 1-1
WHY DO I WANT TO USE DB.XML? ............................................................................................. 1-1
HOW CAN I USE DB.XML? ...................................................................................................... 1-1
CSV ................................................................................................................... 1-2
A SAMPLE CSV FILE .............................................................................................................. 1-2
MULTI-TABLE CSV FILES ......................................................................................................... 1-2
iv Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
IMPORTING DB.XML ........................................................................................................... 2-10
DB XML SERVLET ................................................................................................ 2-11
EXPORT MESSAGE FORMAT ..................................................................................................... 2-11
IMPORT MESSAGE FORMAT ..................................................................................................... 2-13
DB XML WEB SERVICE ......................................................................................... 2-14
EDITING DB.XML FILES ....................................................................................... 2-15
A SAMPLE DB.XML FILE ....................................................................................................... 2-15
WEB INTERFACE FOR IMPORTING AND EXPORTING APPSERVER CSV FILES ........................ 6-2
IMPORTING ......................................................................................................................... 6-2
EXPORTING ......................................................................................................................... 6-2
LOAD CSV FILES IN THE REPORT OWNER DIRECTORY .................................................... 6-2
7. LOADING CSV DATA VIA INTEGRATION ............................................ 7-1
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. v
CSV FILES THAT FAILED TO LOAD ............................................................................. 8-1
BACKGROUND ZIP FILE PROCESSING.......................................................................... 8-1
9. EXPORTING CSV FILES VIA THE INTERFACE...................................... 9-1
13. COPYING RATES BETWEEN DATABASES USING ZIP FILES ............. 13-1
STEP 1 – CREATE A CSVUTIL.CTL FILE (CSVUTIL CONTROL FILE) FOR EXPORTING ............. 13-1
STEP 2 – USE THE INTEGRATION UPLOAD SCREEN TO UPLOAD THE ZIP FILE CREATED IN STEP 1
........................................................................................................................ 13-1
STEP 3 – DOWNLOAD THE ZIP FILE CONTAINING THE RATE OFFERING ............................ 13-1
STEP 4 – CREATE A CSVUTIL.CTL FILE FOR IMPORTING ................................................. 13-1
STEP 5 – CREATE ANOTHER BACKGROUND ZIP FILE ...................................................... 13-1
STEP 6 – UPLOAD THE ZIP FILE FROM STEP 5 TO THE TARGET INSTANCE........................... 13-2
14. IMPORTING VOYAGE SCHEDULE DATA .......................................... 14-1
vi Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
EXAMPLE OF A COMPLEX QUERY .............................................................................. 18-1
19. REFERENCE C: CSVUTIL RESPONSE MESSAGES.............................. 19-1
Figures
Figure 5-1 ............................................................................................................................ 5-3
Tables
Table 2-1 ............................................................................................................................. 2-2
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. vii
Table 15-4 ......................................................................................................................... 15-4
viii Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
Send Us Your Comments
Oracle® Transportation and Global Trade Management Cloud Data Management Guide, Release 18
Oracle welcomes your comments and suggestions on the quality and usefulness of this publication.
Your input is an important part of the information used for revision.
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. ix
Preface
This manual is for members of the Oracle Transportation Management implementation team, who are
responsible for maintaining and updating data in Oracle Transportation Management at your site. This
manual provides step-by-step instructions for importing and exporting data in CSV and db.xml format.
This manual does not cover the installation of any components required to import or export. See the
Administration Guide for for installation and configuration instructions. The latest version of the guide
can be found on the Oracle Help Center website.
Note: This manual provides examples of CSV, XML and schema diagrams. For actual
database tables and schema, refer to the latest database schema and the Integration
schema.
Change History
Date Document Revision Summary of Changes
x Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
1. Introduction
DB.XML
DB.XML (Database-centric XML) is an XML file format for importing and exporting Oracle
Transportation Management data.
The DB XML tool facilitates the direct query/update of data directly from/to the OTM database tables.
As such, the tool should only be used by those already familiar with the responsibilities and
capabilities that come with using such tools and who may already be familiar with database tools like
SQLDeveloper, TOAD etc.
NOTE: Updates made directly to the OTM database by DB XML Import can only ensure
data consistency with respect to the standard database constraints, e.g. Primary Key,
Foreign Key, and Check constraints. Imports do not flow through the main application logic
for updates, and so cannot check that the business context of a particular change makes
sense. For example, the status of a particular object (e.g. LOCATION STATUS) can be
updated. Import can only check that the status GID is valid but not that the status,
possibly in association with other status values, constitutes an appropriate state for the
object to be in.
In the DB XML file, there can be more than one element contained within what is called a
Transaction Set. The TRANSACTION_SET element is used to contain these parent elements. The
parent element itself may contain one or more child element. DB XML Import and Export can work
with complete parent-child table relationships all in one file by using corresponding parent-child
elements. The attribute values on each element correspond to column values.
Note: The convention used here is that a table is called the “child” table if it contains a foreign
key to another table. The table referenced by the foreign key is called the “parent”.
These parent elements typically correspond to the primary OTM data objects – AGENT, LOCATION,
etc., and child elements typically correspond to associated child tables, For example, for the
LOCATION parent table, the child table could be LOCATION_CORPORATION, LOCATION_REFNUM, etc..
In the case where the transaction set is used for data import, each parent element will, by default, be
treated as a distinct transaction, i.e. the parent element and all its child elements are saved to the
database as one atomic transaction. If one child element fails, the parent element transaction fails.
The failure of one parent element does not directly affect the transactions for other parent elements.
Additionally, all parent elements can be treated as one unit of work i.e. if one element fails, ALL
elements in the ‘set’ will fail. The details on how this is achieved are covered in section 2, DB.XML.
Oracle Transportation Management ignores element and attribute names that do not correspond to
valid database table or column names. This allows you to comment your DB.XML file without affecting
what is imported.
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 1-1
Command Line: using the OTM application server remotely.
HTTP POST to servlet on OTM application server (requires authentication)
SOAP web service
See section 2, DB.XML for details.
CSV
CSVUtil is a utility for importing and exporting data in CSV format in and out of the Oracle
Transportation Management database. CSVUtil also exports data as a script of insert statements. This
document describes how to use CSVUtil and shows some sample CSV files.
CSV files are compact and enable you to import large amounts of data into Oracle Transportation
Management. You typically want to use CSVUtil when importing rates into a fresh installation of Oracle
Transportation Management.
ICON
ICON_GID,ICON_XID,DESCRIPTION,PATH,DOMAIN_NAME,INSERT_USER,INSERT_DATE,UPDATE_USE
R,UPDATE_DATE
EXEC SQL ALTER SESSION SET NLS_DATE_FORMAT = 'YYYYMMDDHH24MISS'
"BATCH_GRID","BATCH_GRID","Reports Batch
Grid","/images/icons/reports/batch_grid.jpg","PUBLIC","DBA.ADMIN","20040310091645","DBA.ADMIN
","20040630100834"
Line 2 must be a comma-separated list of column names. Only the columns being loaded must be
specified.
After line 3 may be one or more optional EXEC SQL lines, such as the one shown above, to set the
date format.
Subsequent lines include the data. The number of columns of data must correspond to the number of
columns specified on line 2. The ordering of the data columns must also correspond to line 2.
Character data may be surrounded with double-quotes, as shown above. If you need to include a
double-quote character, use “"” instead. The tools described here to export CSV files
automatically convert double-quote characters into “"”.
1-2 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
The first record in a multi-format file must be "$HEADER".
The header section contains table names and the names of the columns used in that table.
After the header section comes the body, identified by the $BODY keyword.
Each data record in the $BODY must be preceded by its table name on the prior line.
Here is an example:
$HEADER
LOCATION_ROLE_PROFILE
LOCATION_GID,LOCATION_ROLE_GID,CALENDAR_GID,FIXED_STOP_TIME, etc...
LOCATION_STATUS
LOCATION_GID,STATUS_TYPE_GID,STATUS_VALUE_GID,DOMAIN_NAME,INSERT_USER,INSERT_DA
TE,UPDATE_USER,UPDATE_DATE
LOCATION_CORPORATION
LOCATION_GID,CORPORATION_GID,DOMAIN_NAME,INSERT_DATE,UPDATE_DATE,INSERT_USER,UP
DATE_USER
LOCATION_ADDRESS
LOCATION_GID,LINE_SEQUENCE,ADDRESS_LINE,DOMAIN_NAME,INSERT_USER,INSERT_DATE,UPD
ATE_USER,UPDATE_DATE
LOCATION_REFNUM
LOCATION_GID,LOCATION_REFNUM_QUAL_GID,LOCATION_REFNUM_VALUE,DOMAIN_NAME,INSERT_
DATE, etc...
LOCATION
LOCATION_GID,LOCATION_XID,LOCATION_NAME,ADDRESS_LINE1,ADDRESS_LINE2,CITY,etc.
EXEC SQL ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS..'
$BODY
LOCATION
"GUEST.00621918","00621918","00621918",,,,,"TN",,"USA",,,,,"America/New_York",,
,,,,,,"N","N","COMMERCIAL",,,"GUEST","S",0,...etc
LOCATION_ADDRESS
"GUEST.00621918",1,,"GUEST","DBA.ADMIN",2001-10-07 17:53:53.0,,
LOCATION_ADDRESS
"GUEST.00621918",2,,"GUEST","DBA.ADMIN",2001-10-07 17:53:53.0,,
LOCATION_CORPORATION
"GUEST.00621918","GUEST.CUST NO","GUEST",2001-10-15 10:50:49.0,,"DBA.ADMIN",
LOCATION_REFNUM
"GUEST.00621918","GLOG","GUEST.00621918","GUEST",2001-10-25 17:13:48.0,2001-10-
19 18:23:17.0,"DBA.ADMIN","DBA.GLOGOWNER"
LOCATION_ROLE_PROFILE
"GUEST.00621918","SHIPFROM/SHIPTO",,0,0,"GUEST","S",0,"S",0,"N",,,,,,,,,,2001-
10-25 14:12:38.0,2002-08-28 19:13:05.0,"DBA.ADMIN", etc.
LOCATION_STATUS
"GUEST.00621918","GUEST.CREDIT LEVEL","GUEST.CREDIT
LEVEL_UNKNOWN","GUEST","DBA.GLOGOWNER",2001-10-17 09:38:05.0,,
International Characters
Import
To be able to send data to Oracle Transportation Management containing characters outside the 7-bit
ASCII character set, you must:
Make sure your database uses an encoding that can handle all the characters you need.
Always save your files using UTF-8 format.
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 1-3
XML Spy, Textpad and Notepad (Microsoft Windows 2000 or better) can all save in UTF-8 format.
Before you edit your files, you need to ensure that you configure your text editor to use the
appropriate font and script (sometimes called subset). A script is a collection of characters such as
Western European, Greek or Turkish. For example, if you need to update files containing Czech
characters, then you need to select a font that supports an Eastern European script such as Arial or
Arial Unicode Ms.
Export
When exporting files, Oracle Transportation Management writes files in UTF-8. Note that when you
view data in your browser and then use the view source option to save your data, just save your file
without specifying an encoding. Later, when editing your file, use an editor that support UTF-8.
Best Practices
Whether you are using DB XML or CSV export, you should follow some basic rules to help maintain
proper version control and avoid data inconsistencies.
In order to maintain proper version control and track all changes that are being made to agents, we
recommend that you do not update existing active agents. Instead, we recommend the current
agent be disabled and that a new agent is created with the changes that need to be made. This will
allow you to easily revert back to the previous version should you run into anything unexpected when
the new agent is being used.
This can be achieved simply by adding a date, "02252013" or a version identifier ‘V#’, i.e. "V1”, “V2”,
“V3" etc. to the end of the AGENT_XID when the agent is being created. If an existing agent is
exported, modify the AGENT_GID and AGENT_XID before it is imported into another instance.
For instance if you want to create a new agent you may call it "SHIPMENT-CREATED V1".
If you decide you want to make changes to this agent you would create a new agent called
"SHIPMENT-CREATED V2", turn off "SHIPMENT-CREATED V1", and turn on the new agent.
Now if you decide the new agent is not working as expected the new agent can simply be turned off
and the original agent can be turned back on to restore the original workflow.
Migration Project
The Migration Project feature, added in Oracle Transportation Management v6.3.2, introduces a
standard way to define and manage one or more datasets for the purpose of migrating data from one
Oracle Transportation Management instance to another.
Although the Oracle Transportation Management application is fully functional “out of the box”, an
operational system will typically require some configuration. Best practice would be for such a
configuration to be developed and tested in a pre-production environment, accepted by product and
business/operational experts and then promoted to the production environment.
At a high level, an ‘Export’ migration project is defined on source system. This migration project
contains data set represents object groups and objects are that needs to be migrated. There are two
ways to import this data set on to the target system.
1-4 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
Migration Process will create or update corresponding ‘Import’ migration project on the target system
to list the imported data and the success and failures.
For more information on the Migration Project Process refer to the online help How-To Topic: Promote
To Production (P2P) Process.
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 1-5
2. DB.XML
DB XML Export
The DB XML Export process produces a transaction set which can be viewed in the UI or saved as an
external XML file.
By default, LOB data (BLOB and CLOB) is exported as a ‘base 64’ encoded string attribute value.
Working with the CLOB data, for example, would require decoding the string to obtain the original
character text, editing the text and then encoding again to a ‘base 64’ string.
To make this process easier it is now possible to export LOB data as separate elements. For example,
if parent_col2 is a CLOB column and parent_col3 is a BLOB column:-
The attribute value for the LOB column will then contain a unique ID for the element containing the
CLOB or BLOB content. Note that BLOB content must always be a ‘base 64’ encoded string. The
“useLOBElement” is generated on export and required on import for DB.XML files that contain the
above format.
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 2-1
property which contains the name of file containing the SQL query to execute to retrieve the required
data.
For example, the following property specifies the file to be used to retrieve data for the LOCATION
Object Name:
glog.integration.dbxml.query.LOCATION=sql/Location.sql
The following is an excerpt from the contents of the file provided with the standard installation:-
select location.*,
cursor (select location_accessorial.* from location_accessorial where
location_accessorial.location_gid = location.location_gid) as
location_accessorial,
…etc…
from location
The use of a “cursor” is to produce the child element, in this case for the LOCATION_ACCESSORIAL
records for this location, and there is a cursor for every required child table (and in “grandchild” tables
and so on).
Table 2-1
LOCATION sql/Location.sql
RATE_GEO sql/RateGeo.sql
RATE_OFFERING sql/RateOffering.sql
AGENT_ACTION sql/AgentAction.sql
AGENT_EVENT sql/AgentEvent.sql
AGENT sql/Agent.sql
CORPORATION sql/Corporation.sql
SAVED_QUERY sql/SavedQuery.sql
SAVED_CONDITION sql/SavedCondition.sql
USER_MENU_LAYOUT sql/UserMenuLayout.sql
MONITOR_PROFILE sql/MonitorProfile.sql
SHIPMENT sql/Shipment.sql
STATUS_TYPE sql/StatusType.sql
2-2 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
Object Name SQL File
WORKFLOW_TOPIC_INFO sql/WorkflowTopicInfo.sql
NOTIFY_SUBJECT_CONTACT sql/NotifySubjectContact.sql
PLANNING_PARAMETER sql/PlanningParameter.sql
BN_RULE sql/BNRule.sql
NOTIFY_SUBJECT_STYLESHEET sql/NotifySubjectStylesheet.sql
OB_ORDER_BASE sql/ObOrderBase.sql
New customer-defined object names and SQL files can be added by setting the associated properties.
The use of a ‘where clause’ is optional for the export by Object Name as it is feasible that the SQL file
can contain the complete statement.
Note: In order to be somewhat generic, the provided files all require a ‘where clause’ to
retrieve a specific record. Without it, ALL records for the object name will be retrieved.
Table 2-2
New customer-defined object set names and object lists can be added by setting the associated
properties.
Migration Entity
The Migration Entity names are a list of all the application objects available in OTM. They are designed
to support the export of a top level object, e.g. Location and all its child objects, e.g. LocationStatus,
LocationRefnum, etc. However, the list also contains the respective child entity names to support fine
grained export.
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 2-3
The specific entities are retrieved based on a comma separated list of unique object primary keys for
the entity name selected. For example, if Location were the selected entity the Object ID would be a
comma separated list of Location Primary Key strings.
DB XML Import
The DB XML import process takes a transaction set, contained in an input XML file or message, and
inserts, updates, or deletes rows in OTM tables. It can also completely replace a current set of child
records with a new set.
Execution Mode
The execution of the import is done via the application business logic (formerly called APP mode). This
makes available the capabilities to refresh associated application cache and to raise lifetime events for
the objects create, modified or removed as part of the import.
The valid parent/child relationships are determined by the persistence logic internal to the OTM
application server. Therefore, imports should normally only be used for data exported using the
Migration Entity export type. Content exported via other DBXML execution modes in earlier releases
may still be imported but any customer-defined parent/child relationship tree must be a subset of that
produced by the Migration Entity export type.
Transaction Code
The Transaction Code specifies how the transaction set is to be processed and will be one of:-
Replace Children
When using the RC transaction code the child tables that should be involved can be specified as
Managed Tables. There are also some standard managed tables defined for some data objects which
are combined with any managed tables entered as input.
2-4 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
Table 2-3
AGENT_EVENT AGENT_EVENTS_INVALID_ACTION
CORPORATION CORPORATION_INVOLVED_PARTY
SAVED_CONDITION SAVED_CONDITION_QUERY
USER_MENU_LAYOUT USER_MENU_LAYOUT
STATUS_TYPE STATUS_VALUE
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 2-5
Refresh Cache
The OTM application maintains a number of in-memory cache objects to improve performance.
Historically, DBXML was not able to refresh these cache objects and so occasionally required a restart
of the application to pick up some modifications.
When importing, the Refresh Cache flag is available to indicate that any cache objects associated with
the imported data should be refreshed. For example, if the imported data contained a new workflow
Agent which is ‘active’, this agent would automatically subscribe to its listening events and be
available to be triggered by, for example, SHIPMENT – MODIFIED events.
Lifetime Events
Whenever certain objects are modified via the application, lifetime events are raised for CREATE,
MODIFIED and REMOVED modifications. When the new Lifetime Events flag is used, these events will
now also be raised for data imported via DBXML. For example, if a TRANSACTION_SET contains a new
LOCATION, the LOCATION – CREATED event will be published.
Commit Scope
By default, each parent element in a TRANSACTION SET is treated as a separate database transaction
i.e. if one failed others could potentially succeed.
There is now a new field for Commit Scope which defaults to the current behavior with the scope of
‘PK’. There is a new value of ‘SET’ which indicates that all elements in the TRANSACTION SET must
succeed or all will fail.
2-6 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
i. Migration Entity Name: For example “Location”
ii. Object IDs: For example “GUEST.MY_LOC_1, GUEST.MY_LOC_2”.
4. Optionally select to export Foot print columns or Large Objects as elements
5. Click Run. Oracle Transportation Management displays the results page.
For example, the following shows an export with DB Object as LOCATION and the ‘where clause’ as
LOCATION_GID = ‘NYC’
Note: Refer to the Oracle Transportation Management Data Dictionary for more
information about what the objects can contain.
Note: Oracle Transportation Management does not display elements that are empty in the
database.
View the source for the frame containing the displayed XML using your browser and save as a file with
the “.db.xml” file extension. The steps to view the source vary from browser to browser.
Note: If your output is too large for Notepad, you need to the command line to execute the
command.
Note: Especially if your data contains non-ASCII characters, just save your file as-is and
use an editor that supports UTF-8 when editing the file later on.
Importing DB.XML
This section describes how to import a DB.XML file using the web-based user interface.
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 2-7
Oracle Transportation Management displays summary statistics with a successCount and an
errorCount. The count is the number of transactions that were successful or in error.
The DB XML command line operates as a remote web client (using the same API as the web UI).
The user’s environment must be correct. In particular, the GLOG_HOME environment variable must be
defined to point at the <otm_home> directory, and the CLASSPATH environment variable must be set
as it is for running WebLogic.
Some required parameters depend on the mode selected. The following are the required parameters
for each mode:
Table 2-4
Parameter Usage
web The hostname of the OTM application server where the request will be sent via
“http” (default). If non-standard ports are used, the format given should be
[The server hostname:port.
parameter still
functions but is Note: The default scheme of “http” can be modified by setting the property :-
deprecated]
glog.util.command.scheme=scheme
For example,
glog.util.command.scheme=https
username OTM application user name to used for execution of database commands. This
is required for the correct VPD security.
password OTM application password to use for execution of database commands. If not
specified and executing in an interactive user session, DBXML will prompt at
the interactive session standard input for a password. If executing in a non-
interactive environment (no login terminal), this parameter is required;
however, it is considered unsafe to use when prompting can be done because
such a password can be seen in the Unix/Linux ps command’s output.
Database direct access and backend internal API modes have been removed, so the legacy -app, -
dbURL, -dbConn, -dbUsername, and -dbPassword parameters have no effect.
1See OTM Administration Guide for complete instructions on configuring a Java command
environment.
2-8 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
Exporting DB.XML
Following are the additional command line parameters for the DBXML export command “xmlExport”:
Table 2-5
Parameter Usage
Or
-dbObjectSetName Specifies the Object Set Name. See Using an Object Set Name.
Or
-sqlFile
Same as -sqlQuery except that the statement is contained in a file (useful
to avoid issues with the command shell and special characters)
Or
-entityName
Specifies the Migration Entity. See Migration Entity
-rootName Used in conjunction with -sqlQuery and -sqlFile to provide the root XML
element of each retrieved object.
-pkList Used in conjunction with -entityName to provide the list of object PKs to
be retrieved.
-footPrint Flag available for all commands and indicates if INSERT and UPDATE
date/time and user columns are retrieved.
-useLOBElement Flag available for all commands and indicates if LOB column data is to be
exported as separate elements or as base 64 encoded attribute values.
-localDir & - Used to specify that results should be saved to a file rather than displayed
localFileName to the console.
The following is an example of exporting (using remote web server access by default) the first
RATE_GEO database object found in the database:
This example creates the file “rate_geo1.db.xml” in the current working directory.
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 2-9
You need to modify the following arguments specific to your situation:
Using a SqlQuery
The following is an example of exporting (using internal API client access) all the activity records in
the database:
The above command creates the activity.db.xml file in the current working directory.
Importing DB.XML
Following are the additional command line parameters for the DBXML export command “xmlImport”:
Table 2-6
Parameter Usage
-inputXMLFile Full Path Name of the file containing the DBXML transaction set to be
imported.
-transactionCode The transaction code for the import. See the Reference A: DB.XML
Transaction Codes section for possible transaction codes.
-managedTables If the transaction code is RC, this specifies the managed tables that are to
be considered for child deletion.
-events Indicator to specify that lifetime events should be published for modified
data.
You can use dbxml.sh or dbxml.bat (depending on platform) to import a client-side db.xml file into
a remote Oracle Transportation Management instance.
2-10 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
dbxml.sh xmlImport -web localhost -username DBA.ADMIN -password -
transactionCode IU -inputXMLFile rate.db.xml
Oracle Transportation Management ignores element names that do not correspond to a database
table. This allows you to comment your DB.XML file without affecting what is imported.
DB XML Servlet
It may be convenient to export and import DB XML data remotely from the OTM application. This can
be achieved in a number of ways; by sending XML messages via HTTP POST to a servlet on the OTM
Web Server (discussed in this section) or as a SOAP message to a Web Service on the OTM Application
Server (discussed in the next section).
The HTTP POST body should use the format defined below and be sent via HTTP POST to the
glog.integration.servlet.DBXMLServlet.
The servlet requires authentication using HTTP Basic Authentication. If the network used for
communication cannot be assumed to be secure, the HTTPS protocol should be used.
Additionally, the URL command parameter should specify which DBXML command should be executed
i.e. xmlImport for Import and xmlExport for Export. A complete example URL would therefore be:
http://localhost/GC3/glog.integration.servlet.DBXMLServlet?command=xmlExport
Note: It is necessary for the XML content to be specified as "text/xml". In curl this is done by adding
the option: -H "Content-Type:text/xml".
Note: The at-sign “@” prefix on the filename specified with the -d option is required to inform curl
that the parameter is a filename containing the XML text to be sent, rather than the literal text itself.
For example,
The following is the format for the XML message to export XML based on a DB object name:
For example,
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 2-11
<DBObject>
<Name>LOCATION</Name>
<Predicate>location_gid = ‘GUEST.MY_LOC’</Predicate>
</DBObject>
<FootPrint>N</FootPrint>
<UseLOBElement>Y</UseLOBElement>
</sql2xml>
Object Set
The following is the format for the XML message to export XML based on a DB object set name:
For example,
Query
The following is the format for the XML message to export XML based on a SQL query:
For example,
2-12 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
Note: It is necessary to encode the SQL comparison operators (<, >) with < and >
For example,
Migration entity
The following is the format for the XML message to export based on a Migration Entity name:
For example,
The response XML will be the TRANSACTION_SET XML identical to that seen in the UI.
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 2-13
</TRANSACTION_SET>
</xml2sql>
For example,
The response XML will contain the counts for successful or error transactions.
<xml2sql>
<SuccessCount>n</SuccessCount>
<ErrorCount>m</ErrorCount>
<ElapsedTime>p</ElapsedTime>
<TimePerTransaction>q</TimePerTransaction>
</xml2sql>
Where n, m, p & q are integers and p & q are the number of milliseconds.
http://<server:port>/GC3Services/glog.integration.webservice.command.CommandSer
vice?WSDL
Where server and port are specific to the host and port configured for the WebLogic server running
OTM (aka the OTM application server).
The service is secured via Web Service Security in common with all other OTM Web Services and so by
default requires the WSS Username Token Profile over HTTPS for authentication.
The SOAP messages (defined in the WSDL) are essentially identical to the messages used for the DB
XML Servlet but will be ‘wrapped’ in the corresponding command/operation name, i.e.:
<xmlExport>
<sql2xml>
<…elements as described previously>
</sql2xml>
</xmlExport>
and
<xmlImport>
<xml2sql>
2-14 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
<…elements as described previously>
</xml2sql>
</xmlImport>
When editing date and time values, be sure to keep the following format: YYYY-MM-DD HH:MM:SS.
If you miss an element in the exported file this is probably because Oracle Transportation
Management does not export elements that are empty in the database. This means that you will have
to add the tag to the DB.XML file yourself. Refer to the Oracle Transportation Management Data
Dictionary for more information about what objects and tables exist.
Oracle Transportation Management ignores element names that do not correspond to the database
table. This allows you to comment your DB.XML file without affecting what is imported.
As you edit the file, keep all element and attribute names in uppercase.
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 2-15
3. Loading CSV Data via the Command Line
This chapter describes how to import and export CSV from the command line.
CSVUtil supports the following commands and arguments (note that some of these options conflict and
should not be used in combination, as noted below):
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 3-1
Table 3-1
Commands Arguments
dd- delete data, while suppressing “no data found” constraint violations
xcsvcd - export a multi-table CSV file with all subordinate child tables
(e.g. shipment_stop, shipment_stop_d etc. for the shipment table). A
table set called C.<table_name> controls which tables are considered to
be children of a given table. For example, the C.SHIPMENT table set
contains the following tables: shipment_stop, shipment_refnum,
shipment_remark, etc. Similarly, the C.SHIPMENT_STOP table_set
contains the shipment_stop_d table. If you log in as DBA.ADMIN in
Oracle Transportation Management, you can use the Table Set Manager
to modify the contents of the various C.* table sets.
xcsvpcd - export a multi-table CSV file with both parent and child data.
xsql - export data as a script of SQL insert statements rather than a CSV
file
3-2 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
Commands Arguments
glog.database.codegen.schema=glogowner
glog.database.codegen.t2client.driverClassName=oracle.jdbc.driver.Oracl
eDriver
glog.database.codegen.t2client.databaseURL=jdbc:oracle:thin:@localhost
:1521
glog.database.codegen.user=glogload
glog.database.codegen.password=password
glog.database.codegen.server=dbserver
glog.database.codegen.t2client.pool=
jdbc:oracle:thin:@localhost:1521
This option is only applicable for CSVUtil runs with the -command i and -
runsqlloader parameters.
dbUser The Oracle database username used to access the Oracle Transportation
Management data in the database. Usually glogdba.
This option is only applicable for CSVUtil runs with the -command i and -
runsqlloader parameters.
dbPassword The Oracle database password for the username specified by the dbUser
parameter.
This option is only applicable for CSVUtil runs with the -command i and -
runsqlloader parameters.
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 3-3
Commands Arguments
This option is only applicable for CSVUtil runs with the -command i and -
runsqlloader.
tableName The tableName argument is only specified for the xcsv and xsql
commands. This specifies the name of the database table to export. Can
be null if sqlQuery is specified. Must be upper case.
tableSet If used, command can only be one of the “x” export commands, and this
iteratively does CSVUtil operations with tableName for each of the tables
listed in the specified table set. All other parameter rules are as for using
the tableName parameter.
dataDir The dataDir argument specifies the location to either read or write the file
specified in the -dataFileName argument. The following glog.property file
setting controls the default value of the dataDir argument:
glog.database.load.dir=d:\\upload
In this case, the default directory has been set to d:\upload. Note that
two backslashes are required in glog.properties.
dataFileName The dataFileName argument specifies the name of the file in the dataDir
directory to either read or write. This field is required when importing a
file, but is optional when exporting a file. If unspecified for an export, the
output is written to System.out, and the
glog.database.admin.csvUtilScript.csvOutput property will affect the
output representation if CSV-embedded-in-XML format is chosen.
appendFile The appendFile argument only applies to the export commands (xcsv and
xsql). If specified, CSVUtil will append to the file specified by the
dataFileName argument instead of overwriting it.
removeUndefinedColum CSVUtil supports, by default, the ability to ignore columns that are not
ns defined in the target table. This is especially useful when exporting from
a migrated database with deprecated columns, into a newly created
database that does not have the deprecated columns. There is some
performance impact for this feature. To deactivate the feature, use the
following command line option:
-removeUndefinedColumns N
3-4 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
Commands Arguments
For example:
-maxError 20
For example:
-maxTransientError 20
For example:
-maxConnectRetries 5
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 3-5
Commands Arguments
For example:
-reconnectInterval 15
domain_name The domain_name parameter only applies to the export commands (xcsv
and xsql). It specifies that only the data in that domain is to be exported,
and only applies if the tableName parameter is used to specify which data
will be exported; if the domain_name parameter is specified, the
whereClause parameter will be ignored.
includeChildren If using the tableName and domain_name parameters, this specifies that
records in “child” domains (with their domain name prefixed with the
parent domain and a “/”) will also be included along with the parent
domain records matching the domain_name parameter. For example,
useT2 Used to avoid using the T2Connection class, which depends on VPD being
already setup correctly. When loading certain Oracle Transportation
Management "system" tables, it is necessary to avoid the use of the T2
connection class (it’s a chicken or the egg type situation). For normal
data loading, using the T2Connection class is correct and desirable.
debug Used for debugging. Causes extra logging of the operations performed by
CSVUtil.
<TableName></TableName> or <SqlQuery>...</SqlQuery>
<ColumnList></ColumnList>
<ExecSQL></ExecSQL>
<Row>...</Row>
<Row>...</Row>
3-6 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
Commands Arguments
sqlFileName Operates the same as sqlQuery, but reads the query statement from the
specified file instead of directly from the command line. Useful to avoid
issues with the command shell and special characters.
clobDir Directory where external CLob files are read. Only used when importing
external CLob files and not using sqlloader.
excludeClobs Do not export clobs from the specified tables. The value is a comma-
separated list of table names. Specifying a table name that does not
appear in the export operation will be silently ignored.
excludeBeforeDate Do not export records whose original insertion date is prior to the
specified date. Only applies when the -tableName and -domain_name
parameters are used. By default, all records are exported (subject to
other constraints) regardless of their initial creation date.
excludePublic Can be either Y (default) or N. If Y, records from the PUBLIC domain will
not be exported.
xvalidate Can be either Y (default) or N. When set to Y, CSVUtil gives you more
user-friendly diagnostics messages. When you set XValidate to Y, it also
prevents values in the database from being wiped out if there are null
values in the CSV. Setting the XValidate to N may wipe out values in the
database or create an error if the CSV file is missing the value.
encoding The encoding of the file you import. Common settings are ISO-8859-1
(default) and UTF-8. You especially need to consider this when you
import data containing characters outside the 7-bit ASCII set. Also,
consider the encoding of your database.
clobEncoding The encoding of separate CLOB files you import. Only applicable if
importing separate CLOB files. Common settings are ISO-8859-1
(default) and UTF-8. You especially need to consider this when you
import data containing characters outside the 7-bit ASCII set. Also,
consider the encoding of your database. If not specified, the value of the
-encoding parameter is used for CLOB file imports.
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 3-7
Commands Arguments
migrate If specified, SQL errors during CSVUtil execution will cause CSVUtil to exit
with a completion status of 1. Normally, CSVUtil always exits with status
0 (success code), regardless of the success or failure of the database
operation. This option allows scripts using command-line CSVUtil to
detect when a problem has occurred.
badFileDir Specifies the directory path (relative to the current working directory if a
relative path) where “bad” records from input files should be logged. If
errors occur for an input file, an output file will be written to this directory
with the name of the input file (without directory prefix) and an additional
suffix of “.bad”. This file will contain all records that failed to be
processed. By default, bad files are not created.
remoteHost Only meaningful for the “x” commands, specifies that the exported data,
rather than being delivered to a local file, should be pushed to a remote
Oracle Transportation Management instance, where this parameter’s
value is the host name of the remote OTM application server. If this
parameter is specified, the remoteUser, remotePassword, and
remoteCommand parameters are also needed.
fromDomain Specifies the from-domain for VPD domain copying. If specified, the
toDomain parameter must be specified as well.
toDomain Specifies the to-domain for VPD domain copying. If specified, the
fromDomain parameter must be specified as well.
Include the CLob in the CSV file (each CLob<1Mb, no newline characters)
3-8 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
In the CSV file, refer to an external file holding the CLob. (no size restrictions on the CLobs,
newline characters allowed)
Note: CSVUtil can only handle one CLob per record.
Here is a sample CSV file that inserts a CLob using the in-line method:
CLOB_TEST
SEQ,DESCR,XML
9,"THIS IS SO COOL",<asdf>blahblah</asdf>
10,"LINE2",<qwerty>yaya</qwerty>
In this case, the "XML" column is of type CLob. When using the in-line method, each CLob:
CLOB_TEST
SEQ,DESCR,EXT_FNAME,XML
11,"THIS IS SO COOL",myxmlfile.xml
12,"LINE2",myxmlfile2.xml
When using the external file method, you must specify a special "pseudo column" called "EXT_FNAME
". The EXT_FNAME pseudo column must be specified to the left of the CLob column. In this case, you
will have an extra column on line 2. So in this case, line 2 has 4 columns, but there are only 3
columns in the data lines.
The external file method must be used when inserting CLobs containing newline characters, or when
inserting CLobs greater than 1 megabyte.
The above command exports the record for shipment MDIETL.184, along with all the referenced non-
public foreign key records required to successfully load the SHIPMENT record in a foreign database.
The generated CSV file is in multi-table format.
Note: All the xcsvw* commands are far more expensive in terms of CPU usage than the
plain xcsv command. Using them to export a large data set will take a long time, since
many foreign keys must be found. Use the commands with a restrictive where-clause, as
shown in the examples, to limit the running time.
The above command exports the record for shipment MDIETL.184, along with all the subordinate child
tables such as shipment_stop, shipment_stop_d etc.
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 3-9
Exporting With Both Parent and Child Data
To export a data record with both its parent and child data, you can do the following:
This command should be used with care since it can take a while to run.
GL_User Table
CSVUtil supports adding and deleting records in the GL_USER table. This table stores the Oracle
Transportation Management users and their passwords.
When the GL_USER table is specified in the header of a CSV file, special processing is done.
If you are an authorized GL_USER, you may add and delete records in the GL_USER table. As an
exception for this table, you can only use the commands: i, ii, d, or dd.
Note: The u, uu, and iu commands are not supported when loading the GL_USER table.
3-10 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
4. Loading CSV Data via Web Pages
Running CSVUtil via the command line is only possible if your client environment is configured
correctly. If your client environment is not configured, you can still run CSVUtil via the web.
Importing
This section describes how to import a CSV file using Oracle Transportation Management.
5. Click Upload and Oracle Transportation Management displays the page for importing the file.
If you select a file other than a .CSV file, a different page will open.
6. If it is not already selected, select i from the command list.
7. Leave the dataDir as is.
8. Leave the dataFileName as is.
9. If you are loading a large file, you may specify the runsqlloader option. This will only work if
sqlloader is installed on the Oracle Transportation Management application server. The
following line must be added to the jserv.properties file to make sqlloader run from the web:
wrapper.path = d:/product/oracle/ora81/bin
This entry would be different depending on the location of the Oracle bin directory.
10. The xvalidate drop-down list allows you to turn off verbose diagnostic messaging. To leave
messaging on, the value in the drop down list should be Y, which is the default.
11. In the encoding drop down list, select the appropriate encoding type for your CSV file. If your
file contains standard ASCII characters, then it can be encoded as ISO-8859-1. If it contains
non-standard, international characters, then it should be encoded as UTF-8.
12. Click Run and Oracle Transportation Management displays a results page.
To read more about interpreting error messages, see the Reference C: CSVUtil Response
Messages section.
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 4-1
5. Loading Rate Data via CSV
This chapter gives you examples of:
The tables you need to import to set up rates in Oracle Transportation Management.
How to format the CSV files.
The order in which you must import tables.
Refer to the Oracle Transportation Management Data Dictionary to learn what data you need and in
what order you need to import it.
Note: Any blank columns are not included in the CSV files. See the Data Dictionary for a
complete list of columns.
The following example illustrates how you specify LOCATION data in CSV format.
LOCATION
LOCATION_GID,LOCATION_XID,LOCATION_NAME,CITY,PROVINCE,PROVINCE_CODE,POSTAL_C
ODE,COUNTRY_CODE3_GID,TIME_ZONE_GID,LAT,LON,IS_TEMPORARY,IS_MAKE_APPT_BEFORE
_PLAN,RATE_CLASSIFICATION_GID,DOMAIN_NAME,IS_SHIPPER_KNOWN,IS_ADDRESS_VALID,
IS_MIXED_FREIGHT_THU_ALLOWED,SLOT_TIME_INTERVAL,SLOT_TIME_INTERVAL_UOM_CODE,
SLOT_TIME_INTERVAL_BASE,IS_LTL_SPLITABLE
EXEC SQL ALTER SESSION SET NLS_DATE_FORMAT = 'YYYYMMDDHH24MISS'
MYDOMAIN.YELLOW,YELLOW,YELLOW
LOCATION,PITTSBURGH,,PA,99999,USA,America/New_York,,,N,N,,MYDOMAIN,N,U,N,,,,
Y
MYDOMAIN.MYLOCATION,MYLOCATION,MYLOCATION,PHILADELPHIA,,PA,19001,USA,America
/New_York,40.12726,-75.12881,N,N,COMMERCIAL,MYDOMAIN,N,U,N,0,S,0,Y
MYDOMAIN.MYCORPORATION,MYCORPORATION,MYCORPORATION,PHILADELPHIA,,PA,19001,US
A,America/New_York,40.12726,-75.12881,N,N,COMMERCIAL,MYDOMAIN,N,U,N,0,S,0,Y
The following example illustrates how you specify LOCATION_ADDRESS data in CSV format.
LOCATION_ADDRESS
LOCATION_GID,LINE_SEQUENCE,ADDRESS_LINE,DOMAIN_NAME
EXEC SQL ALTER SESSION SET NLS_DATE_FORMAT = 'YYYYMMDDHH24MISS'
MYDOMAIN.YELLOW,1,432 YELLOW AVE,MYDOMAIN
MYDOMAIN.MYCORPORATION,1,11 EMPEROR AVE,MYDOMAIN
MYDOMAIN.MYLOCATION,1,123 MAPLE STREET,MYDOMAIN
MYDOMAIN.MYLOCATION,2,BUILDING H,MYDOMAIN
MYDOMAIN.MYLOCATION,3,ROOM 100,MYDOMAIN
The following example illustrates how you specify CORPORATION data in CSV format.
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 5-1
Note: Each CORPORATION_GID must correspond to a LOCATION_GID specified in the
location table (See example).
CORPORATION
CORPORATION_GID,CORPORATION_XID,CORPORATION_NAME,DOMAIN_NAME,IS_DOMAIN_MASTE
R,IS_SHIPPING_AGENTS_ACTIVE,IS_ALLOW_HOUSE_COLLECT
EXEC SQL ALTER SESSION SET NLS_DATE_FORMAT = 'YYYYMMDDHH24MISS'
MYDOMAIN.MYCORPORATION,MYCORPORATION,MYCORP,MYDOMAIN,N,N,N
MYDOMAIN.YELLOW INC,YELLOW INC,YELLOW INCORPORATED,MYDOMAIN,N,N,N
The following example illustrates how you specify LOCATION_CORPORATION data in CSV
format. This links a location to a corporation.
LOCATION_CORPORATION
LOCATION_GID,CORPORATION_GID,DOMAIN_NAME
EXEC SQL ALTER SESSION SET NLS_DATE_FORMAT = 'YYYYMMDDHH24MISS'
MYDOMAIN.MYLOCATION,MYDOMAIN.MYCORPORATION,MYDOMAIN
MYDOMAIN.MYCORPORATION,MYDOMAIN.MYCORPORATION,MYDOMAIN
MYDOMAIN.YELLOW,MYDOMAIN.YELLOW INC,MYDOMAIN
The following example illustrates how you specify SERVPROV data in CSV format. Each
SERVPROV_GID must correspond to a LOCATION_GID specified in the location table (See
example).
SERVPROV
SERVPROV_GID,SERVPROV_XID,AUTO_PAYMENT_FLAG,DOMAIN_NAME,IS_DISPATCH_BY_REGIO
N,ALLOW_TENDER,IS_ACCEPT_SPOT_BIDS,IS_ACCEPT_BROADCAST_TENDERS,IS_LOCALIZE_B
ROADCAST_CONTACT,DO_CONDITIONAL_ACCEPTS,IS_INTERNAL_NVOCC,IS_ACCEPT_BY_SSU_A
LLOWED,IS_COPY_INV_DELTA_BACK_TO_SHIP,INVOICING_PROCESS
EXEC SQL ALTER SESSION SET NLS_DATE_FORMAT = 'YYYYMMDDHH24MISS'
MYDOMAIN.YELLOW,YELLOW,N,MYDOMAIN,N,Y,N,N,N,N,N,N,N,S
The following example illustrates how you specify LOCATION_ROLE_PROFILE data in CSV
format. Each location should have at least one row in this table.
LOCATION_ROLE_PROFILE
LOCATION_GID,LOCATION_ROLE_GID,CALENDAR_GID,FIXED_HANDLING_TIME,FIXED_HANDLI
NG_TIME_UOM_CODE,FIXED_HANDLING_TIME_BASE,CREATE_XDOCK_HANDLING_SHIPMENT,CRE
ATE_POOL_HANDLING_SHIPMENT,DOMAIN_NAME
EXEC SQL ALTER SESSION SET NLS_DATE_FORMAT = 'YYYYMMDDHH24MISS'
MYDOMAIN.YELLOW,CARRIER,,0,S,0,N,N,MYDOMAIN
MYDOMAIN.MYLOCATION,SHIPFROM/SHIPTO,,0,S,0,N,N,MYDOMAIN
MYDOMAIN.MYCORPORATION,BILL TO,,0,S,0,N,N,MYDOMAIN
MYDOMAIN.MYCORPORATION,REMIT TO,,0,S,0,N,N,MYDOMAIN
The following example illustrates how you specify LOCATION_REMARK data in CSV format.
LOCATION_REMARK
LOCATION_GID,REMARK_SEQUENCE,REMARK_QUAL_GID,REMARK_TEXT,DOMAIN_NAME
EXEC SQL ALTER SESSION SET NLS_DATE_FORMAT = 'YYYYMMDDHH24MISS'
5-2 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
MYDOMAIN.MYLOCATION,1,REM,DRIVER CANNOT HAVE A BEARD,MYDOMAIN
MYDOMAIN.MYLOCATION,2,REM,DRIVER MUST HAVE SAFETY GLASSES,MYDOMAIN
SERVICE_TIME
X_LANE_GID,RATE_SERVICE_GID,SERVICE_TIME_VALUE,SERVICE_DAYS,DOMAIN_NAME,SERVICE
_TIME_VALUE_UOM_CODE,SERVICE_TIME_VALUE_BASE
EXEC SQL ALTER SESSION SET NLS_DATE_FORMAT = 'YYYYMMDDHH24MISS'
MYDOMAIN.194-064,MYDOMAIN.VOYAGE-DEFAULT,172800,,MYDOMAIN,S,172800
MYDOMAIN.194-065,MYDOMAIN.VOYAGE-DEFAULT,86400,,MYDOMAIN,S,86400
In the above example, note that you must specify SERVICE_DAYS, and leave the
SERVICE_TIME_VALUE unspecified. As an alternative, you must specify SERVICE_TIME_VALUE in
seconds, and leave the SERVICE_DAYS unspecified. You must never specify both a
SERVICE_TIME_VALUE and a SERVICE_DAYS value on the same record.
X_LANE
PK X_LANE_GID
X_LANE_XID
FK7 SOURCE_LOCATION_GID
SOURCE_CITY
SOURCE_PROVINCE_CODE
SOURCE_POSTAL_CODE
FK5 SOURCE_COUNTRY_CODE3_GID
SOURCE_ZONE4
SOURCE_ZONE1
SOURCE_ZONE2
SOURCE_ZONE3
FK6 SOURCE_GEO_HIERARCHY_GID
FK3 DEST_LOCATION_GID
DEST_CITY
DEST_PROVINCE_CODE
DEST_POSTAL_CODE
FK1 DEST_COUNTRY_CODE3_GID
DEST_ZONE4
DEST_ZONE1
DEST_ZONE2
DEST_ZONE3
FK2 DEST_GEO_HIERARCHY_GID
FK8 SOURCE_REGION_GID
FK4 DEST_REGION_GID
LOADED
DOMAIN_NAME
INSERT_USER
INSERT_DATE
UPDATE_USER
UPDATE_DATE
Figure 5-1
The following example illustrates how you specify GEO_HIERARCHY and X_LANE data in CSV format.
GEO_HIERARCHY
GEO_HIERARCHY_GID,GEO_HIERARCHY_XID,RANK,DOMAIN_NAME
EXEC SQL ALTER SESSION SET NLS_DATE_FORMAT = 'YYYYMMDDHH24MISS'
MYDOMAIN.USZIP4,USZIP4,4,MYDOMAIN
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 5-3
X_LANE
X_LANE_GID,X_LANE_XID,SOURCE_POSTAL_CODE,SOURCE_COUNTRY_CODE3_GID,SOURCE_GEO_HI
ERARCHY_GID,DEST_POSTAL_CODE,DEST_COUNTRY_CODE3_GID,DEST_GEO_HIERARCHY_GID,DOMA
IN_NAME
EXEC SQL ALTER SESSION SET NLS_DATE_FORMAT = 'YYYYMMDDHH24MISS'
MYDOMAIN.194-064,194-
064,194,USA,MYDOMAIN.USZIP4,64,USA,MYDOMAIN.USZIP4,MYDOMAIN
MYDOMAIN.194-065,194-
065,194,USA,MYDOMAIN.USZIP4,65,USA,MYDOMAIN.USZIP4,MYDOMAIN
MYDOMAIN.MY LANE,MY LANE,194,,POSTAL_CODE,64,,POSTAL_CODE,MYDOMAIN
RATE_GEO_COST_GROUP
RATE_GEO_COST
RATE_UNIT_BREAK_PROFILE
RATE_UNIT_BREAK
RATE_GEO_COST_UNIT_BREAK
Note: (*) RATE_GEO_ ACCESSORIAL must come after RATE_GEO, but is not required
before the remaining tables.
Assumptions:
You have loaded the rate offering table using Oracle Transportation Management web pages
You have loaded the X_Lane table (see the Importing X_LANE Data for Rates section.)
5-4 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
Simplified ERD for LTL Rates
RATE_GEO RATE_GEO_COST_GROUP
RATE_GEO_XID RATE_GEO_COST_GROUP_XID
FK1,U1 RATE_OFFERING_GID FK1 RATE_GEO_GID
FK5,I2 X_LANE_GID RATE_GEO_COST_GROUP_SEQ
FK3 RATE_SERVICE_GID GROUP_NAME
MIN_COST USE_DEFICIT_CALCULATIONS
MIN_COST_GID DOMAIN_NAME
MIN_COST_BASE INSERT_USER
FK4,I1 RATE_ZONE_PROFILE_GID INSERT_DATE
EFFECTIVE_DATE UPDATE_USER
EXPIRATION_DATE UPDATE_DATE
ALLOW_UNCOSTED_LINE_ITEMS
DOMAIN_NAME
INSERT_USER
INSERT_DATE RATE_GEO_COST
UPDATE_USER
UPDATE_DATE PK RATE_GEO_COST_SEQ
PK,FK7 RATE_GEO_COST_GROUP_GID
CHARGE_AMOUNT
RATE_GEO_ACCESSORIAL CHARGE_CURRENCY_GID
CHARGE_AMOUNT_BASE
PK,FK1 RATE_GEO_GID CHARGE_UNIT_UOM_CODE
PK RATE_GEO_ACCESSORIAL_SEQ CHARGE_UNIT_COUNT
FK2 CHARGE_MULTIPLIER
FK4 ACCESSORIAL_CODE_GID CHARGE_MULTIPLIER_SCALAR
EFFECTIVE_DATE CHARGE_ACTION
EXPIRATION_DATE FK1 CHARGE_BREAK_COMPARATOR
FK2 REGION_GID DOMAIN_NAME
FK3 X_LANE_GID INSERT_USER
EQUIPMENT_GROUP_PROFILE_GID INSERT_DATE
PERCENTAGE UPDATE_USER
PERCENT_OF UPDATE_DATE
FIXED
FIXED_GID
FIXED_BASE
MINIMUM
MINIMUM_GID RATE_GEO_COST_WEIGHT_BREAK
MINIMUM_BASE
PER_UNIT_SHIP_UNIT_SPEC_GID
PK,FK1 RATE_GEO_COST_SEQ
CALENDAR_GID
PK,FK2 WEIGHT_BREAK_GID
NOTES
PK,FK1 RATE_GEO_COST_GROUP_GID
ACTIVITY
COST_QUAL
RATE_DISCOUNT_VALUE
VARIABLE_COST
RATE_DISCOUNT_VALUE_GID
VARIABLE_COST_GID
RATE_DISCOUNT_VALUE_BASE
VARIABLE_COST_BASE
DOMAIN_NAME
DOMAIN_NAME
INSERT_USER
INSERT_USER
INSERT_DATE
INSERT_DATE
UPDATE_USER
UPDATE_USER
UPDATE_DATE
UPDATE_DATE
Figure 5-2
Table Notes:
RATE_GEO Table
Allow_uncosted_line_items in Y/N (defaults to “N”)
RATE_GEO_ACCESSORIAL
Left_Operand1 – Basis options define what variable you want to base your conditional charge on.
Low_value1 – Depending on the operand you use, you might need only the low_value1 or additionally
the high_value1.
RATE_GEO_COST_GROUP Table
Use_deficit_calculations in Y/N (defaults to “N”)
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 5-5
RATE_GEO_COST Table
charge_unit_uom_code - unit of measure (e.g. “LB” for pounds, or “MI” for miles)
5-6 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
RATE_GEO_COST_UNIT_BREAK
RATE_GEO_COST_GROUP_GID,RATE_GEO_COST_SEQ,RATE_UNIT_BREAK_GID,CHARGE_AMOUNT,
CHARGE_AMOUNT_GID,CHARGE_AMOUNT_BASE,DOMAIN_NAME
EXEC SQL ALTER SESSION SET NLS_DATE_FORMAT = 'YYYYMMDDHH24MISS'
MYDOMAIN.194-064,1,MYDOMAIN.1000,48.53,USD,48.53,MYDOMAIN
MYDOMAIN.194-064,1,MYDOMAIN.1000-3000,37.56,USD,37.56,MYDOMAIN
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 5-7
5. Import RATE_GEO_COST_GROUP table.
RATE_GEO_COST_GROUP
RATE_GEO_COST_GROUP_GID,RATE_GEO_COST_GROUP_XID,RATE_GEO_GID,RATE_GEO_COST_G
ROUP_SEQ,GROUP_NAME,DOMAIN_NAME
MYDOMAIN.194-064-2,194-064-2,MYDOMAIN.194-064-2,1,MY_GROUP_NAME_2,MYDOMAIN
Note: An alternative to using the data specified for the RATE_GEO_ACCESSORIAL table
above would be to add another Sequence to this table with the following (representing a
3% surcharge of the total value):
4,”MYDOMAIN.194-064-2”,,,,,1,,1.03,”D”,”MYDOMAIN”
Total Cost = ((weight * 0.07 – 50.00) * (65% Discount) + (if weight>20000lb then
Accessorial Surcharge of 10)) * (1.03)
Min Cost = (10,000 * 0.07 – 50.00) * (1 - 0.65) * (1.03) = 234.325
1. Import RATE_GEO table.
RATE_GEO
RATE_GEO_GID,RATE_GEO_XID,RATE_OFFERING_GID,MIN_COST,MIN_COST_GID,MIN_COST_B
ASE,X_LANE_GID,DOMAIN_NAME
MYDOMAIN.194-064-3,194-064-
3,MYDOMAIN.YELLOW,234.325,USD,234.325,MYDOMAIN.194-064,MYDOMAIN
5-8 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
ACCESSORIAL_COST_GID,ACCESSORIAL_COST_XID,LEFT_OPERAND1,OPER1_GID,LOW_VALUE1
,AND_OR1,LEFT_OPERAND2,OPER2_GID,LOW_VALUE2,CHARGE_MULTIPLIER,CHARGE_AMOUNT,
CHARGE_AMOUNT_GID,CHARGE_AMOUNT_BASE,CHARGE_UNIT_COUNT,CHARGE_MULTIPLIER_SCA
LAR,CHARGE_ACTION,CHARGE_TYPE,USE_DEFAULTS,CHARGE_MULTIPLIER_OPTION,USES_UNI
T_BREAKS,DOMAIN_NAME,ROUNDING_TYPE,ROUNDING_FIELDS_LEVEL,ROUNDING_APPLICATIO
N,IS_FILED_AS_TARIFF
EXEC SQL ALTER SESSION SET NLS_DATE_FORMAT = 'YYYYMMDDHH24MISS'
MYDOMAIN.FS,FS,,,,,,,,SHIPMENT.COSTS.AMOUNT,,,,,1.03,A,B,N,A,N,MYDOMAIN,N,0,
A,N
MYDOMAIN.FS-2,FS-
2,SHIPMENT.STOPS.SHIPUNITS.ACTIVITY,EQ,D,S,SHIPMENT.STOPS.WEIGHT,GT,20000
LB,SHIPMENT,10,USD,10,1,,A,B,N,A,N,MYDOMAIN,,,,N
Importing TL Rates
This section describes how to specify TL rates and gives sample CSV files for several scenarios.
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 5-9
RATE_GEO
ACCESSORIAL_CODE
ACCESSORIAL_COST
RATE_GEO_ACCESSORIAL (*)
RATE_GEO_STOPS (*)
RATE_GEO_COST_GROUP
RATE_GEO_COST
Assumptions:
You have loaded the rate offering table using Oracle Transportation Management web pages
You have loaded the X_Lane table (see the Importing X_LANE Data for Rates section).
5-10 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
Simplified ERD for TL Rates
RATE_GEO
RATE_GEO_XID PK RATE_GEO_COST_GROUP_GID
FK1,U1 RATE_OFFERING_GID
FK5,I2 X_LANE_GID RATE_GEO_COST_GROUP_XID
EQUIPMENT_GROUP_PROFILE_GID FK1 RATE_GEO_GID
FK3 RATE_SERVICE_GID RATE_GEO_COST_GROUP_SEQ
MIN_COST GROUP_NAME
MIN_COST_GID USE_DEFICIT_CALCULATIONS
MIN_COST_BASE DOMAIN_NAME
TOTAL_STOPS_CONSTRAINT INSERT_USER
PICKUP_STOPS_CONSTRAINT INSERT_DATE
DELIVERY_STOPS_CONSTRAINT UPDATE_USER
CIRCUITY_ALLOWANCE_PERCENT UPDATE_DATE
CIRCUITY_DISTANCE_COST
CIRCUITY_DISTANCE_COST_GID
CIRCUITY_DISTANCE_COST_BASE
MAX_CIRCUITY_PERCENT
MAX_CIRCUITY_DISTANCE
MAX_CIRCUITY_DISTANCE_UOM_CODE RATE_GEO_COST
MAX_CIRCUITY_DISTANCE_BASE
STOPS_INCLUDED_RATE PK RATE_GEO_COST_SEQ
MIN_STOPS PK,FK7 RATE_GEO_COST_GROUP_GID
FK4,I1 RATE_ZONE_PROFILE_GID
EFFECTIVE_DATE EQUIPMENT_GROUP_PROFILE_GID
EXPIRATION_DATE OPER1_GID
ALLOW_UNCOSTED_LINE_ITEMS FK3 LEFT_OPERAND1
DOMAIN_NAME LOW_VALUE1
INSERT_USER HIGH_VALUE1
INSERT_DATE CHARGE_AMOUNT
UPDATE_USER CHARGE_CURRENCY_GID
UPDATE_DATE CHARGE_AMOUNT_BASE
CHARGE_UNIT_UOM_CODE
CHARGE_UNIT_COUNT
FK2 CHARGE_MULTIPLIER
RATE_GEO_ACCESSORIAL RATE_GEO_STOPS CHARGE_MULTIPLIER_SCALAR
CHARGE_ACTION
PK,FK1 RATE_GEO_GID PK,FK1 RATE_GEO_GID FK1 CHARGE_BREAK_COMPARATOR
PK RATE_GEO_ACCESSORIAL_SEQ PK LOW_STOP DOMAIN_NAME
PK HIGH_STOP INSERT_USER
FK4 ACCESSORIAL_CODE_GID INSERT_DATE
EFFECTIVE_DATE PER_STOP_COST UPDATE_USER
EXPIRATION_DATE PER_STOP_COST_GID UPDATE_DATE
FK2 REGION_GID PER_STOP_COST_BASE
FK3 X_LANE_GID DOMAIN_NAME
EQUIPMENT_GROUP_PROFILE_GID INSERT_USER
PERCENTAGE INSERT_DATE
PERCENT_OF UPDATE_USER RATE_GEO_COST_WEIGHT_BREAK
FIXED UPDATE_DATE
FIXED_GID PK,FK1 RATE_GEO_COST_SEQ
FIXED_BASE PK,FK2 WEIGHT_BREAK_GID
MINIMUM PK,FK1 RATE_GEO_COST_GROUP_GID
MINIMUM_GID
MINIMUM_BASE RATE_DISCOUNT_VALUE
PER_UNIT_SHIP_UNIT_SPEC_GID RATE_DISCOUNT_VALUE_GID
CALENDAR_GID RATE_DISCOUNT_VALUE_BASE
NOTES DOMAIN_NAME
ACTIVITY INSERT_USER
COST_QUAL INSERT_DATE
VARIABLE_COST UPDATE_USER
VARIABLE_COST_GID UPDATE_DATE
VARIABLE_COST_BASE
DOMAIN_NAME
INSERT_USER
INSERT_DATE
UPDATE_USER
UPDATE_DATE
Figure 5-3
Table Notes
RATE_GEO Table
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 5-11
RATE_GEO_ACCESSORIAL
Left_Operand1 – Basis options define what variable you want to base your conditional charge
on.
Oper1_gid – The operand you compare with.
Low_value1 – Depending on the operand you use, you might need only the low_value1 or
additionally the high_value1.
RATE_GEO_COST_GROUP Table
Oper1_gid – field value “BETWEEN” is a shortcut for X > low and X <= high. Other possible
values include “<”, “<=”, “>”, “>=”, “=”, and “<>”.
charge_unit_uom_code - unit of measure (e.g. “LB” for pounds, or “MI” for miles)
charge_unit_count - hundredweight, etc.
charge_action – add (A), setmin (M), setmax (X), multiply (D)
charge_break_comparator -identifies data element used to access the break
Scenario–Based on Distance Bands with Fixed Charges, and Stop Offs
This scenario assumes that:
TL rates are defined using distance bands, with a flat charge within each band
For Rate Geo A
If distance between 10 and 100 miles, charge $50
5-12 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
RATE_GEO_COST_GROUP
RATE_GEO_COST_GROUP_GID,RATE_GEO_COST_GROUP_XID,RATE_GEO_GID,RATE_GEO_COST_G
ROUP_SEQ,GROUP_NAME,DOMAIN_NAME
"MYDOMAIN.194-064-TL1","194-064-TL1","MYDOMAIN.194-064-
TL1",1,"MY_GROUP_NAME_TL","MYDOMAIN"
"MYDOMAIN.194-065-TL1","194-065-TL1","MYDOMAIN.194-065-
TL1",1,"MY_GROUP_NAME_TL","MYDOMAIN"
Charge of $50 for 3rd stop, and $65 for subsequent stops
Total Cost = (distance * 1.75) + stop off charges + (Accessorial of $0.02 per mile)
Min Transport = (450.00) + stop off charges + (Accessorial of $0.02 per mile)
1. Import RATE_GEO table.
RATE_GEO
RATE_GEO_GID,RATE_GEO_XID,RATE_OFFERING_GID,MIN_COST,MIN_COST_GID,MIN_COST_B
ASE,X_LANE_GID,TOTAL_STOPS_CONSTRAINT,STOPS_INCLUDED_RATE,DOMAIN_NAME
"MYDOMAIN.194-064-TL2","194-064-
TL2","MYDOMAIN.YELLOW",1.0,"USD",1.0,"MYDOMAIN.194-064",6, 2,"MYDOMAIN"
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 5-13
MYDOMAIN.FS-TL2,FS-
TL2,SHIPMENT.DISTANCE,0.02,USD,0.02,MI,1,A,B,N,A,N,MYDOMAIN,N
Note: Leaving the HIGH_STOP value empty indicates that the last charge will be applied to
all the stops greater than the LOW_STOP value. (i.e. for stops >= 2, charge $65 per stop).
Note: Seq#2, with a charge action of “M”, indicates that the minimum of the running
calculated cost has to be $450 (i.e. if the calculation from Seq#1 is less than $450, then
the new value to be used going forward is $450).
An alternative method of specifying this rate would be to recognize that a minimum of $450 equates
to distance of 257.143 miles. A comparison for this distance could be used. This would be the
corresponding result.
RATE_GEO_COST
5-14 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
RATE_GEO_COST_SEQ,RATE_GEO_COST_GROUP_GID,OPER1_GID,LEFT_OPERAND1,LOW_VALUE1
,CHARGE_AMOUNT,CHARGE_CURRENCY_GID,CHARGE_AMOUNT_BASE,CHARGE_UNIT_UOM_CODE,C
HARGE_UNIT_COUNT,CHARGE_MULTIPLIER,CHARGE_MULTIPLIER_SCALAR,CHARGE_ACTION,DO
MAIN_NAME
1,"MYDOMAIN.194-064-TL2",">","SHIPMENT.DISTANCE","237.143
MI",1.750,"USD",1.750,"MI",1, "SHIPMENT.DISTANCE",,"A","MYDOMAIN"
2,"MYDOMAIN.194-064-TL2","<=","SHIPMENT.DISTANCE","257.143
MI",450.0,"USD",450.0,,1, ,,"A","MYDOMAIN"
Note: An alternative to using the data specified for the RATE_GEO_ACCESSORIAL table
above would be to add another Sequence to the RATE_GEO_COST table with the following
(representing a surcharge of $0.02 per mile):
3,"MYDOMAIN.194-064-
TL2",0.020,"USD",0.020,"MI",1,"SHIPMENT.DISTANCE",,"A","MYDOMAIN"
Total Cost = ((weight/100) * (weight break charge)) + (Accessorial of $0.02 per mile)
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 5-15
5. Import RATE_GEO_COST_GROUP table.
RATE_GEO_COST_GROUP
RATE_GEO_COST_GROUP_GID,RATE_GEO_COST_GROUP_XID,RATE_GEO_GID,RATE_GEO_COST_G
ROUP_SEQ,GROUP_NAME,DOMAIN_NAME
MYDOMAIN.194-064-TL3,194-064-TL3,MYDOMAIN.194-064-
TL3,1,MY_GROUP_NAME_TL3,MYDOMAIN
Note: An alternative to using the data specified for the RATE_GEO_ACCESSORIAL table
above would be to add another Sequence to this table with the following (representing a
surcharge of $0.02 per mile):
2,"MYDOMAIN.194-064-
TL3",0.020,"USD",0.020,"MI",1,"SHIPMENT.DISTANCE",,"A","MYDOMAIN"
The freight cost is per hundredweight based on unit breaks which are based on mileage bands.
5-16 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
Table 5-1
0 – 50 0.85 0.50
51 – 55 0.87 0.82
56 - 60 0.88 0.83
Summary
Total Cost = ((weight/100) * (unit break charge)) + $20 + (Vacuuming Fee of 0.25 per CWT)
Note: Min $115 for vacuuming is reached when the weight is at 46,000 lbs
1. Import RATE_GEO table.
RATE_GEO
RATE_GEO_GID,RATE_GEO_XID,RATE_OFFERING_GID,MIN_COST,MIN_COST_GID,MIN_COST_B
ASE,X_LANE_GID,TOTAL_STOPS_CONSTRAINT,STOPS_INCLUDED_RATE,DOMAIN_NAME
MYDOMAIN.194-064-TL4,194-064-TL4,MYDOMAIN.YELLOW,1,USD,1,MYDOMAIN.194-
064,6,2,MYDOMAIN
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 5-17
RATE_UNIT_BREAK_PROFILE_GID,RATE_UNIT_BREAK_PROFILE_XID,DATA_TYPE,LOOKUP_TYP
E,UOM_TYPE,DOMAIN_NAME
EXEC SQL ALTER SESSION SET NLS_DATE_FORMAT = 'YYYYMMDDHH24MISS'
MYDOMAIN.LESS THAN 40 PDS,LESS THAN 40 PDS,U,M,WEIGHT,MYDOMAIN
MYDOMAIN.GREATER THAN 45000 PDS,GREATER THAN 45000 PDS,U,M,WEIGHT,MYDOMAIN
5-18 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
6. Loading CSV Data via the Application Server
Oracle Transportation Management allows importing of CSV files via the application server. This
feature is called “AppServer CSV” or AS.CSV.
If you upload a file whose name ends in “as.csv” instead of just “.CSV”, it will be interpreted as an
application server CSV file, as opposed to a database-centric CSV file. AppServer CSV files have the
following features:
The first line must be the name of an Entity such as Location, ObOrderBase, OrderRelease,
etc. Entity names are derived from database table names, except they omit the underscores
and use mixed case. For example, the entity name for the ob_order_base table is
ObOrderBase.
The second line must be a comma-separated list of attribute names. Attribute names are like
database column names, except they omit the underscores and use mixed case. For example,
a column called location_gid corresponds to the attribute locationGid. Note that the first
character is in lower-case for attribute names, but upper case for entity names.
The third line may be an optional UOM line, which provides UOM values for any UOM
attributes. This line may be provided instead of providing UOM qualifiers every time a UOM
value occurs.
The remaining lines are data lines. Each value in a data line must correspond to an attribute
name from line2.
If a particular attribute is typically populated via an Oracle Database sequence, it can be
specified in the attribute name list (second line described above), but the data lines can leave
the value for that attribute empty (two commas next to each other without any other text
between them).
Here is small sample file. This example omits the optional UOM line.
Location
locationGid,locationXid,countryCode3Gid,domainName,locationName
"GUEST.MYLOC8","MYLOC8","USA","GUEST","myloc8"
Here is another small sample file showing how to specify a UOM line.
SShipUnit
domainName,unitWidth,sShipUnitGid,isSplitable,unitNetVolume,unitNetWeight,shipU
nitCount,unitWeight,unitVolume,unitHeight,receivedNetVolume,receivedNetWeight,u
nitLength,sShipUnitXid
UOM:,,,,CUFT,LB,,LB,,,CUFT,LB,,
GUEST,,GUEST.001,false,0,10,1,10,,,0,0,,001
Here is the same sample, but with the UOM line omitted and the units of measure specified with each
data attribute instead. (Note the use of “false” for the boolean isSplitable field).
SShipUnit
domainName,unitWidth,sShipUnitGid,isSplitable,unitNetVolume,unitNetWeight,shipU
nitCount,unitWeight,unitVolume,unitHeight,receivedNetVolume,receivedNetWeight,u
nitLength,sShipUnitXid
GUEST,,GUEST.001,false,0 CUFT,10 LB,1,10 LB,,,0 CUFT,0 LB,,001
Here is an example that will result in errors. You cannot specify a UOM line of you also specify UOMs
within the data attributes.
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 6-1
Note: The example below represents what not to do. Do NOT copy the example below. The
following example would produce an error because a UOM line was specified, but UOMs
were also specified in the data attributes. Doing this would cause the system to think that
each UOM field has two UOM qualifiers.
SShipUnit
domainName,unitWidth,sShipUnitGid,isSplitable,unitNetVolume,unitNetWeight,shipU
nitCount,unitWeight,unitVolume,unitHeight,receivedNetVolume,receivedNetWeight,u
nitLength,sShipUnitXid
UOM:,,,,CUFT,LB,,LB,,,CUFT,LB,,
GUEST,,GUEST.001,false,0 CUFT,10 LB,1,10 LB,,,0 CUFT,0 LB,,001
Each row in the file is processed via the application server instead of directly against the database.
This has the benefit of keeping the application server data-cache synchronized with the database.
This page is accessed via Business Process Automation > Integration > Integration Manager.
See the Loading CSV Data via Web Pages chapter for details about this page.
Exporting
Care must be taken when exporting an AppServer CSV file due to the lack of support for where-
clauses. You should be logged in as a user whose vpd_profile limits the number of rows selected from
the entity you plan on exporting. Where-clauses will be supported in future releases. In the example
below, the user is logged in as “GUEST.FEWROWS”. This user has a vpd_profile which limits the
number of rows in the s_ship_unit table.
You can use the following URL to export (if it is not on your user menu):
http://hostname/servlets/glog.integration.servlet.IntegrationMenuServlet?integr
ation_stylesheet=integration/csvexport.xsl
From the application server script8 directory, run the following command.
6-2 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
./update_onecsv_rpt.sh REPORT_CONTROL /opt/otm-55-wl/glog/config/dbareportowner
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 6-3
7. Loading CSV Data via Integration
CSVDataLoad XML element provides the capability to embed the contents of a CSV file for insertion
into the database as a Transmission XML document. Each CSVDataLoad element can contain only one
CSV File. This element should only be used for small sets of data.
Refer to the CSV Data Loading Guide document for details on the CSV file format.
<Transmission>
<TransmissionHeader> . . .
</TransmissionHeader>
<TransmissionBody>
<GLogXMLElement>
<CSVDataLoad>
---CSV Data Load Contents---
</CSVDataLoad>
</GLogXMLElement>
<GLogXMLElement>
<CSVDataLoad>
---CSV Data Load Contents---
</CSVDataLoad>
</GLogXMLElement>
</TransmissionBody>
</Transmission>
Below is a sample document that would be used to insert some data into the rate tables:
<Transmission>
<TransmissionHeader>
<UserName>DBA.ADMIN</UserName>
</TransmissionHeader>
<TransmissionBody>
<GLogXMLElement>
<CSVDataLoad>
<CsvCommand>iu</CsvCommand>
<CsvTableName>X_LANE</CsvTableName>
<CsvColumnList>X_LANE_GID,X_LANE_XID,SOURCE_POSTAL_CODE,SOURCE_COUNTRY_CODE3_GI
D,SOURCE_GEO_HIERARCHY_GID,DEST_POSTAL_CODE,DEST_COUNTRY_CODE3_GID,DEST_GEO_HIE
RARCHY_GID,DOMAIN_NAME</CsvColumnList>
<CsvRow>"MYDOMAIN.194064","194064","194","USA","USZIP3","064","USA","USZIP3","M
YDOMAIN"</CsvRow>
<CsvRow>"MYDOMAIN.194065","194065","194","USA","USZIP3","065","USA","USZIP3","M
YDOMAIN"</CsvRow>
</CSVDataLoad>
</GLogXMLElement>
</TransmissionBody>
</Transmission>
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 7-1
8. Loading CSV Files as Zip Files
Uploading a Zip File
In addition to the CSV files, your zip file must include a control file called csvutil.ctl to tell Oracle
Transportation Management how to process the files. The control file specifies the sequence in which
the CSV files should be processed, and specifies the parameters to use when processing each file.
For example, this zip file contains the csvutil.ctl (control) file, and two CSV files, activity.csv and
activity2.csv. The csvutil.ctl file contains the following command lines:
The above control file says to process the file activity.csv using the insert command, then process the
file activity2.csv, also using the insert command.
Uploading a zip file is the same as uploading any other file. Use the “Upload an XML/CSV Transmission
button accessed via Business Process Automation > Integration > Integration Manager.
After uploading your zip file, you are prompted to download a “results” zip file.
Click the Save button to save the “results” zip file to your local workstation.
The csvutil.log file in the “result” zip file contains the log from processing all the CSV files in the zip file
that you uploaded.
For example, this is a “request” zip file whose name specifies that background processing is desired:
test1.bg.zip. Notice that the filename ends with “bg.zip” rather than just “.zip”. This naming
convention indicates that background processing is desired. Here is a sample csvutil.ctl file that
illustrates how to have an email sent out when processing completes:
Clicking on the link in the email takes you to a listing of the zip files on the web server.
You may click on the desired zip file to download it to your local workstation. The zip files ending in
“result.zip” are the “results” or “output” zip files.
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 8-1
If things go wrong during background processing, your results zip file will contain a stack trace, which
you can read with a text editor rather than WinZip.
8-2 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
9. Exporting CSV Files via the Interface
CSV Export Screens
An initial screen prompts for certain information so the system can determine what additional
information is required on subsequent screens.
1. First, create a csvutil.ctl file containing the commands for exporting your files.
A csvutil.ctl file may contain the following commands:
Here is another example csvutil.ctl file that exports all the rate_geo records in a given domain, along
with all parent and child data, but not public data:
Here is the same example, but this time with referenced public data:
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 9-1
-mailTo [email protected] -mailFrom [email protected] -subject
zipFileProcessDone -message hello -smtpHost mail.example.com
Note: Exporting with parent and child data is a very time consuming process since the
system has to repeatedly chase after foreign key references. Expect the export to run
overnight for as long as 8 hours.
9-2 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
Figure 9-1
The remote fields in the above screenshot have the same meanings as defined for the command-line
CSVUtil command in section 3 of this Guide.
As shown above, specify your email address and a SMTP Host to run in the background. The results
will be emailed to you when the background job completes (instead of returning the results to the
screen).
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 9-3
In this example, the following content was emailed:
<CSVUtil>
<Command>xcsv</Command>
<DataDir>/</DataDir>
<DataFileName>null</DataFileName>
<ExcludePublic>true</ExcludePublic>
<Write>
<DatabaseGlobalName>QGC317.HARMONY.GLOGTECH.COM</DatabaseGlobalName>
<Table>ACTIVITY</Table>
<WhereClause>null</WhereClause>
<DomainName>null</DomainName>
<Sql>null</Sql>
<![CDATA[
ACTIVITY
ACTIVITY_GID,ACTIVITY_XID,ACTIVITY_NAME,DOMAIN_NAME,INSERT_DATE,UPDATE_DATE,INS
ERT_USER,UPDATE_USER
EXEC SQL ALTER SESSION SET NLS_DATE_FORMAT = 'YYYYMMDDHH24MISS'
"RECEIVE","RECEIVE","RECEIVING
FREIGHT","PUBLIC","20011005190259","20021008201735","DBA.ADMIN","DBA.GLOGLOAD"
"LOAD","LOAD","LOADING
FREIGHT","PUBLIC","20011005190259","20021008201735","DBA.ADMIN","DBA.GLOGLOAD"
"LIVELOAD","LIVELOAD","LIVE TRAILER
LOADING","PUBLIC","20011005190259","20021008201735","DBA.ADMIN","DBA.GLOGLOAD"
"DISPATCH","DISPATCH","DRIVER
DISPATCHING","PUBLIC","20011005190259","20021008201735","DBA.ADMIN","DBA.GLOGLO
AD"
"ACTIVATE","ACTIVATE","ITINERARY
ACTIVATED","PUBLIC","20011005190259","20021008201735","DBA.ADMIN","DBA.GLOGLOAD
"
"PICKUP","PICKUP","WAREHOUSE
PICKING","PUBLIC","20011005190259","20021008201735","DBA.ADMIN","DBA.GLOGLOAD"
"CLOSED","CLOSED","WAREHOUSE CLOSED
DOOR","PUBLIC","20011005190259","20021008201735","DBA.ADMIN","DBA.GLOGLOAD"
"OFFICEHOURS","OFFICEHOURS","OFFICE
HOURS","PUBLIC","20011005190259","20021008201735","DBA.ADMIN","DBA.GLOGLOAD"
"BATCH SORT","BATCH SORT","SORTATION AT
DC","PUBLIC","20020125162107","20021008201735","DBA.GLOGLOAD","DBA.GLOGLOAD"
"BATCH DOCK LOAD","BATCH DOCK LOAD","DOCK LOAD AT
DC","PUBLIC","20020125162107","20040308170536","DBA.GLOGLOAD","DBA.ADMIN"
"GUEST.BLAH","BLAH",,"GUEST","20030425012307","20031104125706","DBA.GLOGOWNER",
"DBA.ADMIN"
"RUSHHOURS","RUSHHOURS","RUSH
HOURS","PUBLIC","20030717003037","20040308170536","DBA.ADMIN","DBA.ADMIN"
"GUEST.DLI1","DLI1","DLI1","GUEST","20030717144513",,"GUEST.DLI",
"GUEST.DLI2","DLI2","DLI2","GUEST","20030717144528",,"GUEST.DLI",
"GUEST.TEST","TEST","1","GUEST","20030728200219",,"GUEST.ADMIN",
"GUEST.ABCD","ABCD","VDSFDS","GUEST","20040605190045",,"GUEST.ADMIN",
"GUEST.DTB_SECOND_ACTIVITY","DTB_SECOND_ACTIVITY","DAWN'S SECOND
ACTIVITY","GUEST","20040611120516",,"GUEST.ADMIN",
"GUEST.DTB_FIRST_ACTIVITY","DTB_FIRST_ACTIVITY","DAWN'S FIRST
ACTIVITY","GUEST","20040611120313",,"GUEST.ADMIN",
"GUEST.DTB_NUMBER_3","DTB_NUMBER_3","NUMBER
3","GUEST","20040611121927",,"GUEST.ADMIN",
"ALL","ALL","ALL
ACTIVITIES","PUBLIC","20040910173537","20041213180312","DBA.ADMIN","DBA.ADMIN"
"DEPOT","DEPOT","DEPOT","PUBLIC","20040910173537","20041213180312","DBA.ADMIN",
"DBA.ADMIN"
9-4 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
"OTHER","OTHER","OTHER
ACTIVITIES","PUBLIC","20040921094353","20041213180312","DBA.ADMIN","DBA.ADMIN"
]]>
</Write>
</CSVUtil>
Normally, you use background processing when initiating lengthy jobs, such as piping a large table set
to a RemoteHost.
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 9-5
10. Exporting Referenced PUBLIC Data during Multi-Table
Exports
CSVUtil provides the ability to export referenced PUBLIC data during the multi-table export operations
(xcsvwcd, xcsvwpd, xcsvwpcd). This feature is especially important when exporting data from a
source database where the PUBLIC data has been modified.
Here is a sample CSVUtil command line for exporting referenced public data:
Notice the -excludePublic option is set to N, meaning that public data should not be excluded (it
should be exported, in other words).
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 10-1
11. Piping CSV Output to a Remote Oracle Transportation
Management Instance
CSVUtil supports piping CSV Output to a remote Oracle Transportation Management instance. Refer to
the screenshots below:
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 11-1
Figure 11-1
In the above example, the ACTIVITY table is first exported. The results are then immediately sent to
the given Remote Host (in this case back to localhost). You must also specify the Remote User,
Remote Password and Remote Command (CSVUtil command) to use on the Remote host.
When you click the Run button you will get XML output showing all the processing that occurred – i.e.
export the activity table, send the file over to the remote host, then run CSVUtil on the remote host,
11-2 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
and get feedback from the remote host. If you are moving a large amount of data, you should
background this operation so your web browser does not time out; the small size of the return
document reporting the final completion status does not reduce the amount of time for the actual local
export and remote import operations.
When pushing data to the remote instance, CSVUtil queries the data dictionary to determine which
columns in the given table exist on the remote system. Columns which do not exist on the remote
system are omitted from the CSV file.
When pushing data to a remote system, you must indicate the version of the remote system. This is
required because the format of the URL is different between version 5.x and version 6.x of Oracle
Transportation Management.
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 11-3
12. Exporting Table Sets and Piping to a Remote Instance
CSVUtil supports exporting ordered table sets. An example of an ordered table set is the EXPORT table
set, which lists several hundred tables sorted in foreign key sequence (top-down). Tables in the
table_set_detail table may be prefixed by NNNNNNN for the purpose of sequencing the tables. For
example:
TABLE_NAME
--------------------------------------------------------
0000000.RATE_OPERAND
0001000.ACCESSORIAL_BASIS_PRECEDENCE
0002000.ACCESSORIAL_CODE
0003000.RATABLE_OPERATOR
0004000.RATE_GEO_COST_OPERAND
0005000.COUNTRY_ZONE
0006000.COUNTRY_CODE
0007000.CURRENCY
0008000.DIM_RATE_FACTOR
0009000.ACCESSORIAL_COST
0010000.RATE_UNIT_BREAK_PROFILE
As you can see, the tables are prefixed by NNNNNNN in order to ensure they are sequenced within the
table set. When you export a table set, you normally pipe it to a remote system. If you do not pipe it
to a remote system, it will generate a bunch of temporary files on the source system and leave them
there.
Here is a sample screen shot showing how you would normally export the EXPORT table set and pipe it
to a remote system.
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 12-1
Figure 12-1
Notice that the above screen requests background processing by specifying an email address and
SMTP Host.
12-2 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
13. Copying Rates between Databases Using Zip Files
CSVUtil can be used to copy a rate_offering, along with all of its prerequisite parent and child data
from one database to another.
Note: There may only be two lines of text in the above example.
Place the csvutil.ctl file in a zip file called name.bg.zip, where name can be anything.
The xcsvwpcd (export CSV with parent and child data) command will export the rate_geo
records, and will recursively export all parent and child records. This can take a while (up to 8
hours).
The -excludePublic N option means that referenced PUBLIC data will also be exported. If you
are sure that your target database has all the required public data, then you can change this
to Y, which will save some time on the export.
Step 2 – Use the Integration Upload Screen to Upload the Zip File
created in step 1
Use the Integration Upload Screen to upload the exp_rate_offering.bg.zip file. In response to your
upload, you immediately receive a message indicating that your export job has been submitted to run
in the background. You receive an email when the job completes. The email includes an HTML link to
allow you to download the resultant zip file containing your multi-table export.
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 13-1
Step 6 – Upload the zip file from Step 5 to the target instance
To import to the target instance, again use the integration upload screen to upload the background zip
file to target instance. You again receive a response indicating that you will get an email when the job
completes. The email will again contain a link to allow you to download a results zip file which contains
a log file. You will need to examine the log file to see how the import did.
Hint: If you are exporting from a migrated database to a fresh database, use the -
removeUndefinedColumns option.
13-2 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
14. Importing Voyage Schedule Data
You can import ocean schedules from a variety of portals, like ESG, CargoSmart, INTTRA, and
GTNexus.
Assuming you want to load data from multiple providers into separate partitions, load the data from
the first provider in the staging tables. Once complete, the data should be moved to the database in
the first partition. After the first data set is complete, the data from the second provider should be
loaded in the staging tables. After that, the data should be moved to the database in the second
partition. This would continue until all the data is loaded.
1. Acquire voyage schedule data. While the data from some providers is available in the correct
Oracle Transportation Management format, you need to ensure that the format is correct prior
to loading it in the staging tables.
2. Setup Mapping of Data Sources and Partition Keys
This step is optional, but it makes it easier for you to see what partition key goes with what
data provider.
pkg_voyage.setup_data_source ('PROVIDER1',1)
There is a maximum of seven partitions available. It is the VOYAGE and VOYLOC tables
that are partitioned, not the staging tables. It is possible to combine multiple data source
providers in a single partition. This requires you to load data from all data providers in that
partition prior to initiating the loading process.
Table Description
5. Delete the current voyage schedules and load the new data set from the staging tables.
pkg_voyage.load_schedule (null,200,'Y')
The first parameter is null because the procedure will look up the partition key using the
mapping previously setup. If you did not map data sources to partition keys, you need to
make sure to load each data provider’s data set in a separate partition.
200 defines the batch size in terms of the number of records the database should hold in
its buffer before it writes them to the database
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 14-1
‘Y’ states that errors will be logged to the log file
The Load Schedule procedure takes the new data from the X_VOYAGE and X_VOYLOC
tables by cross-referencing service provider IDs with the X_VOY_CAR_MAP table and the
location IDs with the X_VOY_LOC_MAP table. Note that if a mapping is missing, the
procedure creates a new location using the location ID as the GID, and adds a mapping
record to the X_VOY_CAR_MAP or X_VOY_LOC_MAP as needed.
If logging was enabled, and there were any problems during the above steps, a message will
be posted to the error log.
If logging was enabled, the current mapping of data source and partition keys can be viewed
by executing the following command using a SQL editor:
select * from data_source_partition_view
Deleting Schedules
pkg_voyage also contains the following:
Table 14-2
Delete all the data from a specified data delete_schedule p_dataSource (VARCHAR2)
provider.
14-2 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
15. Copying Domains
Note: While copying domains, make sure no user accesses the database. You can do this
by shutting down the application server.
Note: If you want to copy domain1 that needs data from domain2 and you want domain1
to have access to all data in domain2 in the new target database too, you need to make
sure you copy domain2 before domain1.
This chapter describes a set of tools to copy domains. Each of them has its limitations and
advantages.
Table 15-1
In Schema Data in CLob and long columns can You must rename the copied Only within
Copy be copied. domain. one
database.
For tables that have a
domain_name column and a
numeric primary key, the primary
key will increment utilizing
sequence numbers. However, its
copied child fk column data still
points to the old
from_domain_name parent.
Database Preferred tool to build a clean Requires that a public database Within or
Link Copy database out of an existing link can be created from the between
database. target database to the source databases.
database.
Tables in your target and source
domain can contain different Allows you to copy CLob and long
columns.* columns. However, the data
types in the local and remote
You can rename or keep the copied domains must be the same.
domain name.
* Tables might contain different columns if you migrated your source database from an earlier
database version and you create your target database with the create_all script. In this case, your
migrated database contains obsolete columns since the migration scripts do not generally drop
obsolete columns.
In Schema Copy
This tool allows you to copy domains within one database. You can copy domains with or without their
child domains. Child domains keep their original child domain names; only the parent domain name
part is replaced.
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 15-1
What the Objects do
This tool uses these stored procedures in pkg_novpd_domain_copy:
Table 15-2
set_copy_parameters Stores what “from_domain” to copy into what “to_domain”. You can
enter multiple pairs of domains before executing the actual copying.
reset_parameters Clears the list of domains to copy. You might want to do this if you
notice a spelling error.
Set-up
Compile the packages.
1. Log in as glogowner.
2. sqlplus>@create_pkg_novpd_inschema_copy.sql to compile the package.
3. sqlplus>@novpd_domain_copy_script_builder.sql to generate the domain copy script,
novpd_load.sql. In novpd_load.sql, there is a procedure for every table. Each procedure is
enclosed by "declare" and a "/". You can remove a procedure from the script if you do not
want to copy a certain table.
Copy Domains
1. sqlplus>execute pkg_novpd_domain_copy.set_copy_parameters('from_domain', 'to_domain',
copy_child_domains, domain_info) to set your copy parameters.
Note: You need to execute this command for every domain to be copied.
Note: You can copy multiple domains with or without renaming them in a single run.
Note: If domains depend on each other for data and you want to rename at least one of
these domains, you must copy all these domains in a single run. This will allow
novpd_load.sql to keep all dependencies correct. If you do not, some of the data will be
rejected due to foreign key violations.
Table 15-3
Parameter Description
15-2 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
Parameter Description
domain_info You must enter "false". This retrieves domain information from
the local source database instead of a remote target database.
The total number of rows copied or rejected is written in the database_link_domain_copy.log file. If an
exception happens, the exception code as well as the primary key is also written to the log file.
Furthermore, if the exception is a foreign key violation, the log will include the foreign key.
Later, if you need to change the database link to point to a different database, you must first
drop the database link (drop public database link loader.oracle.com ) and then recreate it.
4. Sqlplus>select count(1) from [email protected] to confirm that the database link
is active.
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 15-3
Generate Script
1. Sqlplus>connect glogowner/password@targetdb
2. Sqlplus>@create_pkg_novpd_inschema_copy.sql
3. Sqlplus>@database_link_domain_copy_script_builder.sql to generate the link_load.sql
script. link_load.sql contains a stored procedure for every table it will copy. Each procedure is
enclosed by "declare" and a "/".
Note: You can remove a procedure from the link_load.sql script if you do not want to copy
a certain table. Note that once you remove a procedure for a table, its child tables are
rejected.
Note: Like novpd_load.sql, link_load.sql only contains a stored procedure for tables that
the two databases have in common. Furthermore, only data in columns that appear in both
the target and source database will be copied. This allows you to copy domains between
databases of different releases.
Copy Domains
Note: During the domain copy, only one commit per table and domain is executed. If you
want to copy a large amount of data, be sure to allocate enough rollback tablespace and
segments.
Note: You can copy multiple domains with or without renaming them in a single run.
Note: If domains depend on each other for data and you want to rename at least one of
these domains, you must copy all these domains in a single run. This will allow
link_load.sql to keep all dependencies correct. If you do not, some of the data will be
rejected due to foreign key violations.
Table 15-4
Parameter Description
15-4 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
Parameter Description
domain_info You must enter "true". This retrieves domain information from the
remote source database instead of the local target database.
Note: If the target database schema has changed, you need to run the
database_link_domain_copy_script_builder.sql script again to create an updated link_load.sql
script.
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 15-5
16. Deleting Domains
This chapter describes the steps to delete domains in Oracle Transportation Management.
1. Shut down the Oracle Transportation Management application. This includes WebLogic,
Tomcat, Apache, etc.
2. Log in directly to the database using a database management utility such as SQLPLUS. Log
into the database as glogowner.
3. Delete a single domain. Enter the following command at the SQLPLUS prompt:
Exec domainman.delete_domain(‘DOMAIN’);
Note: Substitute the domain name that you want to delete for DOMAIN. Since this does a
cascade delete, this may take a significant amount of time. If there is any data cross-
referenced between domains, the data referenced will not be deleted. For example, if
Shipments in DomainA reference rates in DomainB, and you delete DomainB, rates in
DomainB referenced by shipments in DomainA can not be deleted.
4. Delete mutiple domains. Enter the following commands at the SQLPLUS prompt:
Exec domainman.mark_domain_for_delete (‘DOMAIN’, including_sub_domains);
Note: Substitute the domain name that you want to delete for DOMAIN.
Including_sub_domains equals “true” or “false”. If it is “true”, then the child domains are
also marked for deleted. Otherwise, the child domains are not included for deletion. This
procedure should be called for each domain to be deleted. Every time the procedure is
called, the domain and its child domains are cached in memory. If you make a mistake,
you have to log out the session and re-log in.
Exec domainman.delete_marked_domains;
Note: This procedure iterates through all the domains and child domains marked in the
previous step. It deletes one table at a time for the domains and their children. It yields
better performance. Futhermore, it can delete cross-referenced data within domains in this
transaction.
5. Delete non-existent domain data. Enter the following commands at the SQLPLUS prompt:
Set serverout on size 1000000
Exec domainman.report_unreferenced_domains;
Note: This procedure reports all the non-existent domains table by table. The non-existent
domains are the ones which are not in domain table. They could be from a bug from
previous delete domain procedure or the result from loading a CSV. After reviewing the
report generated from the previous step, you can call the next procedure to delete the data
in all the tables for the non-existent domains.
Exec domainman.delete_unreferenced_domains;
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 16-1
17. Reference A: DB.XML Transaction Codes
When importing db.xml with any of the methods described in this document, there are six transaction
codes currently available:
I - Insert Mode: Only inserts are performed. If the data already exists in the database, you will
get primary key errors.
IU - Insert/Update Mode: Attempts to insert data. If a primary key violation occurs, it updates
the data. No delete statements are generated.
RC - Replace Children Mode: Deletes all child data corresponding to the top level parent,
updates the top level parent, and reinserts the child data. This mode allows for a complete
replacement of a data object.
II: Insert/Ignore Dupes: Attempts to insert a new record but only if it does not exist already.
U: Update only existing records.
D: Delete: Deletes the object and all associated child data. NOTE: as this is essentially a
‘cascade delete’ of an object this should only be used with particular care. For example,
deleting a LOCATION may result in deleting SHIPMENTs which are related to that LOCATION.
CSVUtil supports a “replace children” (rc) command when processing multi-table CSV files. The rc
command will recursively delete all child records and re-insert them from the CSV file. This is useful
when you want to completely replace the rows that comprise a complex multi-table business object.
The “C.” table sets are used to determine the hierarchical parent/child relationships.
For example:
TABLE_SET_DETAIL
TABLE_SET,TABLE_NAME
C.GEO_HIERARCHY,GEO_HIERARCHY_DETAIL
C.GEO_HIERARCHY_DETAIL,HNAME_COMPONENT
The C.GEO_HIERARCHY table set indicates that the GEO_HIERARCHY_DETAIL table is a child of
geo_hierarchy.
The C.GEO_HIERARCHY_DETAIL table set indicates that the HNAME_COMPONENT table is a child of
geo_hierarchy_detail.
Examples:
If you submit the following multi-table CSV file with the “rc” command, all rows in the
GEO_HIERARCHY_DETAIL table relating to the GUEST.COUNTRY hierarchy would be deleted (since
there are none to replace those records in the CSV file).
$HEADER
GEO_HIERARCHY_DETAIL
GEO_HIERARCHY_GID,HNAME_COMPONENT_GID,HLEVEL,DOMAIN_NAME,INSERT_USER,INSERT_DAT
E,UPDATE_USER,UPDATE_DATE
GEO_HIERARCHY
GEO_HIERARCHY_GID,GEO_HIERARCHY_XID,RANK,COUNTRY_CODE3_GID,DOMAIN_NAME,INSERT_U
SER,INSERT_DATE,UPDATE_USER,UPDATE_DATE
EXEC SQL ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS..'
$BODY
GEO_HIERARCHY
"GUEST.COUNTRY","COUNTRY",10,,"GUEST","DBA.ADMIN",2001-08-30
11:01:56.0,"DBA.ADMIN",2005-10-26 14:44:50.0
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 17-1
If you submit the following multi-table CSV file with the “rc” command, there will be two records in the
geo_hierarchy_detail table relating to the GUEST.COUNTRY hierarchy, regardless of how many rows
were there previously.
$HEADER
GEO_HIERARCHY_DETAIL
GEO_HIERARCHY_GID,HNAME_COMPONENT_GID,HLEVEL,DOMAIN_NAME,INSERT_USER,INSERT_DAT
E,UPDATE_USER,UPDATE_DATE
GEO_HIERARCHY
GEO_HIERARCHY_GID,GEO_HIERARCHY_XID,RANK,COUNTRY_CODE3_GID,DOMAIN_NAME,INSERT_U
SER,INSERT_DATE,UPDATE_USER,UPDATE_DATE
EXEC SQL ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS..'
$BODY
GEO_HIERARCHY
"COUNTRY","COUNTRY",10,,"PUBLIC","DBA.ADMIN",2001-08-30
11:01:56.0,"DBA.ADMIN",2005-10-26 14:38:33.0
GEO_HIERARCHY_DETAIL
"COUNTRY","COUNTRY_CODE3",1,"PUBLIC","DBA.ADMIN",2001-08-30 11:01:56.0,,
GEO_HIERARCHY_DETAIL
"COUNTRY","CITY",2,"PUBLIC","DBA.ADMIN",2001-08-30 11:01:56.0,,
In version 5.5 and later, the “rc” command is available after you upload a CSV file via the integration
manager.
17-2 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
18. Reference B: Specifying Complex Queries
This section shows the SQL query corresponding to the predefined rate_geo database object.
select rate_geo.*, \
cursor (select rate_geo_stops.* from rate_geo_stops where
rate_geo_stops.rate_geo_gid = rate_geo.rate_geo_gid) as rate_geo_stops, \
cursor (select rate_geo_accessorial.* from rate_geo_accessorial where
rate_geo_accessorial.rate_geo_gid = rate_geo.rate_geo_gid) as
rate_geo_accessorial, \
cursor (select rg_special_service.* from rg_special_service where
rg_special_service.rate_geo_gid = rate_geo.rate_geo_gid) as
rg_special_service, \
cursor (select rg_special_service_accessorial.* from
rg_special_service_accessorial where
rg_special_service_accessorial.rate_geo_gid = rate_geo.rate_geo_gid) as
rg_special_service_accessorial, \
cursor (select rate_geo_cost_group.*, \
cursor (select rate_geo_cost.* , \
cursor (select rate_geo_cost_weight_break.* \
from rate_geo_cost_weight_break \
where rate_geo_cost_weight_break.rate_geo_cost_seq =
rate_geo_cost.rate_geo_cost_seq and
rate_geo_cost_weight_break.rate_geo_cost_group_gid =
rate_geo_cost.rate_geo_cost_group_gid) as rate_geo_cost_weight_break
\
from rate_geo_cost \
where rate_geo_cost.rate_geo_cost_group_gid =
rate_geo_cost_group.rate_geo_cost_group_gid ) as rate_geo_cost \
from rate_geo_cost_group \
where rate_geo.rate_geo_gid = rate_geo_cost_group.rate_geo_gid) as
rate_geo_cost_group \
from rate_geo "
The main thing to notice is the use of nested cursors to specify a hierarchical query.
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 18-1
19. Reference C: CSVUtil Response Messages
At the completion of processing the command, CSVUtil responds in the form of an XML message. The
XML message may contain the following elements:
Information passed in as input parameters such as the Command, DataDir, and DataFileName
Information about the contents of the input file such as the TableName and ColumnList
An Error element identifying the error that was detected.
Statistics on the success of the message as follows:
a. ProcessCount: The number of rows that were successfully processed
o ErrorCount: The number of rows where an error was detected
o Skipcount: The number of rows that were skipped because of duplicate or missing
keys. This is only valid when using the ii command which suppresses unique key
constraint violations when inserting data, or the uu and dd commands which suppress
"no data found" constraint violations when updating/deleting data.
<CSVUtil>
<Command>i</Command>
<DataDir>.\</DataDir>
<DataFileName>weight_break.csv</DataFileName>
<ProcessCSV>
<TableName>WEIGHT_BREAK</TableName>
<ColumnList>WEIGHT_BREAK_GID,WEIGHT_BREAK_XID,WEIGHT_BREAK_PROFILE_GID,WEIGHT_B
REAK_MAX,WEIGHT_BREAK_MAX_UOM_CODE,WEIGHT_BREAK_MAX_BASE,DOMAIN_NAME</ColumnLis
t>
<ProcessCount>3</ProcessCount>
<ErrorCount>0</ErrorCount>
<SkipCount>0</SkipCount>
</ProcessCSV>
</CSVUtil>
The following is an example of the response message typically received when exporting data using the
xcsv command.
<CSVUtil>
<Command>xcsv</Command>
<DataDir>.\</DataDir>
<DataFileName>weight_break.csv</DataFileName>
<Write>
<TableName>WEIGHT_BREAK</TableName>
</Write>
</CSVUtil>
Error Messages
After processing a command, CSVUtil displays a response in the form of an XML message (see the
Loading CSV Data via the Application Server section). When an error is detected in the
processing, the XML message will contain an Error element with the details. The Error XML element
indicates the table name, indicates the type of error detected, and lists the data (or row in file) that
was being processed when the error occurred.
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 19-1
Below is the error message that Oracle Transportation Management displayed in the procedure (see
the Loading CSV Data via Integration section). The TableName element indicates the table being
processed, the Exception element provides the error message, and the Data element indicates the row
being processed. In this case, it indicates that the JUNK table does not exist in the database.
<Error>
<TableName>JUNK</TableName>
<Exception>ORA-00942: table or view does not exist
</Exception>
<Data>"Data1","Data2","Data3"</Data>
</Error>
Import
This topic describes some common error messages while importing. For each error, there is an
explanation of when the message occurs and the action needed to correct the error.
Table 19-1
Heading Data
Occurs Table name improperly specified (misspelled or invalid table) on the first line of
When: the CSV file.
Corrective Verify that the table exists and that the CSV file contains the correct table name.
Action:
Table 19-2
Heading Data
Occurs Inserting data with primary keys that are already in the database.
When:
Corrective Depending on the action desired, one of the following can be used:
Action:
If the data should be skipped or ignored, use the ii command to suppress
the message.
If the data is intended to be new, change the keys.
If the data is intended to be an update, use the u or uu command.
Table 19-3
Heading Data
19-2 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
Heading Data
Occurs During a delete when child records in other tables depend on the key being
When: removed.
Corrective Delete child records in associated tables before deleting from this table, or use the
Action: RC command code in CSVUtil if deleting all associated child records is your intent.
Table 19-4
Heading Data
Message: <Error>There are supposed to be 7 columns of data, but I found 6 columns in this
line: ["MYDOMAIN.LT 4500","LT
4500","MYDOMAIN.DEFAULT",4500,"LB","MYDOMAIN"]</Error>
<Error>
<TableName>WEIGHT_BREAK</TableName>
<Data>"MYDOMAIN.LT 4500","LT
4500","MYDOMAIN.DEFAULT",4500,"LB","MYDOMAIN"</Data>
</Error>
Corrective Verify that the data contains the number of fields as indicated in the ColumnList,
Action: and that the field formats (string, numeric, date, etc.) are valid.
Table 19-5
Heading Data
Message: <Error>
<TableName>WEIGHT_BREAK</TableName>
</Error>
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 19-3
Heading Data
Corrective Verify that the data contains the number of fields as indicated in the ColumnList,
Action: and that the field formats (string, numeric, date, etc.) are valid.
Table 19-6
Heading Data
Message: <Error>There are supposed to be 7 columns of data, but I found 1 columns in this
line: []</Error>
<Error>
<TableName>WEIGHT_BREAK</TableName>
</Exception>
<Data></Data>
</Error>
Occurs The CSV file contains extra blank lines at the end. Oracle Transportation Management
When: considers each line to represent a row of data, regardless of whether or not it is
blank.
Corrective Remove any extra blank lines at the end of the file.
Action:
Table 19-7
Hea Data
ding
Mess <Error>
age:
<TableName>WEIGHT_BREAK</TableName>
<Data>"MYDOMAIN.LT 4500","LT
4500","MYDOMAIN.DEFAULT",4500,"LB",4500,"MYDOMAIN12345678901234567890123456
789012345678901234567890123456789012345678901234567890"</Data>
</Error>
19-4 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
Hea Data
ding
Occu Field length for one of the columns has been exceeded.
rs
Whe
n:
Corre Limit the length of the input data field value to the appropriate size.
ctive
Actio
n:
Table 19-8
Heading Data
Message: <Error>
<TableName>WEIGHT_BREAK</TableName>
<RowsProcssed>0</RowsProcssed>
<Data>"MYDOMAIN.LT 4500","LT
4500","MYDOMAIN.DEFAULT",4500,"LB",4500,"MYDOMAIN"</Data>
</Error>
Occurs Attempted to delete data where the data does not exist in the table.
When:
Corrective Validate that the keys being used to delete the data are correct. Could use the dd
Action: command to suppress the error message.
Export
This topic describes some common error messages while exporting. For each error there is an
explanation of when the message occurs and the action needed to correct the error.
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 19-5
Table 19-9
Heading Data
Message: <CSVUtil>
<Command>xcsv</Command>
<DataDir>.\</DataDir>
<DataFileName>weight_break.csv</DataFileName>
<Write>
<TableName>WEIGHT_BREAK2</TableName>
</Write>
</CSVUtil>
Occurs When: Attempting to export data from a table that does not exist.
Corrective Action: Verify table exists and that the CSV file contains the correct table name.
19-6 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.
20. Appendix: General Properties
See the “Advanced Configuration: Customer-defined Properties” chapter in the Administration Guide
for instructions on how to manage reserved properties.
Default: CDATA
glog.database.archive.password = password
(default: {warchive.archive_c )
Default:
<otm_home>/glog/integration/projects
Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved. 20-1
20-2 Copyright © 2005, 2018, Oracle and/or its affiliates. All rights reserved.