Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

Oracle® Retail Store Inventory Management

Data Migration Guide


Release 12.0

September 2007
Oracle® Store Inventory Management Data Migration Guide, Release 12.0

Copyright © 2007, Oracle. All rights reserved.

Primary Author: Rich Olson

The Programs (which include both the software and documentation) contain proprietary
information; they are provided under a license agreement containing restrictions on use and
disclosure and are also protected by copyright, patent, and other intellectual and industrial
property laws. Reverse engineering, disassembly, or decompilation of the Programs, except to the
extent required to obtain interoperability with other independently created software or as specified
by law, is prohibited.

The information contained in this document is subject to change without notice. If you find any
problems in the documentation, please report them to us in writing. This document is not
warranted to be error-free. Except as may be expressly permitted in your license agreement for
these Programs, no part of these Programs may be reproduced or transmitted in any form or by
any means, electronic or mechanical, for any purpose.

If the Programs are delivered to the United States Government or anyone licensing or using the
Programs on behalf of the United States Government, the following notice is applicable:

U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and
technical data delivered to U.S. Government customers are "commercial computer software" or
"commercial technical data" pursuant to the applicable Federal Acquisition Regulation and agency-
specific supplemental regulations. As such, use, duplication, disclosure, modification, and
adaptation of the Programs, including documentation and technical data, shall be subject to the
licensing restrictions set forth in the applicable Oracle license agreement, and, to the extent
applicable, the additional rights set forth in FAR 52.227-19, Commercial Computer Software—
Restricted Rights (June 1987). Oracle Corporation, 500 Oracle Parkway, Redwood City, CA 94065

The Programs are not intended for use in any nuclear, aviation, mass transit, medical, or other
inherently dangerous applications. It shall be the licensee's responsibility to take all appropriate
fail-safe, backup, redundancy and other measures to ensure the safe use of such applications if the
Programs are used for such purposes, and we disclaim liability for any damages caused by such
use of the Programs.

Oracle, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle Corporation
and/or its affiliates. Other names may be trademarks of their respective owners.

The Programs may provide links to Web sites and access to content, products, and services from
third parties. Oracle is not responsible for the availability of, or any content provided on, third-
party Web sites. You bear all risks associated with the use of such content. If you choose to
purchase any products or services from a third party, the relationship is directly between you and
the third party. Oracle is not responsible for: (a) the quality of third-party products or services; or
(b) fulfilling any of the terms of the agreement with the third party, including delivery of products
or services and warranty obligations related to purchased products or services. Oracle is not
responsible for any loss or damage of any sort that you may incur from dealing with any third
party.
Value-Added Reseller (VAR) Language

(i) the software component known as ACUMATE developed and licensed by Lucent Technologies
Inc. of Murray Hill, New Jersey, to Oracle and imbedded in the Oracle Retail Predictive
Application Server – Enterprise Engine, Oracle Retail Category Management, Oracle Retail Item
Planning, Oracle Retail Merchandise Financial Planning, Oracle Retail Advanced Inventory
Planning and Oracle Retail Demand Forecasting applications.

(ii) the MicroStrategy Components developed and licensed by MicroStrategy Services Corporation
(MicroStrategy) of McLean, Virginia to Oracle and imbedded in the MicroStrategy for Oracle Retail
Data Warehouse and MicroStrategy for Oracle Retail Planning & Optimization applications.

(iii) the SeeBeyond component developed and licensed by Sun MicroSystems, Inc. (Sun) of Santa
Clara, California, to Oracle and imbedded in the Oracle Retail Integration Bus application.

(iv) the Wavelink component developed and licensed by Wavelink Corporation (Wavelink) of
Kirkland, Washington, to Oracle and imbedded in Oracle Retail Store Inventory Management.

(v) the software component known as Crystal Enterprise Professional and/or Crystal Reports
Professional licensed by Business Objects Software Limited (“Business Objects”) and imbedded in
Oracle Retail Store Inventory Management.

(vi) the software component known as Access Via™ licensed by Access Via of Seattle, Washington,
and imbedded in Oracle Retail Signs and Oracle Retail Labels and Tags.

