0% found this document useful (0 votes)
188 views

Windchill Oracle To SQL Server Migration Guide

Uploaded by

Anwar K
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
188 views

Windchill Oracle To SQL Server Migration Guide

Uploaded by

Anwar K
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

Windchill® Oracle® to SQL Server

Migration Guide
Windchill 9.1
December 2008
Copyright
Copyright © 2008 Parametric Technology Corporation. All Rights Reserved.
User and training guides and related documentation from Parametric Technology
Corporation and its subsidiary companies (collectively “PTC”) are subject to the copyright
laws of the United States and other countries and are provided under a license agreement
that restricts copying, disclosure, and use of such documentation. PTC hereby grants to the
licensed software user the right to make copies in printed form of this documentation if
provided on software media, but only for internal/personal use and in accordance with
the license agreement under which the applicable software is licensed. Any copy made
shall include the PTC copyright notice and any other proprietary notice provided by
PTC. Training materials may not be copied without the express written consent of PTC.
This documentation may not be disclosed, transferred, modified, or reduced to any form,
including electronic media, or transmitted or made publicly available by any means
without the prior written consent of PTC and no authorization is granted to make copies
for such purposes.
Information described herein is furnished for general information only, is subject to change
without notice, and should not be construed as a warranty or commitment by PTC. PTC
assumes no responsibility or liability for any errors or inaccuracies that may appear in
this document.
The software described in this document is provided under written license agreement,
contains valuable trade secrets and proprietary information, and is protected by the
copyright laws of the United States and other countries. It may not be copied or distributed
in any form or medium, disclosed to third parties, or used in any manner not provided for
in the software licenses agreement except with written prior approval from PTC.
UNAUTHORIZED USE OF SOFTWARE OR ITS DOCUMENTATION CAN RESULT IN
CIVIL DAMAGES AND CRIMINAL PROSECUTION. PTC regards software piracy as
the crime it is, and we view offenders accordingly. We do not tolerate the piracy of PTC
software products, and we pursue (both civilly and criminally) those who do so using all
legal means available, including public and private surveillance resources. As part of these
efforts, PTC uses data monitoring and scouring technologies to obtain and transmit data
on users of illegal copies of our software. This data collection is not performed on users
of legally licensed software from PTC and its authorized distributors. If you are using an
illegal copy of our software and do not consent to the collection and transmission of such
data (including to the United States), cease using the illegal version, and contact PTC
to obtain a legally licensed copy.
For Important Copyright, Trademark, Patent, Licensing and Data Collection
Information: For Windchill products, select About Windchill at the bottom of the product
page. For InterComm products, on the Help main page, click the link for Copyright 20xx.
For other products, click Help > About on the main menu of the product.
UNITED STATES GOVERNMENT RESTRICTED RIGHTS LEGEND
This document and the software described herein are Commercial Computer
Documentation and Software, pursuant to FAR 12.212(a)-(b) (OCT’95) or DFARS
227.7202-1(a) and 227.7202-3(a) (JUN’95), and are provided to the US Government under
a limited commercial license only. For procurements predating the above clauses, use,
duplication, or disclosure by the Government is subject to the restrictions set forth in
subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software Clause at
DFARS 252.227 7013 (OCT’88) or Commercial Computer Software-Restricted Rights at FAR
52.227 19(c)(1)-(2) (JUN’87), as applicable. 10012008
Parametric Technology Corporation, 140 Kendrick Street, Needham, MA 02494 USA

3
Contents

About This Guide ......................................................................................................................... 7


Related Documentation ............................................................................................................. 8
Technical Support..................................................................................................................... 8
Documentation for PTC Products................................................................................................. 8
Comments .............................................................................................................................. 9
Overview of the Migration Process ................................................................................................. 11
Pre-Migration Steps ...................................................................................................................... 13
Migrating Windchill Data from Oracle to SQL Server ......................................................................... 17
Appendix A: Verifying Service Pack 2.............................................................................................. 35
Appendix B: Installing SQL Server Migration Assistant 2005 (SSMA) .................................................. 37
Appendix C: Sequences ................................................................................................................ 39
Appendix D: Windchill PartsLink Server Properties .......................................................................... 41
Appendix E: Retired Tables............................................................................................................ 43
Appendix F: Migrating Localized Data ............................................................................................. 45
Appendix G: Troubleshooting ........................................................................................................ 47

5
About This Guide
1
Related Documentation ..................................................................................... 8
Technical Support............................................................................................. 8
Documentation for PTC Products......................................................................... 8
Comments ...................................................................................................... 9

The Windchill Oracle to SQL Server Migration Guide describes how to migrate Windchill data
from an Oracle database to a SQL server database. This guide is intended for technical staff
members who are experienced in application installations and familiar with the installation
hardware system. The Oracle to SQL Server migration process assumes an entry-level
database administration skill level for both Oracle and SQL Server databases.

7
Related Documentation
The following documentation may be helpful:
• Windchill 9.1 Software Matrices
• Windchill Upgrade Guide
• Getting Started with Windchill Installation and Configuration Guide
• Windchill Installation and Configuration Guide - Advanced
• Windchill Installation and Configuration Guide - Updating Existing Installation
• Windchill Rehost Guide
• Windchill Advanced Deployment Guide
• Windchill Customizer’s Guide
• Windchill Business Administrator’s Guide
• Windchill System Administrator’s Guide
If books are not installed on your system, see your system administrator.

Technical Support
Contact PTC Technical Support via the PTC Web site, phone, fax, or e-mail if you encounter
problems using your Windchill solution or the product documentation.
For complete details, refer to Contacting Technical Support in the PTC Customer Service
Guide. This guide can be found under the Related Links section of the PTC Web site
at:http://www.ptc.com/support/index.htm
The PTC Web site also provides a search facility for technical
documentation of particular interest. To access this page, use the following
URL:http://www.ptc.com/support/support.htm
You must have a Service Contract Number (SCN) before you can receive technical support.
If you do not have an SCN, contact PTC Maintenance Department using the instructions
found in your PTC Customer Service Guide under Contacting Your Maintenance Support
Representative.

