Sei sulla pagina 1di 13

Shipping Interface

SHPSYS User Setup


Reference Guide

Table of Contents
Introduction ...................................................................................................................................... 2
SQL Server Setup............................................................................................................................ 2
Create XSHIPEXP_VIEW View .................................................................................................. 5
Create XSHIPEXPP_VIEW View ................................................................................................ 5
Oracle Setup .................................................................................................................................. 10
Create set_default_schema Trigger .......................................................................................... 13

May 2010 Sage Page 1 of 13


Introduction
Due to both the UPS WorldShip and FedEx Ship Manager softwares inability to define the
schema (X3 folder) when setting up external data mappings, the connection to X3 databases can
be extremely slow. These connections are made on the system when opening the window for
import, when shipping each individual package and/or during End of Day processing. Since
these connection times can sometimes exceed 5 minutes, it can become necessary to define a
database user that has restricted access to tables. By restricting database access on the user,
the connection time can be greatly improved. A new user named SHPSYS will be used to define
the data mapping on the shipping systems.

This document defines how to setup this SHPSYS user on SQL Server 2005 and Oracle.

SQL Server Setup


1. Create a new database user called SHPSYS.

May 2010 Sage Page 2 of 13


2. Set the password for this user to be tiger to be consistent with other X3 database users.

3. Set the Default database to be the database this user will have access to.

May 2010 Sage Page 3 of 13


4. Select User Mapping from the left-hand list.

5. In the Users mapped to this login selection box, click the checkbox for the database this
user will require access to. Set the Default Schema to the schema (X3 Folder) where the
shipping data resides.

May 2010 Sage Page 4 of 13


6. Create two views using the scripts listed below changing the schema reference to be
the schema (X3 folder e.g. PROD) that the user will require access to. Replace the
database reference with the database name (e.g. x3v6).

Create XSHIPEXP_VIEW View

USE [database]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [schema].[XBSHPEXP_view]
AS
SELECT *
FROM [schema].[XBSHPEXP]

Create XSHIPEXPP_VIEW View

USE [database]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [schema].[XBSHPEXPP_view]
AS
SELECT *
FROM [schema].[XBSHPEXPP]

May 2010 Sage Page 5 of 13


7. In the Databases Security settings, select the new SHPSYS user.

May 2010 Sage Page 6 of 13


8. Do not change anything under General settings.

9. Select Securables from the left-hand pane. Add the Shipping_Interface stored
procedure, XBSHPEXP_view and XBSHPEXPP_view views and XBSHPINT table from
the desired schema (X3 folder).

May 2010 Sage Page 7 of 13


May 2010 Sage Page 8 of 13
10. Grant the following permissions:

Stored Procedure: Shipping_Interface - Execute


Table: XBSHPINT - Delete, Insert, References, Select and Update

View: XSHIPEXP_view Select


View: XSHIPEXPP_view Select

11. When setting up the ODBC and shipping system connections to the X3 database, user
the SHPSYS user instead of the X3 folder user. Example: User SHPSYS instead of
PILOT.

May 2010 Sage Page 9 of 13


Oracle Setup
These setup instructions use the Oracle Enterprise Manager Console.

1. In Security Users, create a new user called SHPSYS and give it a password of tiger
to be consistent with other X3 database login users.

2. In Tablespaces, be sure the Default is the database this user will require access to.

May 2010 Sage Page 10 of 13


3. Select the System tab and grant access to CREATE SESSION.

May 2010 Sage Page 11 of 13


4. Select the Object tab and select the schema (X3 folder) that contains the table you will
need to grant access too.

5. Grant the following access right to these tables:

XBSHPEXP Select
XBSHPEXPP Select
XBSHPINT Alter, Delete, Insert, Select and Update

May 2010 Sage Page 12 of 13


6. Since the shipping systems are not able to set the schema (X3 folder) when accessing
the Oracle database, the default schema for the user must to set. The default schema for
the SHPSYS user is always SHPSYS and not the schema we need access to. To
change the schema each time the SHPSYS user logs on to Oracle, a
set_default_schema trigger will need to be created. This trigger changes the default
schema to the schema (X3 folder) we wish to have access to.

Create the trigger in Oracle using the following SQL script. Change the newschema
reference to be the schema (X3 folder) you wish to access. Example: PILOT.

Create set_default_schema Trigger

create or replace trigger set_default_schema


after logon on SHPSYS.schema
begin
execute immediate 'alter session set
current_schema=newschema';
end;

This trigger will be run each time the SHPSYS user logs on to Oracle and can be
viewed/updated in the SYSTEM schema.

May 2010 Sage Page 13 of 13

Potrebbero piacerti anche