(vii) the software component known as Adobe Flex™ licensed by Adobe Systems Incorporated of
San Jose, California, and imbedded in Oracle Retail Promotion Planning & Optimization
application.

(viii) the software component known as Style Report™ developed and licensed by InetSoft
Technology Corp. of Piscataway, New Jersey, to Oracle and imbedded in the Oracle Retail Value
Chain Collaboration application.

(ix) the software component known as i-net Crystal-Clear™ developed and licensed by I-NET
Software Inc. of Berlin, Germany, to Oracle and imbedded in the Oracle Retail Central Office and
Oracle Retail Back Office applications.

(x) the software component known as WebLogic™ developed and licensed by BEA Systems, Inc. of
San Jose, California, to Oracle and imbedded in the Oracle Retail Value Chain Collaboration
application.

(xi) the software component known as DataBeacon™ developed and licensed by Cognos
Incorporated of Ottawa, Ontario, Canada, to Oracle and imbedded in the Oracle Retail Value Chain
Collaboration application.

iii
Contents
Preface ............................................................................................................................. vii
Audience ............................................................................................................................... vii
Related Documents.............................................................................................................. vii
Customer Support................................................................................................................ vii
Review Patch Documentation ............................................................................................ vii
Oracle Retail Documentation on the Oracle Technology Network............................... vii
Conventions.........................................................................................................................viii
1 Overview ....................................................................................................................... 1
2 Executing the migration.sh Script ............................................................................. 3
Executing the Script ................................................................................................................3
Script Files................................................................................................................................4
3 Performance Improvement Tips................................................................................. 7
A Appendix: Example of Date Migration ....................................................................... 9

v
Preface
This guide describes how to migrate data from SIM 11.1.3 to the SIM 12.0 database.

Audience
This guide is for database administrators and database programmers.

Related Documents
For more information, see the following documents in the Oracle Retail Store Inventory
Management Release 12.0 documentation set:
ƒ Oracle Retail Store Inventory Management Data Model
ƒ Oracle Retail Store Inventory Management Handheld Terminal Quick Reference
Guide
ƒ Oracle Retail Store Inventory Management Implementation Guide
ƒ Oracle Retail Store Inventory Management Installation Guide
ƒ Oracle Retail Store Inventory Management Licensing Information
ƒ Oracle Retail Store Inventory Management Online Help
ƒ Oracle Retail Store Inventory Management Operations Guide
ƒ Oracle Retail Store Inventory Management User Guide

Customer Support
https://metalink.oracle.com
When contacting Customer Support, please provide the following:
ƒ Product version and program/module name
ƒ Functional and technical description of the problem (include business impact)
ƒ Detailed step-by-step instructions to re-create
ƒ Exact error message received
ƒ Screen shots of each step you take

Review Patch Documentation


For a base release (".0" release, such as 12.0), Oracle Retail strongly recommends that you
read all patch documentation before you begin installation procedures. Patch
documentation can contain critical information related to the base release, based on new
information and code changes that have been made since the base release.

Oracle Retail Documentation on the Oracle Technology Network


In addition to being packaged with each product release (on the base or patch level), all
Oracle Retail documentation is available on the following Web site:
http://www.oracle.com/technology/documentation/oracle_retail.html
Documentation should be available on this Web site within a month after a product
release. Note that documentation is always available with the packaged code on the
release date.

vii
Conventions
Navigate: This is a navigate statement. It tells you how to get to the start of the procedure
and ends with a screen shot of the starting point and the statement “the Window Name
window opens.”

Note: This is a note. It is used to call out information that is


important, but not necessarily part of the procedure.
This is a code sample
It is used to display examples of code

A hyperlink appears like this.

viii
1
Overview
This document provides the details of migration of data from SIM 11.1.3 to the SIM 12.0
database.

Note: The data migration scripts are provided as a guides or


samples. Retailers must take into consideration their own
operational business practices before using and modifying
the scripts.

The data migration scripts perform the following:


ƒ Moving the data from the old schema to the new schema
ƒ Basic testing of the movement of data from the old to the new schema, with a
detailed log
ƒ Updating Sequence to new values based on the data moved from SIM 11.1.3, because
Sequence values should not overlap with the IDs imported from SIM 11.1.3

Note: Because of considerable schema changes (new tables


specific to shipments) for direct store deliveries and
warehouse deliveries, data migration scripts cannot be
provided for moving shipment data from SIM 11.1.3 to
SIM 12.0.

Data Migration Guide 1


2
Executing the migration.sh Script
Be aware of the following considerations before running the migration.sh script:
ƒ Backing up the database before executing the data migration scripts is highly
recommended.
ƒ Performance can be an issue when a large amount of data needs to be migrated in a
limited timeframe. Consider testing the scripts in a preproduction or test
environment with limited amounts of data.
ƒ If you have made any custom modifications to the database schema, those
modifications must be handled by the custom modification team.
ƒ Any bad data identified during migration, because of null values or missing
constraints, must be moved manually to the new SIM 12.0 schema.
ƒ Because of changes in the handling of time zones in SIM 12.0, please take a look at
your business process to determine if timestamps and dates need to be changed
during migration. The migration scripts provided do not handle the conversion of
dates to the new GMT-compliant time zone. See Appendix A for a detailed example
of changes that should be done in the control file used by the SQL loader to handle
this issue.

Note: The SIDs for SIM 11.1.3 and SIM 12.0 databases should
exist on the system where these migration scripts are run.

Executing the Script


To execute the script:
1. In the migration.sh file, update the following:
– SIM11_DB (SIM 11.1.3 database name)
– SIM11_USER (SIM 11.1.3 database user)
– SIM11_PWD (SIM 11.1.3 database password)
– SIM12_DB (SIM 12.0 database name)
– SIM12_USER (SIM 12.0 database user)
– SIM12_PWD (SIM 12.0 database password)
2. At the command prompt, run the migration.sh script to migrate the data from the old
schema to the new schema.
3. After the completion of the migration, check the datamigration.log file for any errors.

Data Migration Guide 3


Script Files

Script Files
The following is a list of the main script files:

# Name Description

1 migration.sh This is the main shell script file that controls the
migration of the data from the old to the new schema.
The execution steps within this script are as follows:
1. Disable all the foreign key constraints in the SIM 12
database by executing the
DataMigrationDisableForeignKeys.sh shell script.
2. Invoke child shell scripts to individually move the
data of each table from the old to the new schema.
3. When invoking each child script, get the process ID
of each process.
4. Keep pinging for the completion of the each child
process.
5. When all the child processes are completed, enable
all the foreign key constraints by executing the
DataMigrationEnableForeignKeys.sh script.
6. Execute the UpdateSequence.sh script to update the
sequences to new values, to prevent overlap of the
new sequence values with the ones that migrated
from the SIM 11 database.
7. Execute the CheckMigration.sh script to perform a
basic check of the total number of records moved for
each table from the old to the new schema.
2 DataMigrationDisableForeignKeys.sh This shell script file executes the
DataMigrationDisableForeignKeys.sql file at the
SQL*Plus prompt to disable all the foreign key
constraints for the SIM 12 database. This disables any
checks when loading data to the SIM 12 schema.
3 DataMigrationDisableForeignKeys.sql This SQL file spools the scripts to disable all the foreign
key constraints to a temporary file
DataMigrationDisableFks.sql. This temp file is then
executed to actually disable the foreign key constraints
4 DataMigrationEnableForeignKeys.sh This shell script file executes the
DataMigrationEnableForeignKeys.sql file at the
SQL*Plus prompt to enable all the foreign key constraints
for the SIM 12 database.
5 DataMigrationEnableForeignKeys.sql This SQL file spools the scripts to enable all the foreign
key constraints to a temporary file
DataMigrationEnableFks.sql. This temp file is then
executed to actually enable the foreign key constraints.
6 CheckMigration.sh This shell script checks the record count of each table
migrated from SIM 11.1.3 to SIM 12. It executes the
CheckMigration.sql file at the SQL*Plus prompt.