Documentation for PTC Products


You can access PTC documentation using the following resources:
• Windchill Help Page — Click Help in the header of any Windchill page to open the
Windchill Help page, which provides you with a portal to all Windchill documentation,
including:
° A complete set of current online help topics for your products
° Product tutorials available on the PTC Web site
° Windchill manuals for users, administrators, and programmers
In addition, you can click Search All Help Sources to access the Windchill Help
Center, an online knowledgebase that includes a universal index of all Windchill
documentation. You can search all of the documentation at once, or use the advanced
search capability to customize your search. Once you have located a topic you want
to reference later, you can bookmark that topic for quick access and even save your
own comments about the topic.

8 Windchill® Oracle® to SQL ServerMigration Guide


° Application CD — All relevant PTC documentation is included on the CD for
the application.

° Reference Documents Web Site — All books are available from the Reference
Documents link of the PTC Web site at the following URL:
http://www.ptc.com/appserver/cs/doc/refdoc.jsp
A Service Contract Number (SCN) is required to access the PTC documentation from
the Reference Documents Web site. For more information on SCNs, see Technical
Support:
http://www.ptc.com/support/support.htm

Comments
PTC welcomes your suggestions and comments on its documentation. You can submit
your feedback through the online survey form at the following URL:
http://www.ptc.com/go/wc_pubs_feedback

About This Guide 9


Overview of the Migration
2
Process

The overall objective of this migration process is to extract Windchill data from an Oracle
database to a SQL Server 2005 database. This is a two step process: first, migrating data to
a staging database, then moving this data to a standard Windchill schema.
This process requires the use of the downloadable SQL Server Migration Assistant (SSMA)
2005 for Oracle v. 4.0, as well as the creation of two SQL Server 2005 databases. Therefore,
you will need space twice the size of your Oracle database available on the server hosting
SQL Server 2005.
The SSMA tool is used to:

• Convert the Oracle tables to SQL Server 2005 database tables

• Load the converted objects into a SQL Server 2005 database

• Migrate Data to a SQL Server 2005 database

Migrating data into the transitional database is the most important part of the process,
since a database will be created using the script supplied by the Windchill solution to
create objects in the destination database.
After the destination database has been created, the data from the transitional database
is imported into the destination database. Sequences are re-seeded, and the process
is completed.

11
Pre-Migration Steps
3
1. Open a Windchill shell and enter the following command:
windchill stop
This prevents new data from being entered into the Oracle Database.

2. Log in to the Oracle database.

3. Determine whether the PartUsesOccurrence table has content by executing the


following command:
Select count (*) from PartUsesOccurrence;
Note:
If this is not done, the data in the PartUsesOccurrence table will not migrate
properly to the SQL Server database used by the SSMA tool. This is because there
are NUMBER columns that have a scale greater than 28. This script can be found at
Windchill/db/sql/wnc/migration/OracletoSQLServer

a. If the table count is greater than 0, complete the following steps:


Note:
If the table count is equal to 0, continue with the next numbered step, page 13.

• Back up the PartUsesOccurrence table

• Execute the script TempPartUsesOccurrence_Table.sql

b. Copy the data into the newly created table from the PartUsesOccurrence table
by executing the following commands:
Insert into TempPartUsesOccurrence Select * from
PartUsesOccurrence;
Commit;

c. Verify that the data is in the TempPartUsesOccurrence table.

d. Drop the PartUsesOccurrence table.

e. Rename the TempPartUsesOccurrence table to PartUsesOccurrence by executing


the following commands:
Alter table TempPartUsesOccurrence rename to
PartUsesOccurrence;

4. Determine whether the EPMMemberLink table has content by executing the following
command:
Select count (*) from EPMMemberLink;

13
Note:
If this is not done, the data in the EPMMemberLink table will not migrate properly
to the SQL Server database used by the SSMA tool. This is because there are
NUMBER columns that have a scale greater than 28. This script can be found at
Windchill/db/sql/wnc/migration/OracletoSQLServer
a. If it is greater than 0, complete the following steps:
• Back up the table EPMMemberLink
• Execute one of the following scripts:
° If you upgraded from 7.0 to 9.1, execute TempEPMMemberLink_Table_70.sql
° If you upgraded from any other release, execute
TempEPMMemberLink_Table.sql
b. Copy the data from the EPMMemberLink table into the newly created
TempEPMMemberLink table by executing the following command:
Insert into TempEPMMemberLink Select * from EPMMemberLink;
Commit;
c. Verify that the data is in the TempEPMMemberLink table.
d. Drop the EPMMemberLink table.
e. Rename the TempEPMMemberLink table to EPMMemberLink by executing the
following command:
Alter table TempEPMMemberLink rename to EPMMemberLink;
5. Execute the following SQL command:
Select count(*) from <table name> where COUNTERPARTID is NULL;
a. Replace table name with a table from the list below:
• ATTRIBUTEORGANIZER
• BOOLEANDEFINITION
• FLOATDEFINITION
• INTEGERDEFINITION
• MEASUREMENTSYSTEM
• QUANTITYOFMEASURE
• REFERENCEDEFINITION
• STRINGDEFINITION
• TIMESTAMPDEFINITION
• UNITDEFINITION
• URLDEFINITION
b. Note any tables with a count value greater than 1. This information will be
necessary during the migration process.
For example, when the column COUNTERPARTID in these table had multiple
values of NULL, the index error described in Appendix G: Troubleshooting,
page 47 occurred. This is because Oracle UNIQUE constraint is not the same as
UNIQUE constraint in SQL Server. Oracle allows the column in the UNIQUE
index to have multiple values of NULL; however, SQL Server allows only one and
this causes the Migrate Data step to fail.