4 Oracle Retail Store Inventory Management


Script Files

# Name Description

7 CheckMigration.sql This sql file checks the record count for each table
migrated from SIM 11.1.3 to SIM 12. If the record counts
match, a message is logged that data was migrated
successfully; otherwise, an error message is logged, with
additional information about the name of the log file to
be checked to verify the cause of the failure of the
migration of data for that table.
8 UpdateSequence.sh This shell script updates the sequences that are used in
SIM 12 to new values, to avoid overlap between the
migrated data from SIM 11.1.3 and the new records
created in SIM 12.
9 update_sequences.sql This sql file creates a temporary table with entries of the
sequence name, table name, and the column name that
uses the sequence. It executes set_sequences_script.sql,
which updates the sequences to the new values.
10 set_sequences_script.sql This database script reads the maximum value for each
column that uses the sequence from the table and then
sets the sequence to the next value, which will be used by
SIM 12 to create new records.
11 DataMigrationDisableIndexes.sh This shell script disables all the indexes before the
loading of data into the destination database. This is
done to improve performance.
12 DataMigrationDisableIndexes.sql This sql script spools the list of scripts that disable
indexes to the temp file DataMigrationDisableIndex.sql
and then executes the spooled file to disable the indexes.
13 DataMigrationRebuildIndexes.sh This shell script enables all the indexes after the loading
of data into the destination database.
14 DataMigrationRebuildIndexes.sql This sql script spools the list of scripts that disable
indexes to the temp table DataMigrationRebuildIndex.sql
and then executes the spooled file to enable the indexes.
15 CheckMigration.log This log file contains information about the tables for
which data has been successfully or unsuccessfully
moved from SIM 11.1.3 to SIM 12.

In addition to these files for data migration, there are .sh and .ctl files for each table that is
migrated from SIM 11.1.3 to SIM 12
The scripts are in the folder /sim/database/oracle/sim_data_migration.
The migration.sh script is in the sim_data_migration folder. The folder also contains two
other folders:
ƒ migration (all .sh files)
ƒ ctl (all control files)

Data Migration Guide 5


3
Performance Improvement Tips
The following tips are only suggestions. Use them at your own discretion and after
consulting with database administrators.
ƒ Usage of DIRECT=TRUE will improve performance, because the SQL loader loads
the data directly into tables rather than generating insert queries. Note that
DIRECT=TRUE can be used only if there are no clustered tables in the schema.
ƒ Use Unrecoverable as an option in the SQL loader, which avoids writing of the
changes to redo log files and thus improves performance.
ƒ Set the destination database to No Archive Log mode.

Data Migration Guide 7


A
Appendix: Example of Date Migration
The following example is for the RK_PRICE_CHANGE table. Date columns are migrated
by executing the date_utils.convert_time_zone function, passing the required date
column as a parameter.

LOAD DATA
INFILE 'rk_price_change.dat'
BADFILE rk_price_change.bad
DISCARDFILE rk_price_change.dsc
discardmax 999999999
TRUNCATE
INTO TABLE RK_PRICE_CHANGE
fields terminated by '~'
TRAILING NULLCOLS
( PRICE_CHANGE_ID,
CHANGE_REF_ID,
ID_STR_RT,
ID_ITM,
EFFECTIVE_DATE
"date_utils.convert_time_zone(to_date(:EFFECTIVE_DATE,'MM/DD/RRRR'),'','GMT')",
END_DATE
"date_utils.convert_time_zone(to_date(:END_DATE,'MM/DD/RRRR'),'','GMT')",
PRICE_TYPE,
ORIGIN_TYPE,
UNIT_RETAIL,
STATUS,
PROM_ID,
PROMO_COMP_ID,
SELLING_UOM,
MULTI_UNITS,
MULTI_UNIT_RETAIL,
MULTI_SELLING_UOM,
MULTI_UNIT_CHANGED_IND
)

Data Migration Guide 9

You might also like