14 Windchill® Oracle® to SQL ServerMigration Guide


6. If Windchill PartsLink is installed, rename the binary table to binary1 and the rule table
to rule1. This is necessary, as “binary” and “rule” are reserved words in the SQL Server
database. To rename these tables, use the following commands:
Alter table binary rename to binary1;
Alter table rule rename to rule1;

Pre-Migration Steps 15
Migrating Windchill Data from
4
Oracle to SQL Server

The Oracle to SQL Server migration process assumes an entry-level database administration
skill level for both Oracle and SQL Server databases. The steps to install and configure SQL
Server databases, Oracle, and SQL Server Migration Assistant are documented with each
application and should be followed accordingly.
The following software is required:
• SQL Server Management Studio (See Chapter 3 of theWindchill Installation and
Configuration Guide - Advanced for information on installing SQL server.
• SQL Server 2005 Service Pack 2
Note:
To verify that you have Service Pack 2, see Appendix A: Verifying Service Pack 2,
page 35.
• SQL Server Migration Assistant (SSMA) 2005 for Oracle v.4.0. For information on
installing this tool, see Appendix B: Installing SQL Server Migration Assistant 2005
(SSMA), page 37.
• SQL Server Migration Assistant (SSMA) 2005 for Oracle Extension Pack v.4.0. For
information on installing this tool, seeAppendix B: Installing SQL Server Migration
Assistant 2005 (SSMA), page 37.
• Oracle Client. For information on installing the Oracle Client, see the Installing Oracle
chapter of theWindchill Installation and Configuration Guide - Advanced.
Note:
The Oracle Client must be installed on the same machine as the SSMA tool.
Use the following steps to migrate data from Oracle to a SQL Server database:
1. Install and configure a SQL Server database.
2. Verify connectivity to the Oracle source and the SQL Server database.
3. Create a staging database in the SQL server database.
a. Log in to SQL Server Management Studio as a SQL Server system administrator
(sa).
b. From the Object Explorer section, right-click on the connected instance name
and select New Query.
c. In the New Query window, enter the following statement:
<CREATE DATABASE [staging] ON PRIMARY ( NAME =
N’staging’, FILENAME = ’<PATH>\staging.mdf’, SIZE =

17
1024000KB, FILEGROWTH = 102400KB ) LOG ON ( NAME =
N’staging_log’, FILENAME = ’<PATH>\staging_log.ldf’,
SIZE = 1024KB, FILEGROWTH = 10%)
Note:
This statement cannot be copied directly from this document; instead, it must
be entered manually.

d. Replace the <PATH> variable with a valid location where the SQL Server database
data files will be stored.

e. Click the Execute button from the toolbar.


The following message should appear: Command(s) completed successfully

f. Refresh the database folder and verify that it exists.

Note:
The staging database does not need to have the final schema or filegroup structure
installed. It is a transitional database used to migrate data from Oracle to a SQL
Server database using SSMA. SSMA will create the destination objects from the
source Oracle schema and migrate data in a series of steps.

4. Start SSMA and create a new project.

5. Connect to Oracle source as a database administrator, and connect to the SQL Server
destination as a SQL Server system administrator (sa).
If you connect to the SQL Server and the message "Common requirement: CLR is
turned off in target SQL Server instance" appears, log in to the SQL Server as a SQL
Server system administrator (sa), open the New Query window, and execute the
following commands to turn on CLR:
Note:
This statement cannot be copied directly from this document; instead, it must be
entered manually.

18 Windchill® Oracle® to SQL ServerMigration Guide


EXEC sp_configure ’show advanced options’, ’1’;
GO
Reconfigure
GO
EXEC sp_configure ’show advanced options’, ’0’;
GO

6. Select the source Oracle schema in the Schema Mapping tab in the top right pane.
Click Modify

7. In the Choose Target Schema window, enter "staging.dbo" in the Target schema
field.

8. Select the Oracle schema in the top left pane, and select the Sequences and Tables
folders under the schema.

Migrating Windchill Data from Oracle to SQL Server 19


Note:
If your system contains localized data, you must edit the Type Mapping tab before
continuing. For more information, see Appendix F: Migrating Localized Data,
page 45.
Note:
If you have Windchill PartsLink installed, deselect the following table under the
Table folder:

bulk_add del_iba del_obj new_obj


bulk_add1 del_iba1 new_iba obj_index
bulk_delete del_iba2 new_iba1 reload_obj1
bulk_delete1 del_link new_iba2 reload_obj2

These tables contain temporary data and do not need to be migrated.

9. In the Oracle schema list, right-click the database name and select Convert Schema.
Note:
You must be connected to both Oracle and the SQL Server database for the Convert
Schema option to be available. The schema conversion does not create the
destination objects in the SQL Server.

20 Windchill® Oracle® to SQL ServerMigration Guide


Note:
This process can be time consuming, as all objects must be analyzed for type
mapping and conversion processing. SSMA displays the progress on the bottom
bar of the interface.

10. A Warning and Error List appears in the bottom pane of the window, listing all errors
and warnings raised during schema conversion. Select the error message or warning
to highlight the referenced object in the Oracle schema.

Migrating Windchill Data from Oracle to SQL Server 21


The following errors and warning messages are standard and do not need to be
addressed:

ID Description
02SS0356 Conversion from NUMBER datatype can
cause data loss.
Note:
For more information on this warning, see
Appendix G: Troubleshooting, page 47.
02SS0239 ROWID column is not accessible because
the ’Generic ROWID’ project setting is
disabled.
02SS0174 The declaration of the identifier
’ForEachDeletedRowTriggerCursor’
was converted with error(s).
02SS0269 Functional Index cannot be converted.

Since the database created by the SSMA tool is temporary, errors describing problems
with converting the schema are acceptable. All other errors should be addressed.

11. In the SQL Server Metadata explorer pane, select the Sequence Emulation folder
under the staging.dbo database. Right-click, and select Save as Script. Save the
script to a location you will remember, as it will be used later.

22 Windchill® Oracle® to SQL ServerMigration Guide


12. In the SQL Server Metadata explorer, select the Tables folder under the staging.dbo
database, and right-click to select Synchronize with Database. This will create the
converted schema in the staging database in the SQL Server destination.

Migrating Windchill Data from Oracle to SQL Server 23


Click OK to create the schema for the staging database.

24 Windchill® Oracle® to SQL ServerMigration Guide


Note:
If the Tables folder is expanded, it will display a value of [Not Found] for each table.
This is because the schema in the SQL Server database has not been created. It will
be created after you click OK.

13. Start SQL Server Management Studio (SSMS). Log in as a SQL Server system
administrator (sa), and verify the creation of the converted schema.
If there were any tables that you noted in the pre-migration steps that had multiple
values of null, disable the index for those tables. For more information, see the section
on Index Errors in Appendix G: Troubleshooting, page 47.

Migrating Windchill Data from Oracle to SQL Server 25


Note:
If you are migrating localized data, use this step to confirm that the columns that
have the value VARCHAR2 in Oracle have been changed to NVARCHAR(4000).
For example, the columnCLASSNAMEKEYDOMAINREF located in the
ACCESSPOLICYRULE table should have a value of NVARCHAR(4000).

14. Using SSMA, right-click the Tables folder in the Oracle schema list, and select Migrate
Data.

For information on common data migration errors, see Appendix G: Troubleshooting,


page 47.

15. Verify that the data migration is complete for all tables in the report created by the
SSMA tool. Address all issues where indicated. Additionally, log in to the SSMS to
verify that the data appears in the tables indicated by the SSMA report.

26 Windchill® Oracle® to SQL ServerMigration Guide


Note:
If you get an error message see Appendix G: Troubleshooting, page 47.

16. Close SSMA once the data migration validation is complete.

17. Use the PTC Solution Installer (PSI) to create the destination database and login. Do
this using the PTC Solution Installer CD. Note that this does not create the schema.
Note:
Database user name and password should match the database name.

a. Launch the PTC Solution Installer (PSI).


For more information on screens or user input fields mentioned in this step, see
Windchill Installation and Configuration Guide - Advanced and navigate to the section
titled "Installing a Standalone Product or Component".

b. Select the Advanced installation type and click Next.

c. Select Standalone Product or Component and click Next.

d. Select SQL Server Configuration and click Next.

e. Select Create Windchill Database and Users and click Next.


Enter the relevant information.

Note:
If the SQL Server database is on a different machine from the installation, use the PSI
to create the database on the same machine as SQL Server.

18. Log in to the SSMS tool.


Make sure the database exists and has the correct filegroups by executing the following
command in a New Query window:
Select name from sys.filegroups

Migrating Windchill Data from Oracle to SQL Server 27


Note:
You must log in to SSMS as the database owner that was created with the PSI in
order to execute the SQL statement.
Click Execute from the toolbar. The following filegroups should appear:
• PRIMARY
• BLOBS
• INDX
• WCAUDIT
19. Add the following properties to the site.xconf of the installation being modified to
use SQL Server.
The variable (in italics) of each property below should be replaced by your own values.
<Property name="wt.db.dataStore" overridable="true"
targetFile="codebase/wt.properties" value="SQLServer"/>
<Property name="wt.pom.dbUser" overridable="true" targetFile="db/db.properties"
value="database name"/>
<Property name=“wt.pom.dbPassword" overridable="true"
targetFile="db/db.properties" value=" database name "/>
<Property name="wt.pom.jdbc.service" overridable="true"
targetFile="db/db.properties" value="SQL Server Instance Name"/>
<Property name=“wt.pom.jdbc.port" overridable="true" targetFile="db/db.properties"
value="SQL Server Port"/>
<Property name=“wt.pom.jdbc.host" overridable="true" targetFile="db/db.properties"
value="SQL Server Host Name "/>
<Property name="wt.pom.jdbc.database" overridable="true"
targetFile="db/db.properties" value="database name"/>
Note:
If you have PartsLink installed, there are additional properties that need to be added
to the site.xconf. For a list of those properties, see Appendix D: Windchill PartsLink
Server Properties, page 41.
Note:
If you have the property wt.db.maxBytesPerChar set to 3, it needs to be changed to 1,
as it is unnecessary when using SQL Server. The property should appear as follows:
<Property name=”wt.db.maxBytesPerChar“ overridable="true”
targetFile="codebase/wt.properties” value="1"/>
If you have to make this change, you will need to rebuild your customizations.
20. In a Windchill shell, use the following command to propagate the previous values:
xconfmanager –p
21. To create the SQL Server schema, complete the following steps:
• Open a Windchill shell and navigate to the <Windchill>/db/sqlServer
• At the command line, execute the following command:
create_ddl_wt.bat
Note:
Run all scripts for your customized tables, indexes, and sequences now.

28 Windchill® Oracle® to SQL ServerMigration Guide


22. Check the final database to see that the tables exist

23. Right-click the destination database, and choose Tasks→Import Data.

24. In the SQL Server Import and Export wizard, choose the source (staging) database,
and the destination (final) database. When prompted for Table Copy or Query, select
Copy data from one or more tables or views.

25. On the Select Source Table and Views step of the wizard, check the top check-box
to select all source tables. Click the Edit Mappings button to change the destination
schema to the correct one.

26. Click on the first source table, and hold down the TAB key. This will tab through
the source and destination mappings, aligning the tables to their correct naming
conventions.

Migrating Windchill Data from Oracle to SQL Server 29


Note:
If this schema has been upgraded from a previous Windchill release and you find
tables that do not have a corresponding table in the destination database, those
tables may have been retired. SeeAppendix E: Retired Tables, page 43 for a complete
list of tables that were retired from 7.0 to 9.1 and from 8.0 to 9.1.
27. On the Select Source Tables and Views step, select the Optimize for many tables
check box.
Click Next.
28. You do not need to save the data migration package, but select Execute immediately.
Click Next or Finish. Click Finish again, and the package executes.

29. For SQL Server databases, sequences are implemented with tables and procedures.
These will be automatically created when the sequences are modeled in Oracle. If you
have additional sequences, the associated tables and procedures should have been
created when scripts from customizations were executed.
The sequence tables will start with wt_sequence_<sequence name>, and the procedures
will be found under <Database name> > Programmability > Stored
Procedures . The procedures will start with wt_get_next_sequence_<sequence_name>.
Note:
If you created a sequence with the command exec
wtpk.createSequence(’seq_name’,start_num,inc_value) for your
Oracle Installation, there will not be an associated table in the SQL Server database.
If additional sequences are necessary, model the new sequence class as an
implementation of the wt.fc.DatastoreSequence interface.
For more information on creating additional numbering sequences, see the Windchill
Customizer’s Guide.
30. In Sequence Emulations.sql file created earlier in the migration procedure,
replace the database name staging and dbo to the name of the destination database.
For the list of these sequences, see Appendix C: Sequences, page 39.
31. After all instances of dbo and the name of the staging database have been changed
to match the name of the destination database, execute the script in the New Query
window of the SSMS tool.

30 Windchill® Oracle® to SQL ServerMigration Guide


To open a Query window, select the applicable database in the left pane. Right-click
and select New Query.

Copy and paste the contents of the file Sequence Emulatations.sql into the
window, and execute. You should see the message, “Command(s) completed
successfully”.
Note:
It is important to stay logged into the SSMS tool as a SQL Server system administrator
(sa) for the script to run successfully. The script must have access to the database
sysdb to call the following procedures: sysdb.ssma_oracle.db_drop_sequence and
sysdb.ssma_oracle.create_sequence. A SQL Server system administrator (sa) is the
owner of the database sysdb.

32. Verify the script has executed as expected. New tables should appear under the Tables
folder and start with $SSMA_seq*. Associated procedures should appear under
<database name> > Programmability > Stored Procedures and start
with $SSMA_sp_get_nextval_*.

Migrating Windchill Data from Oracle to SQL Server 31


Note:
Check for any customized sequences at this time as well.

33. To move the sequence values from Oracle to the SQL Server database, perform the
following steps:

• Open a Windchill shell of the installation that has been migrated.

• Navigate to <Windchill>/db/sqlServer.

• At the command line, execute the following command:


execute_sql_script.bat
wnc\migration\OracleToSQLServer\alter_sequence_value.sql

This script re-seeds sequences for the following solutions, if they are installed on your
system: Windchill MPMLink, Windchill ProjectLink, Windchill PDMLink, Windchill
PartsLink and Windchill Supplier Management. SQL statements will not be executed
for solutions that are not installed. This prevents sequences from starting at the very
first number and helps avoid conflicts.
Note:
It is acceptable to see warnings after the script has been executed. The messages
contain the old and new sequence values.

34. If you have any customized sequences, create a new script. The content will be derived
from the name of the sequence created in the destination database and the name of the
modeled customized sequence.
Note:
Replace <variable> with a variable name and CUSTOMIZED SEQUENCE_NAME
with your customized sequence.
Note:
This statement cannot be copied directly from this document; instead, it must be
entered manually.
Declare @v_<variable> BIGINT

32 Windchill® Oracle® to SQL ServerMigration Guide


SET @v_<variable> = (SELECT IDENT_SEED(’$SSMA_seq_<CUSTOMIZED
SEQUENCE_NAME>’))
DBCC CHECKIDENT(’wt_sequence_<CUSTOMIZED SEQUENCE_NAME>’,
RESEED,@v_<variable>)
GO
If the sequence is based on a column in a table, execute the following commands:
Declare @v_<variable> BIGINT
SET @v_<variable> = (SELECT MAX(<column name>) FROM <Table
Name>)
DBCC CHECKIDENT(’wt_sequence_<SEQUENCE_NAME>’,
RESEED,@v_<variable>)
GO

35. Validate the SQL Server sequences. To check the seed value and increment value of
one sequence, use the following queries:
Note:
This statement cannot be copied directly from this document; instead, it must be
entered manually.

• To see the value of one sequence:

° Select IDENT_CURRENT(’<sequence table name>’)


Note:
This statement cannot be copied directly from this document; instead, it must
be entered manually.

° Verify that it matches the value of the LAST_NUMBER column for each sequence
in the Oracle database.

• To see the value of each sequence:


Select TABLE_NAME, IDENT_CURRENT(TABLE_NAME) as IDENT_CURRENT from
INFORMATION_SCHEMA.TABLES where IDENT_CURRENT(TABLE_NAME) is not
null and TABLE_NAME like ’wt_sequence%’

• To see the seed value for only one table in the SQL database:
Select IDENT_INCR(’sequence table name>’)

• To see the incremental value of all sequences:


Select TABLE_NAME, IDENT_INCR(TABLE_NAME) AS IDENT_INCR from
INFORMATION_SCHEMA.TABLES where IDENT_INCR(TABLE_NAME) is not
null and TABLE_NAME like ’wt_sequence%’

Note:
You must be logged into SSMS as the database owner that was created with the PSI
installer in order for the values to be returned.

36. Validate that the system brings up Apache, Tomcat, and the Method Server.

Migrating Windchill Data from Oracle to SQL Server 33


Note:
If Windchill PartsLink is installed, classified parts do not appear on the
Classification Search page by default. You must run the following command to
reload classification and data from Windchill PDMLink to the Windchill PartsLink
server:
windchill com.ptc.windchill.partslink.AdminApp -reload
For more information, see the Windchill PartsLink Classification and Reuse
Administrator’s Guide.

37. Once the system has been validated, back up the final destination database, and drop
the staging database.

38. From a Windchill shell, execute the registry editor application to migrate the registry
from Oracle to SQL Server:

a. Change directory to the <Windchill>\installer\instreg directory.


For example: cd ptc\Windchill_9.1\installer\instreg

b. Execute the following command:


Note:
On Windows, a semi-colon separates the JAR file names; file paths use back
slashes.

Windows java -cp


PSI-install.jar;InstallFramework.jar;
com.ptc.windchill.install.psiedit
<path_to_registry_file>

Example java -cp


Windows PSI-install.jar;InstallFramework.jar;
command line com.ptc.windchill.install.psiedit
ii5584f756.11b5afd9256.-8000\psi_iir_.xml

34 Windchill® Oracle® to SQL ServerMigration Guide


Appendix A: Verifying Service
A
Pack 2

There are two ways to verify that Service Pack 2 (SP2) is installed on your system:

1. Open SQL Server Management Studio (SSMS) and select About from the Help menu.
The following information should appear:

Microsoft SQL Server Management 9.00.3042.00


Studio
Microsoft Analysis Services Client 2005.090.3042.00
Tools
Microsoft Data Access Components 2000.085.1117.00
(MDAC) (xpsp_sp2_rtm.040803-2158)
Microsoft MSXML 2.6 3.0 5.0 6.0
Microsoft Internet Explorer 6.0.2900.2180
Microsoft .NET Framework 2.0.50727.1433
Operating System 5.1.2600

2. Open SQL Server Management Studio (SSMS).

a. From the Object Explorer section in SSMS, right-click on the connected instance
name and select New Query.

35
b. In the New Query window, enter the following statement:
Note:
Some PDF readers display the following command incorrectly. The following
command should have no spaces between the “@” symbols.
Select @@ version

c. Click on the Execute button in the toolbar. The following value should be returned:

Microsoft SQL Server 2005 - 9.00.3054.00 (Intel X86)


Mar 23 2007 16:28:52
Copyright (c) 1988-2005 Microsoft Corporation
Standard Edition on Windows NT 5.1 (Build 2600: Service Pack 2)

If the SP2 is not installed, install it now. If it is not installed, the Oracle to SQL Server
migration will fail.

36 Windchill® Oracle® to SQL ServerMigration Guide


Appendix B: Installing SQL
B
Server Migration Assistant 2005
(SSMA)

Use the following procedure to install the SQL Server Migration Assistant (SSMA) 2005
for Oracle v.4.0:
1. Navigate to the following address to download the SSMA tool:
http://www.microsoft.com/downloads/details.aspx?
FamilyID=6d9bc6a7-75da-493e-bee5-50f4a4352b91&DisplayLang=en
Note:
The previous link goes to a third-party Web site and the link might change before
this document can be updated. If the link does not work, navigate to the Microsoft
Web site and download "SQL Server Migration Assistant 2005 for Oracle v4.0."
The Web page allows you to install the following components:
• SQL Server Migration Assistant (SSMA) 2005 for Oracle v.4.0
• SQL Server Migration Assistant (SSMA) 2005 for Oracle Extension Pack v.4.0
2. Download and install the SQL Server Migration Assistant (SSMA) 2005 for Oracle
v.4.0 as instructed
3. Download and install the SQL Server Migration Assistant (SSMA) 2005 for Oracle
Extension Pack v.4.0 as instructed, with the following exceptions:
a. When the installer asks for the SQL Server Name, exit and copy the following
scripts from
<Windchill>/db/sqlserver/wnc/migration/OracleToSqlServer to
C:\Program Files\Microsoft SQL Server Migration Assistant
2005 for Oracle Extension Pack\scripts\
Note:
You will be replacing files in this step. When the system prompts you, click
OK to continue.
• standard.sql
• standard2005.sql
• standard2008.sql
4. Navigate to C:\Program Files\Microsoft SQL Server Migration
Assistant 2005 for Oracle Extension Pack\bin\ and execute the SSMA
Script Installer.exe to complete the Extension Pack installation.

37
If Step 3, page 37 is not done, you see the following errors while you are installing the
SSMA 2005 for Oracle Extension Pack v.4.0:

38 Windchill® Oracle® to SQL ServerMigration Guide


Appendix C: Sequences
C
This is a sample of the file Sequence Emulations.sql. All variable values should be replaced
by the value of the staging database. All values in bold, need to be replaced by the value of
the destination database.
USE staging
GO
IF NOT EXISTS(SELECT * FROM sys.schemas WHERE [name] = N’dbo’)
EXEC (’CREATE SCHEMA dbo’)
GO
EXEC sysdb.ssma_oracle.db_create_sequence @dbname = N’staging’, @schema = N’dbo’,
@name =
N’DISABLEDRULE_SEQ’, @seed = 21, @increment = 1
GO
EXEC sysdb.ssma_oracle.db_drop_sequence @dbname = N’staging’, @schema = N’dbo’,
@name =
N’ENTRYNUMBER_SEQ’
GO
EXEC sysdb.ssma_oracle.db_create_sequence @dbname = N’staging’, @schema = N’dbo’,
@name = N’ENTRYNUMBER_SEQ’, @seed = 141, @increment = 1
GO
EXEC sysdb.ssma_oracle.db_drop_sequence @dbname = N’staging’, @schema = N’dbo’,
@name =
N’EPM_SEQ’
GO
EXEC sysdb.ssma_oracle.db_create_sequence @dbname = N’staging’, @schema = N’dbo’,
@name = N’EPM_SEQ’, @seed = 1, @increment = 1
GO
EXEC sysdb.ssma_oracle.db_drop_sequence @dbname = N’staging’, @schema = N’dbo’,
@name = N’EPMBUILDRULE_SEQ’ GO
EXEC sysdb.ssma_oracle.db_create_sequence @dbname = N’staging’, @schema = N’dbo’,
@name =
N’EPMBUILDRULE_SEQ’, @seed = 1, @increment = 30
GO
For example, all the entries were replaced with the final database in the example
above
EXEC sysdb.ssma_oracle.db_drop_sequence @dbname = N’pdm_pjl_mpml_suma’,
@schema = N’pdm_pjl_mpml_suma’, @name = N’DISABLEDRULE_SEQ’
GO

39
EXEC sysdb.ssma_oracle.db_create_sequence @dbname = N’pdm_pjl_mpml_suma’,
@schema = N’pdm_pjl_mpml_suma’, @name = N’DISABLEDRULE_SEQ’, @seed = 21,
@increment = 1
GO
EXEC sysdb.ssma_oracle.db_drop_sequence @dbname = N’pdm_pjl_mpml_suma’,
@schema = N’pdm_pjl_mpml_suma’, @name = N’ENTRYNUMBER_SEQ’
GO
EXEC sysdb.ssma_oracle.db_create_sequence @dbname = N’pdm_pjl_mpml_suma’,
@schema = N’pdm_pjl_mpml_suma’, @name = N’ENTRYNUMBER_SEQ’, @seed = 141,
@increment = 1
GO
EXEC sysdb.ssma_oracle.db_drop_sequence @dbname = N’pdm_pjl_mpml_suma’,
@schema = N’pdm_pjl_mpml_suma’, @name = N’EPM_SEQ’
GO
EXEC sysdb.ssma_oracle.db_create_sequence @dbname = N’ pdm_pjl_mpml_suma,
@schema = N’ pdm_pjl_mpml_suma’, @name = N’EPM_SEQ’, @seed = 1, @increment = 1
GO
EXEC sysdb.ssma_oracle.db_drop_sequence @dbname = N’ pdm_pjl_mpml_suma’,
@schema = N’ pdm_pjl_mpml_suma’, @name = N’EPMBUILDRULE_SEQ’
GO
EXEC sysdb.ssma_oracle.db_create_sequence @dbname = N’ pdm_pjl_mpml_suma’,
@schema = N’ pdm_pjl_mpml_suma’, @name = N’EPMBUILDRULE_SEQ’, @seed = 1,
@increment = 30
GO

40 Windchill® Oracle® to SQL ServerMigration Guide


Appendix D: Windchill
D
PartsLink Server Properties

The following properties need to be added to the site.xconf of the installation converted
for the PartsLink server to start. These properties would have been set automatically, if
PartsLink had been installed with SQL Server.
<Property name="nitidus.sqlcache.db.service" overridable="true"
targetFile="partslink/conf/main.properties" value="DatabaseName=database_name"/>
<Property name="nitidus.sqlcache.db.driver"
overridable="true" targetFile="partslink/conf/main.properties"
value="com.ptc.jdbc.sqlserver.SQLServerDriver"/>
<Property name="nitidus.sqlcache.db.url" overridable="true"
targetFile="partslink/conf/main.properties”
value="jdbc:ptc:sqlserver:$(nitidus.sqlcache.db.host):$(nitidus.sqlcache.db.port);
$(nitidus.sqlcache.db.service)"/>
<Property name="nitidus.sqlcache.db.port" overridable="true"
targetFile="partslink/conf/main.properties" value="SQLServerPort"/>
<Property name="nitidus.sqlcache.db.dataStore" overridable="true"
targetFile="partslink/conf/main.properties" value="SQLServer"/>
<Property name="nitidus.sqlcache.db.host"
overridable="true" targetFile="partslink/conf/main.properties"
value="//SQLServerHostName\Instance_Name"/>
<Property name="nitidus.sqlcache.db.user" overridable="true"
targetFile="partslink/conf/main.properties” value="dbUser"/>
<Property name="nitidus.sqlcache.db.password" overridable="true"
targetFile="partslink/conf/main.properties" value="dbPassword"/>
<Property name="nitidus.security.accept" overridable="true"
targetFile="partslink/conf/main.properties"
value="$(classification.server.hostname);$(classification.client.pdmlink.hostname);SQLServerHost
"/>
Note:
All the values in bold are to be replaced with your appropriate values

41
Appendix E: Retired Tables
E
If you Upgraded from 7.0 to 9.1, and then migrated from Oracle to SQL Server, tables that
were retired when upgrading to 9.1 will not have a corresponding tables. You will have all
or some of the retired 7.0 tables listed below:
• ACCESSPOLICY
• ANNOTATIONSETTARGETS
• CADNAMEREGISTRYENTRY
• DBPREFENTRY
• DERIVEDIMAGEKEY
• EPMBUILDLINKSRULE
• EXTENDEDPAGERESULTS
• I2WURLDATA
• IASERVER
• IASPUBLISHCRITERIA
• IASPUBLISHSELECTOR
• MYPAGEQUERYABLE
• PAGERESULTS
• PRINCIPALDOMAINKEY
• PUBLSELECTORTOSCHEDULING
• QUASIPART RDCONTEXTNODE
• RDINTERMEDIATENODE
• RDNODEKEY
• RLMAPPING
• RSRLMAPPING
• RULEHISTORYENTRY
• SIMPLEDATAMAPPING
• SITEIASLINK
• SKELETONBOOKMARK
• TEMPPAGERESULTS
• WTPRODUCT
• WTPRODUCTMASTER

43
• WTSERIALNUMBEREDPART

• WTSERIALNUMBEREDPARTMASTER

• WTSNPARTINSTANCE

If you Upgraded from 8.0 to 9.1, and then migrated from Oracle to SQL Server, tables that
were retired when upgrading to 9.1 will not have a corresponding tables. You will have
all or some of the retired 8.0 tables below:

• ACCESSPOLICY

• DBPREFENTRY

• DERIVEDIMAGEKY

• EPMBUILDLINKRULE

• EPMFTBASELIEMEMBER

• I2WURLDATA

• IASERVER

• IASPUBLISHCRITERIA

• IASPUBLISHSELECTOR

• MYPAGEQUERYABLE

• PENDINGCHANGE

• PUBLSELECTORTOSCHEDULING

• RLMAPPING RSRLMAPPING

• SIMPLEDATAMAPPING

• SITEIASLINK

• TEMPPAGERESULTS

• WTPRODUCT

• WTPRODUCTMASTER

• WTSERIALNUMBEREDPART

• WTSERIALNUMBEREDPARTMASTER

• WTSNPARTINSTANCE

44 Windchill® Oracle® to SQL ServerMigration Guide


Appendix F: Migrating
F
Localized Data

If your system contains localized data, you must edit the Type Mapping tab before
continuing. Failure to do this will result in the corruption of your multi-byte data.

1. Make sure you have the Tables and Sequences folders selected in the Oracle schema
in the top left pane.

2. Select the Type Mapping tab.

3. From the Select a Type Mapping option drop-down list at the top of the pane, select
Column Type Mapping.

4. Click the Edit button to change each of the source type values listed below to the
corresponding target types. After changing each value, click OK.

Source type Target type


CHAR NCHAR
VARCHAR NVARCHAR(length)
Note:
Replace the default value of 1 with
a value of 4000.
VARCHAR2 NVARCHAR(length)
Note:
Replace the default value of 1 with
a value of 4000.

45
5. Click the Apply button on the right side of the Type Mapping to finish.

46 Windchill® Oracle® to SQL ServerMigration Guide


Appendix G: Troubleshooting
G
This appendix describes common problems that may occur and their solutions.

Warning O2SS0356 (Conversion from NUMBER datatype can


cause data loss)
Warning O2SS0356 (Conversion from NUMBER datatype can cause data loss) is thrown
when the SSMA tool encounters a NUMBER column and does not have a precision and
scale associated with it. By default, SSMA converts NUMBER to float(53), but a source
NUMBER can hold more decimal digits than float(53).
Windchill’s testing of Oracle to SQL Server migration has not found any data loss occurring
with this warning. If the SSMA tool does encounter a column with more data then it
can migrate, it will fail. See Potential Errors When Migrating Data, page for information
about errors you may encounter.

Potential Errors When Migrating Data


There are two potential errors that can occur when the SSMA tool has problems importing
data in a column of Oracle type NUMBER to SQL server.
• OCI-22053: Overflow Error
• Decimal’s scale value must between 0 and 28 inclusive. Parameter name: scale
Both errors occur because the SQL Server does not have an exact equivalent of Oracle data
type NUMBER. By default, SSMA maps the column type NUMBER to float(53). In some
cases, when the source number contains too many significant digits, the data migration
can fail with an overflow error. Overflow errors are possible when there are more than
twenty-six significant digits in the source number (a .NET limitation).
The second error occurs when the scale is greater than 28. The Oracle type NUMBER.
Precision can range from 1 to 38, and the Scale can range from ₋84 to 127. The SSMA tool
cannot interpret a scale beyond 28.
Use the following procedure to fix both errors.
1. Create a script that names the table that you are going to modify Temp<Table Name>.
Change columns that are NUMBER type to VARCHAR2(53) in the Oracle database
2. Execute the script and confirm that the table looks correct.
3. Copy the data from the original table by executing the following commands:
Insert into Temp<TableName>
Select * from <TableName>;
Commit;

47
4. Verify that the data is in the Temp<Table Name> table, and then drop the original table.

5. Rename Temp<Table Name> to the original table name.

Note:
This should not happen with the EPMMemberLink or PartUsesOccurrence tables, as
long as the scripts were executed before the migration was started.

Index Errors
When migrating data, you may see error messages such as: “Error: Cannot insert
duplicate key row in object staging.dbo.<Table Name> with unique index <TABLE
NAME>$UNIQUE.”
There are two possible reasons an error message may occur when migrating data:

• The column in the UNIQUE index has multiple values of NULL in the source table. The
Oracle UNIQUE constraint is not the same as the UNIQUE constraint in SQL Server.
Oracle allows multiple values of NULL, and the SQL Server database allows only one.

• The index length exceeds the SQL Server’s size limit of 900.

To determine the problem, look in the Target table in the SQL Server to find the columns
contained in the index. Select Table Name→Indexes and click <Table Name>$Unique.
From there, you can see the size of the column. Verify that the size of the column would
not exceed 900 if the value listed were multiplied by two. If the index only contains one
column regardless of the size, you should query the column of the table in Oracle and
check if there are multiple values of NULL.
Use the following procedure to disable indexes:

1. Log in to SSMS as a SQL Server system administrator (sa).

2. Right-click on the staging database and select New Query.

3. In the New Query window, execute the following SQL commands:


ALTER INDEX [<table name>$UNIQUE] on staging.dbo.<table name>
DISABLE
GO

48 Windchill® Oracle® to SQL ServerMigration Guide


4. Return to the SSMA tool, and select the tables for which the migration failed. Select
Migrate Data.
If some of the data has been migrated from the Oracle table to the corresponding table
in the SQL Server database, the following window may appear:

5. Click Continue. The data will be imported from the appropriate table.

If you received an error message because the index size exceeded SQL Server’s 900 limit,
you may encounter the following error again when importing data from the staging
database to the final database:

If this error message appears, use the following procedure:

1. Log in as the database owner created with the PSI installer.

2. Right-click the destination database and select New Query.

3. In the New Query window, execute the following SQL statement:


ALTER INDEX [<table name$UNIQUE>] on <table name> DISABLE
GO
Note:
Remember the table name and index that was disabled; this information will be
necessary later.

G Appendix G: Troubleshooting 49
4. Click Back in the SQL Server Import and Export Wizard.

5. When you have returned to the previous screen in the wizard, click Finish. This allows
the wizard to restart and begin the import again.

6. After the migration process has been completed, rebuild the index that has been
disabled:
ALTER INDEX [<table name$UNIQUE>] on <table name> REBUILD

50 Windchill® Oracle® to SQL ServerMigration Guide

You might also like