SlideShare a Scribd company logo
1 of 29
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Migration from SQL Server 2012 database to Oracle 12c
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Prepared By : Monowar Mukul (OCM 11g DBA)
Connect to the SQL instance using SQL Management Studio which has the database
from which we need to export tables.
If Database then click Database
Select database > Tasks > Back Up
We can go step by step to migrate from SQL Server to Oracle. I will
do testing by SQL Developer 4 next time.
In this testing I have used a source database
capture file sqlserver2005.ocp. Using SQL Developers
Offline Capture feature, the Microsoft SQL Server Northwind sample database has
been extracted into offline data files. The SQLServer2005.ocp file generated by the
Capture tool contains the database schema information for the Microsoft SQL Server
Northwind Traders database.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Open SQL Developer from my xwindows
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Start sqldeveloper from Oracle 12c database home.
Oracle@xxxxxxx:/usr/app/oracle/product/12.1.0.1/sqldeveloper$
./sqldeveloper.exe
Select View > Connections.
In the Connections tab, right-click Connections and select New
Connection.
Next screen pass the necessary values:
Expand the system_mondb1 connection.
Create a user for the migration repository
+++++++++++++++++++++++++++++++++++++++++++
Create USERS tablespace for both Pluggable databases
+++++++++++++++++++++++++++++++++++++++++++++++++++
SQL> alter session set container=TESTPDB1;
Session altered.
SQL> select tablespace_name from dba_tablespaces;
TABLESPACE_NAME
------------------------------
SYSTEM
SYSAUX
TEMP
TSTPD
TEMP_PDB1
TEST01
6 rows selected.
SQL> create tablespace users datafile
'/BPELAIT2/MONDB1/MONDB1/CDB1/testpdb/users01.dbf' size 100M;
Tablespace created.
SQL> alter session set container=TESTPDB2;
Session altered.
SQL> create tablespace users datafile
'/BPELAIT2/MONDB1/MONDB1/CDB2/MONDB1/users02.dbf' size 100M;
Tablespace created.
++++++++++++++++++++++++++++++++++++
Creating the Migration Repository
++++++++++++++++++++++++++++++++++++
To convert the Microsoft SQL Server database to Oracle, we need to
create a repository to store the required repository tables and
PL/SQL packages. To do this, perform the following steps:
Create a connection to the C##MIGREP user
Right-click the CMIGREP connection and select Migration Repository >
Associate Migration Repository.
Click OK.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Capturing the Microsoft SQL Server Exported Files
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
To load the captured Microsoft SQL Server database scripts into
Oracle SQL Developer, perform the following steps:
connection for the migration repository. Select the CMGREP
connection, and click Next.
Edit the connection to fix
Provide the Source Database details. Select the mode as Offline.
Click Choose to select the Offline Capture Source file.
Click Next.
The Target Database details. Select
mode Offline. click Next.
Provides details about the Data Move. Note down the location of the
Data Move Script Directory, and click Next.
Provides you the summary of the entire Project. Note down the details
and you can always click Back to make modifications. Finally, click
Finish.
The Data Migration happens successfully.
Click Ok.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Executing the Script to Create the Oracle Database Objects
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
To generate the SQL script with DDL statements that will be executed
to create the objects in an Oracle Database, perform the following
steps:
The SQL from the script is shown. Select system_mondb1 from the drop-
down on the right.
Click Run Script (F5).
Save script output
Output:
Creating User C##Emulation ...
user C##EMULATION dropped.
user C##EMULATION created.
GRANT succeeded.
Creating User C##dbo_Northwind ...
user C##DBO_NORTHWIND dropped.
user C##DBO_NORTHWIND created.
GRANT succeeded.
Connected
PACKAGE UTILS compiled
PACKAGE BODY UTILS compiled
public synonym UTILS created.
grant succeeded.
Connected
Creating Sequence Orders_OrderID_SEQ ...
sequence ORDERS_ORDERID_SEQ created.
Creating Sequence Products_ProductID_SEQ ...
sequence PRODUCTS_PRODUCTID_SEQ created.
Creating Sequence Employees_EmployeeID_SEQ ...
sequence EMPLOYEES_EMPLOYEEID_SEQ created.
Creating Sequence Categories_CategoryID_SEQ ...
sequence CATEGORIES_CATEGORYID_SEQ created.
Creating Sequence Shippers_ShipperID_SEQ ...
sequence SHIPPERS_SHIPPERID_SEQ created.
Creating Sequence Suppliers_SupplierID_SEQ ...
sequence SUPPLIERS_SUPPLIERID_SEQ created.
PROCEDURE CLOBTOBLOB_SQLDEVELOPER compiled
Creating Table Orders ...
table ORDERS created.
Creating Primary Key Constraint PK_Orders on table Orders ...
table ORDERS altered.
Creating Index CUSTOMERSORDERS_1 on Orders ...
index CUSTOMERSORDERS_1 created.
Creating Index EMPLOYEESORDERS_1 on Orders ...
index EMPLOYEESORDERS_1 created.
Creating Index OrderDate on Orders ...
index ORDERDATE created.
Creating Index ShippedDate on Orders ...
index SHIPPEDDATE created.
Creating Index ShippersOrders on Orders ...
index SHIPPERSORDERS created.
Creating Index ShipPostalCode on Orders ...
index SHIPPOSTALCODE created.
Creating Table Products ...
table PRODUCTS created.
Creating Primary Key Constraint PK_Products on table Products ...
table PRODUCTS altered.
Creating Check Constraint CK_Products_UnitPrice on table Products...
table PRODUCTS altered.
Creating Check Constraint CK_ReorderLevel on table Products...
table PRODUCTS altered.
Creating Check Constraint CK_UnitsInStock on table Products...
table PRODUCTS altered.
Creating Check Constraint CK_UnitsOnOrder on table Products...
table PRODUCTS altered.
Creating Index CATEGORYID_1 on Products ...
index CATEGORYID_1 created.
Creating Index ProductName on Products ...
index PRODUCTNAME created.
OMMENT on table order_details 'ORIGINAL NAME:ORDER DETAILS' succeeded.
Creating Primary Key Constraint PK_Order_Details on table Order_Details ...
table ORDER_DETAILS altered.
Creating Check Constraint CK_Discount on table Order_Details...
table ORDER_DETAILS altered.
Creating Check Constraint CK_Quantity on table Order_Details...
table ORDER_DETAILS altered.
Creating Check Constraint CK_UnitPrice on table Order_Details...
table ORDER_DETAILS altered.
Creating Index ORDERSORDER_DETAILS_1 on Order_Details ...
index ORDERSORDER_DETAILS_1 created.
Creating Index PRODUCTSORDER_DETAILS_1 on Order_Details ...
index PRODUCTSORDER_DETAILS_1 created.
Creating Table CustomerCustomerDemo ...
table CUSTOMERCUSTOMERDEMO created.
Creating Primary Key Constraint PK_CustomerCustomerDemo on table CustomerCustomerDemo
...
table CUSTOMERCUSTOMERDEMO altered.
Creating Table CustomerDemographics ...
table CUSTOMERDEMOGRAPHICS created.
Creating Primary Key Constraint PK_CustomerDemographics on table CustomerDemographics
...
table CUSTOMERDEMOGRAPHICS altered.
Creating Table Region ...
table REGION created.
Creating Primary Key Constraint PK_Region on table Region ...
table REGION altered.
Creating Table Territories ...
table TERRITORIES created.
Creating Primary Key Constraint PK_Territories on table Territories ...
table TERRITORIES altered.
Creating Table EmployeeTerritories ...
table EMPLOYEETERRITORIES created.
Creating Primary Key Constraint PK_EmployeeTerritories on table EmployeeTerritories
...
table EMPLOYEETERRITORIES altered.
Creating Table Employees ...
table EMPLOYEES created.
Creating Primary Key Constraint PK_Employees on table Employees ...
table EMPLOYEES altered.
Creating Index LastName on Employees ...
index LASTNAME created.
Creating Index PostalCode_2 on Employees ...
index POSTALCODE_2 created.
Creating Table Categories ...
table CATEGORIES created.
Creating Primary Key Constraint PK_Categories on table Categories ...
table CATEGORIES altered.
Creating Index CategoryName on Categories ...
index CATEGORYNAME created.
Creating Table Customers ...
:
:
:
Creating Foreign Key Constraint FK_Orders_Customers on table Customers...
table ORDERS altered.
Creating Foreign Key Constraint FK_Orders_Employees on table Employees...
table ORDERS altered.
Creating Foreign Key Constraint FK_Orders_Shippers on table Shippers...
table ORDERS altered.
Creating Foreign Key Constraint FK_Products_Categories on table Categories...
table PRODUCTS altered.
Creating Foreign Key Constraint FK_Products_Suppliers on table Suppliers...
table PRODUCTS altered.
Creating Foreign Key Constraint FK_Order_Details_Orders on table Orders...
table ORDER_DETAILS altered.
Creating Foreign Key Constraint FK_Order_Details_Products on table Products...
table ORDER_DETAILS altered.
Creating Foreign Key Constraint FK_CustomerCustomerDemo on table
CustomerDemographics...
table CUSTOMERCUSTOMERDEMO altered.
Creating Foreign Key Constraint FK_CustomerCustomerDemo_Custom on table Customers...
table CUSTOMERCUSTOMERDEMO altered.
Creating Foreign Key Constraint FK_Territories_Region on table Region...
table TERRITORIES altered.
Creating Foreign Key Constraint FK_EmployeeTerritories_Employe on table Employees...
table EMPLOYEETERRITORIES altered.
Creating Foreign Key Constraint FK_EmployeeTerritories_Territo on table Territories...
table EMPLOYEETERRITORIES altered.
Creating Foreign Key Constraint FK_Employees_Employees on table Employees...
table EMPLOYEES altered.
TRIGGER ORDERS_ORDERID_TRG compiled
TRIGGER PRODUCTS_PRODUCTID_TRG compiled
TRIGGER EMPLOYEES_EMPLOYEEID_TRG compiled
TRIGGER CATEGORIES_CATEGORYID_TRG compiled
TRIGGER SHIPPERS_SHIPPERID_TRG compiled
TRIGGER SUPPLIERS_SUPPLIERID_TRG compiled
view CUSTOMER_AND_SUPPLIERS_BY_CITY altered.
view ALPHABETICAL_LIST_OF_PRODUCTS altered.
:
:.
view CATEGORY_SALES_FOR_1997 altered.
view SALES_BY_CATEGORY altered.
view SALES_TOTALS_BY_AMOUNT altered.
view SUMMARY_OF_SALES_BY_QUARTER altered.
view SUMMARY_OF_SALES_BY_YEAR altered.
Connection created by CONNECT script command disconnected
Now scripts have run successfully, we can create a connection for the
C##dbo_Northwind user. Right-click Connection and select New
Connection.
Test and save:
Expand the dbo_Northwind_migrated_MONDB1 connection.
The database tables that were converted to Oracle are listed. Select
the CUSTOMERS table.
Select the Data tab. Notice that currently there is no data in the
table.
+++++++++++++++++++++++++++++++++++++++++++++
Checking Offline Data Move Preferences
+++++++++++++++++++++++++++++++++++++++++++++
A date format mask can be specified in the preferences so that the
Offline Data Move scripts (in particular, the Oracle SQL*Loader
control files) can reference the correct format. To do so, perform
the following steps:
Select Tool > Preferences then Expand Migration and select Data Move
Options.
Make sure the Date Mask format matches the following (for loader
format)
Mon dd yyyy HH:mi:ssAM
and the Timestamp Mask matches the following.
Mon dd yyyy HH:mi:ss:ff3AM
++++++++++++++++++++++++++++++++
Analysis and Estimation
++++++++++++++++++++++++++++++
SQL> @pre_load.sql
Table altered.
Table altered.
:
:
Table altered.
Table altered.
Table altered.
Table altered.
:
:
Trigger altered.
Table altered.
Table altered.
SQL> exit
SQL> alter user C##DBO_NORTHWIND default tablespace USERS;
User altered.
SQL> alter user C##DBO_NORTHWIND quota unlimited on users;
User altered.
Loading Data with SQL loader
+++++++++++++++++++++++++++++++
Oracle@xxxxxxx:/home/oracle/monowar/SQL2ODBU/Data$ sqlldr
C##dbo_Northwind/Password@mondb1
control=Oracle/c##dbo_Northwind.Customers.ctl log=
C##dbo_Northwind.Customers.log
Oracle@xxxxxxx:/home/oracle/monowar/SQL2ODBU/Data$ sqlldr
C##dbo_Northwind/Password@mondb1
control=Oracle/c##dbo_Northwind.Customers.ctl log= C##dbo_Northwi>
SQL*Loader: Release 12.1.0.1.0 - Production on Fri Oct 25 15:16:12
2013
Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights
reserved.
Path used: Conventional
Commit point reached - logical record count 64
Commit point reached - logical record count 91
Table C##DBO_NORTHWIND.CUSTOMERS:
91 Rows successfully loaded.
Check the log file:
C##dbo_Northwind.Customers.log
for more information about the load.
Switch to Oracle SQL Developer and Refresh the connection.
The data for the table has been loaded successfully.
SQL> @post_load.sql
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
Table altered.
Table altered.
:
:
:
Trigger altered.
Trigger altered.
SQL> exit
NOTE:
+++++++++++++++++++
pre_load.sql
+++++++++++++++++++
WHENEVER SQLERROR CONTINUE;
ALTER TABLE C##dbo_Northwind.Order_Details DISABLE CONSTRAINT
CK_UnitPrice;
ALTER TABLE C##dbo_Northwind.Order_Details DISABLE CONSTRAINT
CK_Discount;
ALTER TABLE C##dbo_Northwind.Order_Details DISABLE CONSTRAINT
CK_Quantity;
ALTER TABLE C##dbo_Northwind.Products DISABLE CONSTRAINT
CK_Products_UnitPrice;
ALTER TABLE C##dbo_Northwind.Products DISABLE CONSTRAINT
CK_ReorderLevel;
ALTER TABLE C##dbo_Northwind.Products DISABLE CONSTRAINT
CK_UnitsInStock;
ALTER TABLE C##dbo_Northwind.Products DISABLE CONSTRAINT
CK_UnitsOnOrder;
ALTER TABLE C##dbo_Northwind.Order_Details DISABLE CONSTRAINT
FK_Order_Details_Products;
ALTER TABLE C##dbo_Northwind.EmployeeTerritories DISABLE CONSTRAINT
FK_EmployeeTerritories_Territo;
ALTER TABLE C##dbo_Northwind.Orders DISABLE CONSTRAINT
FK_Orders_Shippers;
ALTER TABLE C##dbo_Northwind.EmployeeTerritories DISABLE CONSTRAINT
FK_EmployeeTerritories_Employe;
ALTER TABLE C##dbo_Northwind.Territories DISABLE CONSTRAINT
FK_Territories_Region;
ALTER TABLE C##dbo_Northwind.CustomerCustomerDemo DISABLE CONSTRAINT
FK_CustomerCustomerDemo_Custom;
ALTER TABLE C##dbo_Northwind.CustomerCustomerDemo DISABLE CONSTRAINT
FK_CustomerCustomerDemo;
ALTER TABLE C##dbo_Northwind.Order_Details DISABLE CONSTRAINT
FK_Order_Details_Orders;
ALTER TABLE C##dbo_Northwind.Products DISABLE CONSTRAINT
FK_Products_Suppliers;
ALTER TABLE C##dbo_Northwind.Products DISABLE CONSTRAINT
FK_Products_Categories;
ALTER TABLE C##dbo_Northwind.Orders DISABLE CONSTRAINT
FK_Orders_Employees;
ALTER TABLE C##dbo_Northwind.Orders DISABLE CONSTRAINT
FK_Orders_Customers;
ALTER TABLE C##dbo_Northwind.Employees DISABLE CONSTRAINT
FK_Employees_Employees;
ALTER TABLE C##dbo_Northwind.Customers DISABLE CONSTRAINT
PK_Customers;
ALTER TABLE C##dbo_Northwind.Shippers DISABLE CONSTRAINT PK_Shippers;
ALTER TABLE C##dbo_Northwind.Categories DISABLE CONSTRAINT
PK_Categories;
ALTER TABLE C##dbo_Northwind.Suppliers DISABLE CONSTRAINT
PK_Suppliers;
ALTER TABLE C##dbo_Northwind.Employees DISABLE CONSTRAINT
PK_Employees;
ALTER TABLE C##dbo_Northwind.EmployeeTerritories DISABLE CONSTRAINT
PK_EmployeeTerritories;
ALTER TABLE C##dbo_Northwind.Order_Details DISABLE CONSTRAINT
PK_Order_Details;
ALTER TABLE C##dbo_Northwind.Region DISABLE CONSTRAINT PK_Region;
ALTER TABLE C##dbo_Northwind.CustomerDemographics DISABLE CONSTRAINT
PK_CustomerDemographics;
ALTER TABLE C##dbo_Northwind.CustomerCustomerDemo DISABLE CONSTRAINT
PK_CustomerCustomerDemo;
ALTER TABLE C##dbo_Northwind.Orders DISABLE CONSTRAINT PK_Orders;
ALTER TABLE C##dbo_Northwind.Products DISABLE CONSTRAINT PK_Products;
ALTER TABLE C##dbo_Northwind.Territories DISABLE CONSTRAINT
PK_Territories;
ALTER TRIGGER C##dbo_Northwind.CK_Birthdate_SYSDTRG DISABLE;
ALTER TRIGGER C##dbo_Northwind.Products_ProductID_TRG DISABLE;
ALTER TRIGGER C##dbo_Northwind.Employees_EmployeeID_TRG DISABLE;
ALTER TRIGGER C##dbo_Northwind.Orders_OrderID_TRG DISABLE;
ALTER TRIGGER C##dbo_Northwind.Categories_CategoryID_TRG DISABLE;
ALTER TRIGGER C##dbo_Northwind.Shippers_ShipperID_TRG DISABLE;
ALTER TRIGGER C##dbo_Northwind.Suppliers_SupplierID_TRG DISABLE;
ALTER TABLE C##dbo_Northwind.Categories add (SQLDEVELOPER_CLOB_4
CLOB);
ALTER TABLE C##dbo_Northwind.Employees add (SQLDEVELOPER_CLOB_15
CLOB);
+++++++++++++++++++++++++++++++++
c##dbo_Northwind.Customers.ctl
+++++++++++++++++++++++++++++++++
load data
infile '[Northwind].[dbo].[Customers].dat' "str '<EORD>'"
into table C##dbo_Northwind.Customers
fields terminated by '<EOFD>'
trailing nullcols
(
CustomerID "DECODE(:CustomerID, CHR(00), ' ', :CustomerID)",
CompanyName "DECODE(:CompanyName, CHR(00), ' ', :CompanyName)",
ContactName "DECODE(:ContactName, CHR(00), ' ', :ContactName)",
ContactTitle "DECODE(:ContactTitle, CHR(00), ' ', :ContactTitle)",
Address "DECODE(:Address, CHR(00), ' ', :Address)",
City "DECODE(:City, CHR(00), ' ', :City)",
Region "DECODE(:Region, CHR(00), ' ', :Region)",
PostalCode "DECODE(:PostalCode, CHR(00), ' ', :PostalCode)",
Country "DECODE(:Country, CHR(00), ' ', :Country)",
Phone "DECODE(:Phone, CHR(00), ' ', :Phone)",
Fax "DECODE(:Fax, CHR(00), ' ', :Fax)"
)
++++++++++++++++++
post_load.sql
++++++++++++++++++
BEGIN C##dbo_Northwind.CLOBTOBLOB_sqldeveloper('Categories',
'SQLDEVELOPER_CLOB_4', 'Picture'); END;
/
BEGIN C##dbo_Northwind.CLOBTOBLOB_sqldeveloper('Employees',
'SQLDEVELOPER_CLOB_15', 'Photo'); END;
/
WHENEVER SQLERROR CONTINUE;
ALTER TABLE C##dbo_Northwind.Territories ENABLE CONSTRAINT
PK_Territories;
ALTER TABLE C##dbo_Northwind.Products ENABLE CONSTRAINT PK_Products;
ALTER TABLE C##dbo_Northwind.Orders ENABLE CONSTRAINT PK_Orders;
ALTER TABLE C##dbo_Northwind.CustomerCustomerDemo ENABLE CONSTRAINT
PK_CustomerCustomerDemo;
ALTER TABLE C##dbo_Northwind.CustomerDemographics ENABLE CONSTRAINT
PK_CustomerDemographics;
ALTER TABLE C##dbo_Northwind.Region ENABLE CONSTRAINT PK_Region;
ALTER TABLE C##dbo_Northwind.Order_Details ENABLE CONSTRAINT
PK_Order_Details;
ALTER TABLE C##dbo_Northwind.EmployeeTerritories ENABLE CONSTRAINT
PK_EmployeeTerritories;
ALTER TABLE C##dbo_Northwind.Employees ENABLE CONSTRAINT
PK_Employees;
ALTER TABLE C##dbo_Northwind.Suppliers ENABLE CONSTRAINT
PK_Suppliers;
ALTER TABLE C##dbo_Northwind.Categories ENABLE CONSTRAINT
PK_Categories;
ALTER TABLE C##dbo_Northwind.Shippers ENABLE CONSTRAINT PK_Shippers;
ALTER TABLE C##dbo_Northwind.Customers ENABLE CONSTRAINT
PK_Customers;
ALTER TABLE C##dbo_Northwind.Employees ENABLE CONSTRAINT
FK_Employees_Employees;
ALTER TABLE C##dbo_Northwind.Orders ENABLE CONSTRAINT
FK_Orders_Customers;
ALTER TABLE C##dbo_Northwind.Orders ENABLE CONSTRAINT
FK_Orders_Employees;
ALTER TABLE C##dbo_Northwind.Products ENABLE CONSTRAINT
FK_Products_Categories;
ALTER TABLE C##dbo_Northwind.Products ENABLE CONSTRAINT
FK_Products_Suppliers;
ALTER TABLE C##dbo_Northwind.Order_Details ENABLE CONSTRAINT
FK_Order_Details_Orders;
ALTER TABLE C##dbo_Northwind.CustomerCustomerDemo ENABLE CONSTRAINT
FK_CustomerCustomerDemo;
ALTER TABLE C##dbo_Northwind.CustomerCustomerDemo ENABLE CONSTRAINT
FK_CustomerCustomerDemo_Custom;
ALTER TABLE C##dbo_Northwind.Territories ENABLE CONSTRAINT
FK_Territories_Region;
ALTER TABLE C##dbo_Northwind.EmployeeTerritories ENABLE CONSTRAINT
FK_EmployeeTerritories_Employe;
ALTER TABLE C##dbo_Northwind.Orders ENABLE CONSTRAINT
FK_Orders_Shippers;
ALTER TABLE C##dbo_Northwind.EmployeeTerritories ENABLE CONSTRAINT
FK_EmployeeTerritories_Territo;
ALTER TABLE C##dbo_Northwind.Order_Details ENABLE CONSTRAINT
FK_Order_Details_Products;
ALTER TABLE C##dbo_Northwind.Products ENABLE CONSTRAINT
CK_UnitsOnOrder;
ALTER TABLE C##dbo_Northwind.Products ENABLE CONSTRAINT
CK_UnitsInStock;
ALTER TABLE C##dbo_Northwind.Products ENABLE CONSTRAINT
CK_ReorderLevel;
ALTER TABLE C##dbo_Northwind.Products ENABLE CONSTRAINT
CK_Products_UnitPrice;
ALTER TABLE C##dbo_Northwind.Order_Details ENABLE CONSTRAINT
CK_Quantity;
ALTER TABLE C##dbo_Northwind.Order_Details ENABLE CONSTRAINT
CK_Discount;
ALTER TABLE C##dbo_Northwind.Order_Details ENABLE CONSTRAINT
CK_UnitPrice;
ALTER TRIGGER C##dbo_Northwind.Orders_OrderID_TRG ENABLE;
ALTER TRIGGER C##dbo_Northwind.Products_ProductID_TRG ENABLE;
ALTER TRIGGER C##dbo_Northwind.Suppliers_SupplierID_TRG ENABLE;
ALTER TRIGGER C##dbo_Northwind.Shippers_ShipperID_TRG ENABLE;
ALTER TRIGGER C##dbo_Northwind.CK_Birthdate_SYSDTRG ENABLE;
ALTER TRIGGER C##dbo_Northwind.Categories_CategoryID_TRG ENABLE;
ALTER TRIGGER C##dbo_Northwind.Employees_EmployeeID_TRG ENABLE;
~

More Related Content

Viewers also liked

Exadata - Smart Scan Testing
Exadata - Smart Scan TestingExadata - Smart Scan Testing
Exadata - Smart Scan Testing
Monowar Mukul
 
Edtc6341 63 esther_sauceda_practice_test5
Edtc6341 63 esther_sauceda_practice_test5Edtc6341 63 esther_sauceda_practice_test5
Edtc6341 63 esther_sauceda_practice_test5
esauceda12
 
Advanced installation 12c rac
Advanced installation 12c racAdvanced installation 12c rac
Advanced installation 12c rac
Monowar Mukul
 
Oracle 12c far sync standby instance
Oracle 12c far sync standby instanceOracle 12c far sync standby instance
Oracle 12c far sync standby instance
Monowar Mukul
 
Oracle 12c RAC (Advanced installation - Flex ASM)
Oracle 12c RAC (Advanced installation - Flex ASM)Oracle 12c RAC (Advanced installation - Flex ASM)
Oracle 12c RAC (Advanced installation - Flex ASM)
Monowar Mukul
 
Copyright Crash Course 1st revised ppt 6340.64 Sonia Aldape
Copyright Crash Course 1st revised ppt 6340.64 Sonia AldapeCopyright Crash Course 1st revised ppt 6340.64 Sonia Aldape
Copyright Crash Course 1st revised ppt 6340.64 Sonia Aldape
soniaaldape
 
Oracle Certified Master 11g database administration preparation
Oracle Certified Master 11g database administration preparationOracle Certified Master 11g database administration preparation
Oracle Certified Master 11g database administration preparation
Monowar Mukul
 

Viewers also liked (20)

TimesTen in memory database Creation
TimesTen in memory database Creation TimesTen in memory database Creation
TimesTen in memory database Creation
 
Exadata Cell metrics
Exadata Cell metricsExadata Cell metrics
Exadata Cell metrics
 
1247g3hg1238 2011
1247g3hg1238 20111247g3hg1238 2011
1247g3hg1238 2011
 
Exadata - Smart Scan Testing
Exadata - Smart Scan TestingExadata - Smart Scan Testing
Exadata - Smart Scan Testing
 
Edtc6341 63 esther_sauceda_practice_test5
Edtc6341 63 esther_sauceda_practice_test5Edtc6341 63 esther_sauceda_practice_test5
Edtc6341 63 esther_sauceda_practice_test5
 
Upgrade database using cloud_control Provisioning
Upgrade database using cloud_control Provisioning Upgrade database using cloud_control Provisioning
Upgrade database using cloud_control Provisioning
 
Exadata - BULK DATA LOAD Testing on Database Machine
Exadata - BULK DATA LOAD Testing on Database Machine Exadata - BULK DATA LOAD Testing on Database Machine
Exadata - BULK DATA LOAD Testing on Database Machine
 
Moving 12c database from NON-ASM to ASM
Moving 12c database from NON-ASM to ASMMoving 12c database from NON-ASM to ASM
Moving 12c database from NON-ASM to ASM
 
SOA Fusion Middleware installation
SOA Fusion Middleware installationSOA Fusion Middleware installation
SOA Fusion Middleware installation
 
Advanced installation 12c rac
Advanced installation 12c racAdvanced installation 12c rac
Advanced installation 12c rac
 
Exadata I/O Resource Manager (Exadata IORM)
Exadata I/O Resource Manager (Exadata IORM)Exadata I/O Resource Manager (Exadata IORM)
Exadata I/O Resource Manager (Exadata IORM)
 
12c database migration from ASM storage to NON-ASM storage
12c database migration from ASM storage to NON-ASM storage12c database migration from ASM storage to NON-ASM storage
12c database migration from ASM storage to NON-ASM storage
 
Oracle 12c far sync standby instance
Oracle 12c far sync standby instanceOracle 12c far sync standby instance
Oracle 12c far sync standby instance
 
Oracle 12c RAC (Advanced installation - Flex ASM)
Oracle 12c RAC (Advanced installation - Flex ASM)Oracle 12c RAC (Advanced installation - Flex ASM)
Oracle 12c RAC (Advanced installation - Flex ASM)
 
Copyright Crash Course 1st revised ppt 6340.64 Sonia Aldape
Copyright Crash Course 1st revised ppt 6340.64 Sonia AldapeCopyright Crash Course 1st revised ppt 6340.64 Sonia Aldape
Copyright Crash Course 1st revised ppt 6340.64 Sonia Aldape
 
GMO OILBOOSTER Proposal (Eng)
GMO OILBOOSTER Proposal (Eng)GMO OILBOOSTER Proposal (Eng)
GMO OILBOOSTER Proposal (Eng)
 
Oracle Certified Master 11g database administration preparation
Oracle Certified Master 11g database administration preparationOracle Certified Master 11g database administration preparation
Oracle Certified Master 11g database administration preparation
 
SMS notification setup using EM12c
SMS notification setup using EM12cSMS notification setup using EM12c
SMS notification setup using EM12c
 
TESTING - Drop 12c RAC Database, Database Software and GI
TESTING - Drop 12c RAC Database, Database Software and GITESTING - Drop 12c RAC Database, Database Software and GI
TESTING - Drop 12c RAC Database, Database Software and GI
 
Testing Orachk for Database Health Monitoring
Testing Orachk for Database Health MonitoringTesting Orachk for Database Health Monitoring
Testing Orachk for Database Health Monitoring
 

Similar to Migration Database from SQL SERVER 2012 to Oracle12c with Pluggable Database

Avoiding cursors with sql server 2005 tech republic
Avoiding cursors with sql server 2005   tech republicAvoiding cursors with sql server 2005   tech republic
Avoiding cursors with sql server 2005 tech republic
Kaing Menglieng
 

Similar to Migration Database from SQL SERVER 2012 to Oracle12c with Pluggable Database (20)

Rails Database Migration, Season 2
Rails Database Migration, Season 2Rails Database Migration, Season 2
Rails Database Migration, Season 2
 
Advanced integration services on microsoft ssis 1
Advanced integration services on microsoft ssis 1Advanced integration services on microsoft ssis 1
Advanced integration services on microsoft ssis 1
 
Managing Oracle Streams Using Enterprise Manager Grid Control
Managing Oracle Streams Using Enterprise Manager Grid ControlManaging Oracle Streams Using Enterprise Manager Grid Control
Managing Oracle Streams Using Enterprise Manager Grid Control
 
Linq to sql
Linq to sqlLinq to sql
Linq to sql
 
Apache Calcite Tutorial - BOSS 21
Apache Calcite Tutorial - BOSS 21Apache Calcite Tutorial - BOSS 21
Apache Calcite Tutorial - BOSS 21
 
Incremental View Maintenance with Coral, DBT, and Iceberg
Incremental View Maintenance with Coral, DBT, and IcebergIncremental View Maintenance with Coral, DBT, and Iceberg
Incremental View Maintenance with Coral, DBT, and Iceberg
 
Introduction to SQL Antipatterns
Introduction to SQL AntipatternsIntroduction to SQL Antipatterns
Introduction to SQL Antipatterns
 
Born_ruby_on_rails
Born_ruby_on_railsBorn_ruby_on_rails
Born_ruby_on_rails
 
Born_ruby_on_rails
Born_ruby_on_railsBorn_ruby_on_rails
Born_ruby_on_rails
 
SQL200.3 Module 3
SQL200.3 Module 3SQL200.3 Module 3
SQL200.3 Module 3
 
Meg bernal insight2014 4219
Meg bernal insight2014 4219Meg bernal insight2014 4219
Meg bernal insight2014 4219
 
Change tracking
Change trackingChange tracking
Change tracking
 
BI Tutorial (Copying Data from Oracle to Microsoft SQLServer)
BI Tutorial (Copying Data from Oracle to Microsoft SQLServer)BI Tutorial (Copying Data from Oracle to Microsoft SQLServer)
BI Tutorial (Copying Data from Oracle to Microsoft SQLServer)
 
javazone 2014
javazone 2014javazone 2014
javazone 2014
 
dbadapters
dbadaptersdbadapters
dbadapters
 
Avoiding cursors with sql server 2005 tech republic
Avoiding cursors with sql server 2005   tech republicAvoiding cursors with sql server 2005   tech republic
Avoiding cursors with sql server 2005 tech republic
 
Geek Sync | Rewriting Bad SQL Code 101
Geek Sync | Rewriting Bad SQL Code 101Geek Sync | Rewriting Bad SQL Code 101
Geek Sync | Rewriting Bad SQL Code 101
 
Introduction to Oracle Database.pptx
Introduction to Oracle Database.pptxIntroduction to Oracle Database.pptx
Introduction to Oracle Database.pptx
 
Oracle Database 12c - New Features for Developers and DBAs
Oracle Database 12c - New Features for Developers and DBAsOracle Database 12c - New Features for Developers and DBAs
Oracle Database 12c - New Features for Developers and DBAs
 
Oracle Database 12c - New Features for Developers and DBAs
Oracle Database 12c  - New Features for Developers and DBAsOracle Database 12c  - New Features for Developers and DBAs
Oracle Database 12c - New Features for Developers and DBAs
 

Recently uploaded

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Recently uploaded (20)

Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 

Migration Database from SQL SERVER 2012 to Oracle12c with Pluggable Database

  • 1. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Migration from SQL Server 2012 database to Oracle 12c +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Prepared By : Monowar Mukul (OCM 11g DBA) Connect to the SQL instance using SQL Management Studio which has the database from which we need to export tables. If Database then click Database Select database > Tasks > Back Up
  • 2.
  • 3.
  • 4. We can go step by step to migrate from SQL Server to Oracle. I will do testing by SQL Developer 4 next time. In this testing I have used a source database capture file sqlserver2005.ocp. Using SQL Developers Offline Capture feature, the Microsoft SQL Server Northwind sample database has been extracted into offline data files. The SQLServer2005.ocp file generated by the Capture tool contains the database schema information for the Microsoft SQL Server Northwind Traders database. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Open SQL Developer from my xwindows ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Start sqldeveloper from Oracle 12c database home. Oracle@xxxxxxx:/usr/app/oracle/product/12.1.0.1/sqldeveloper$ ./sqldeveloper.exe
  • 5. Select View > Connections. In the Connections tab, right-click Connections and select New Connection.
  • 6. Next screen pass the necessary values: Expand the system_mondb1 connection.
  • 7. Create a user for the migration repository +++++++++++++++++++++++++++++++++++++++++++ Create USERS tablespace for both Pluggable databases +++++++++++++++++++++++++++++++++++++++++++++++++++
  • 8. SQL> alter session set container=TESTPDB1; Session altered. SQL> select tablespace_name from dba_tablespaces; TABLESPACE_NAME ------------------------------ SYSTEM SYSAUX TEMP TSTPD TEMP_PDB1 TEST01 6 rows selected. SQL> create tablespace users datafile '/BPELAIT2/MONDB1/MONDB1/CDB1/testpdb/users01.dbf' size 100M; Tablespace created. SQL> alter session set container=TESTPDB2; Session altered. SQL> create tablespace users datafile '/BPELAIT2/MONDB1/MONDB1/CDB2/MONDB1/users02.dbf' size 100M; Tablespace created.
  • 9. ++++++++++++++++++++++++++++++++++++ Creating the Migration Repository ++++++++++++++++++++++++++++++++++++ To convert the Microsoft SQL Server database to Oracle, we need to create a repository to store the required repository tables and PL/SQL packages. To do this, perform the following steps: Create a connection to the C##MIGREP user Right-click the CMIGREP connection and select Migration Repository > Associate Migration Repository.
  • 10. Click OK. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Capturing the Microsoft SQL Server Exported Files ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ To load the captured Microsoft SQL Server database scripts into Oracle SQL Developer, perform the following steps:
  • 11.
  • 12. connection for the migration repository. Select the CMGREP connection, and click Next. Edit the connection to fix
  • 13. Provide the Source Database details. Select the mode as Offline. Click Choose to select the Offline Capture Source file.
  • 15. The Target Database details. Select mode Offline. click Next.
  • 16. Provides details about the Data Move. Note down the location of the Data Move Script Directory, and click Next. Provides you the summary of the entire Project. Note down the details and you can always click Back to make modifications. Finally, click Finish.
  • 17. The Data Migration happens successfully. Click Ok.
  • 18. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Executing the Script to Create the Oracle Database Objects +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ To generate the SQL script with DDL statements that will be executed to create the objects in an Oracle Database, perform the following steps: The SQL from the script is shown. Select system_mondb1 from the drop- down on the right. Click Run Script (F5).
  • 19. Save script output Output: Creating User C##Emulation ... user C##EMULATION dropped. user C##EMULATION created. GRANT succeeded. Creating User C##dbo_Northwind ... user C##DBO_NORTHWIND dropped. user C##DBO_NORTHWIND created. GRANT succeeded. Connected PACKAGE UTILS compiled PACKAGE BODY UTILS compiled public synonym UTILS created. grant succeeded. Connected Creating Sequence Orders_OrderID_SEQ ... sequence ORDERS_ORDERID_SEQ created. Creating Sequence Products_ProductID_SEQ ... sequence PRODUCTS_PRODUCTID_SEQ created. Creating Sequence Employees_EmployeeID_SEQ ... sequence EMPLOYEES_EMPLOYEEID_SEQ created. Creating Sequence Categories_CategoryID_SEQ ... sequence CATEGORIES_CATEGORYID_SEQ created. Creating Sequence Shippers_ShipperID_SEQ ... sequence SHIPPERS_SHIPPERID_SEQ created. Creating Sequence Suppliers_SupplierID_SEQ ... sequence SUPPLIERS_SUPPLIERID_SEQ created. PROCEDURE CLOBTOBLOB_SQLDEVELOPER compiled Creating Table Orders ... table ORDERS created. Creating Primary Key Constraint PK_Orders on table Orders ... table ORDERS altered. Creating Index CUSTOMERSORDERS_1 on Orders ... index CUSTOMERSORDERS_1 created. Creating Index EMPLOYEESORDERS_1 on Orders ... index EMPLOYEESORDERS_1 created. Creating Index OrderDate on Orders ... index ORDERDATE created. Creating Index ShippedDate on Orders ... index SHIPPEDDATE created.
  • 20. Creating Index ShippersOrders on Orders ... index SHIPPERSORDERS created. Creating Index ShipPostalCode on Orders ... index SHIPPOSTALCODE created. Creating Table Products ... table PRODUCTS created. Creating Primary Key Constraint PK_Products on table Products ... table PRODUCTS altered. Creating Check Constraint CK_Products_UnitPrice on table Products... table PRODUCTS altered. Creating Check Constraint CK_ReorderLevel on table Products... table PRODUCTS altered. Creating Check Constraint CK_UnitsInStock on table Products... table PRODUCTS altered. Creating Check Constraint CK_UnitsOnOrder on table Products... table PRODUCTS altered. Creating Index CATEGORYID_1 on Products ... index CATEGORYID_1 created. Creating Index ProductName on Products ... index PRODUCTNAME created. OMMENT on table order_details 'ORIGINAL NAME:ORDER DETAILS' succeeded. Creating Primary Key Constraint PK_Order_Details on table Order_Details ... table ORDER_DETAILS altered. Creating Check Constraint CK_Discount on table Order_Details... table ORDER_DETAILS altered. Creating Check Constraint CK_Quantity on table Order_Details... table ORDER_DETAILS altered. Creating Check Constraint CK_UnitPrice on table Order_Details... table ORDER_DETAILS altered. Creating Index ORDERSORDER_DETAILS_1 on Order_Details ... index ORDERSORDER_DETAILS_1 created. Creating Index PRODUCTSORDER_DETAILS_1 on Order_Details ... index PRODUCTSORDER_DETAILS_1 created. Creating Table CustomerCustomerDemo ... table CUSTOMERCUSTOMERDEMO created. Creating Primary Key Constraint PK_CustomerCustomerDemo on table CustomerCustomerDemo ... table CUSTOMERCUSTOMERDEMO altered. Creating Table CustomerDemographics ... table CUSTOMERDEMOGRAPHICS created. Creating Primary Key Constraint PK_CustomerDemographics on table CustomerDemographics ... table CUSTOMERDEMOGRAPHICS altered. Creating Table Region ... table REGION created. Creating Primary Key Constraint PK_Region on table Region ... table REGION altered. Creating Table Territories ... table TERRITORIES created. Creating Primary Key Constraint PK_Territories on table Territories ... table TERRITORIES altered. Creating Table EmployeeTerritories ... table EMPLOYEETERRITORIES created. Creating Primary Key Constraint PK_EmployeeTerritories on table EmployeeTerritories ... table EMPLOYEETERRITORIES altered. Creating Table Employees ... table EMPLOYEES created. Creating Primary Key Constraint PK_Employees on table Employees ... table EMPLOYEES altered. Creating Index LastName on Employees ... index LASTNAME created. Creating Index PostalCode_2 on Employees ... index POSTALCODE_2 created. Creating Table Categories ... table CATEGORIES created. Creating Primary Key Constraint PK_Categories on table Categories ... table CATEGORIES altered. Creating Index CategoryName on Categories ... index CATEGORYNAME created. Creating Table Customers ... : : : Creating Foreign Key Constraint FK_Orders_Customers on table Customers... table ORDERS altered. Creating Foreign Key Constraint FK_Orders_Employees on table Employees...
  • 21. table ORDERS altered. Creating Foreign Key Constraint FK_Orders_Shippers on table Shippers... table ORDERS altered. Creating Foreign Key Constraint FK_Products_Categories on table Categories... table PRODUCTS altered. Creating Foreign Key Constraint FK_Products_Suppliers on table Suppliers... table PRODUCTS altered. Creating Foreign Key Constraint FK_Order_Details_Orders on table Orders... table ORDER_DETAILS altered. Creating Foreign Key Constraint FK_Order_Details_Products on table Products... table ORDER_DETAILS altered. Creating Foreign Key Constraint FK_CustomerCustomerDemo on table CustomerDemographics... table CUSTOMERCUSTOMERDEMO altered. Creating Foreign Key Constraint FK_CustomerCustomerDemo_Custom on table Customers... table CUSTOMERCUSTOMERDEMO altered. Creating Foreign Key Constraint FK_Territories_Region on table Region... table TERRITORIES altered. Creating Foreign Key Constraint FK_EmployeeTerritories_Employe on table Employees... table EMPLOYEETERRITORIES altered. Creating Foreign Key Constraint FK_EmployeeTerritories_Territo on table Territories... table EMPLOYEETERRITORIES altered. Creating Foreign Key Constraint FK_Employees_Employees on table Employees... table EMPLOYEES altered. TRIGGER ORDERS_ORDERID_TRG compiled TRIGGER PRODUCTS_PRODUCTID_TRG compiled TRIGGER EMPLOYEES_EMPLOYEEID_TRG compiled TRIGGER CATEGORIES_CATEGORYID_TRG compiled TRIGGER SHIPPERS_SHIPPERID_TRG compiled TRIGGER SUPPLIERS_SUPPLIERID_TRG compiled view CUSTOMER_AND_SUPPLIERS_BY_CITY altered. view ALPHABETICAL_LIST_OF_PRODUCTS altered. : :. view CATEGORY_SALES_FOR_1997 altered. view SALES_BY_CATEGORY altered. view SALES_TOTALS_BY_AMOUNT altered. view SUMMARY_OF_SALES_BY_QUARTER altered. view SUMMARY_OF_SALES_BY_YEAR altered. Connection created by CONNECT script command disconnected Now scripts have run successfully, we can create a connection for the C##dbo_Northwind user. Right-click Connection and select New Connection. Test and save:
  • 22. Expand the dbo_Northwind_migrated_MONDB1 connection. The database tables that were converted to Oracle are listed. Select the CUSTOMERS table.
  • 23. Select the Data tab. Notice that currently there is no data in the table. +++++++++++++++++++++++++++++++++++++++++++++ Checking Offline Data Move Preferences +++++++++++++++++++++++++++++++++++++++++++++ A date format mask can be specified in the preferences so that the Offline Data Move scripts (in particular, the Oracle SQL*Loader control files) can reference the correct format. To do so, perform the following steps: Select Tool > Preferences then Expand Migration and select Data Move Options.
  • 24. Make sure the Date Mask format matches the following (for loader format) Mon dd yyyy HH:mi:ssAM and the Timestamp Mask matches the following. Mon dd yyyy HH:mi:ss:ff3AM ++++++++++++++++++++++++++++++++ Analysis and Estimation ++++++++++++++++++++++++++++++ SQL> @pre_load.sql Table altered. Table altered. : : Table altered. Table altered. Table altered. Table altered. : : Trigger altered. Table altered. Table altered. SQL> exit SQL> alter user C##DBO_NORTHWIND default tablespace USERS; User altered. SQL> alter user C##DBO_NORTHWIND quota unlimited on users; User altered.
  • 25. Loading Data with SQL loader +++++++++++++++++++++++++++++++ Oracle@xxxxxxx:/home/oracle/monowar/SQL2ODBU/Data$ sqlldr C##dbo_Northwind/Password@mondb1 control=Oracle/c##dbo_Northwind.Customers.ctl log= C##dbo_Northwind.Customers.log Oracle@xxxxxxx:/home/oracle/monowar/SQL2ODBU/Data$ sqlldr C##dbo_Northwind/Password@mondb1 control=Oracle/c##dbo_Northwind.Customers.ctl log= C##dbo_Northwi> SQL*Loader: Release 12.1.0.1.0 - Production on Fri Oct 25 15:16:12 2013 Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved. Path used: Conventional Commit point reached - logical record count 64 Commit point reached - logical record count 91 Table C##DBO_NORTHWIND.CUSTOMERS: 91 Rows successfully loaded. Check the log file: C##dbo_Northwind.Customers.log for more information about the load. Switch to Oracle SQL Developer and Refresh the connection. The data for the table has been loaded successfully. SQL> @post_load.sql PL/SQL procedure successfully completed. PL/SQL procedure successfully completed.
  • 26. Table altered. Table altered. : : : Trigger altered. Trigger altered. SQL> exit NOTE: +++++++++++++++++++ pre_load.sql +++++++++++++++++++ WHENEVER SQLERROR CONTINUE; ALTER TABLE C##dbo_Northwind.Order_Details DISABLE CONSTRAINT CK_UnitPrice; ALTER TABLE C##dbo_Northwind.Order_Details DISABLE CONSTRAINT CK_Discount; ALTER TABLE C##dbo_Northwind.Order_Details DISABLE CONSTRAINT CK_Quantity; ALTER TABLE C##dbo_Northwind.Products DISABLE CONSTRAINT CK_Products_UnitPrice; ALTER TABLE C##dbo_Northwind.Products DISABLE CONSTRAINT CK_ReorderLevel; ALTER TABLE C##dbo_Northwind.Products DISABLE CONSTRAINT CK_UnitsInStock; ALTER TABLE C##dbo_Northwind.Products DISABLE CONSTRAINT CK_UnitsOnOrder; ALTER TABLE C##dbo_Northwind.Order_Details DISABLE CONSTRAINT FK_Order_Details_Products; ALTER TABLE C##dbo_Northwind.EmployeeTerritories DISABLE CONSTRAINT FK_EmployeeTerritories_Territo; ALTER TABLE C##dbo_Northwind.Orders DISABLE CONSTRAINT FK_Orders_Shippers; ALTER TABLE C##dbo_Northwind.EmployeeTerritories DISABLE CONSTRAINT FK_EmployeeTerritories_Employe; ALTER TABLE C##dbo_Northwind.Territories DISABLE CONSTRAINT FK_Territories_Region; ALTER TABLE C##dbo_Northwind.CustomerCustomerDemo DISABLE CONSTRAINT FK_CustomerCustomerDemo_Custom; ALTER TABLE C##dbo_Northwind.CustomerCustomerDemo DISABLE CONSTRAINT FK_CustomerCustomerDemo; ALTER TABLE C##dbo_Northwind.Order_Details DISABLE CONSTRAINT FK_Order_Details_Orders; ALTER TABLE C##dbo_Northwind.Products DISABLE CONSTRAINT FK_Products_Suppliers; ALTER TABLE C##dbo_Northwind.Products DISABLE CONSTRAINT FK_Products_Categories; ALTER TABLE C##dbo_Northwind.Orders DISABLE CONSTRAINT FK_Orders_Employees; ALTER TABLE C##dbo_Northwind.Orders DISABLE CONSTRAINT FK_Orders_Customers; ALTER TABLE C##dbo_Northwind.Employees DISABLE CONSTRAINT FK_Employees_Employees; ALTER TABLE C##dbo_Northwind.Customers DISABLE CONSTRAINT PK_Customers; ALTER TABLE C##dbo_Northwind.Shippers DISABLE CONSTRAINT PK_Shippers; ALTER TABLE C##dbo_Northwind.Categories DISABLE CONSTRAINT PK_Categories;
  • 27. ALTER TABLE C##dbo_Northwind.Suppliers DISABLE CONSTRAINT PK_Suppliers; ALTER TABLE C##dbo_Northwind.Employees DISABLE CONSTRAINT PK_Employees; ALTER TABLE C##dbo_Northwind.EmployeeTerritories DISABLE CONSTRAINT PK_EmployeeTerritories; ALTER TABLE C##dbo_Northwind.Order_Details DISABLE CONSTRAINT PK_Order_Details; ALTER TABLE C##dbo_Northwind.Region DISABLE CONSTRAINT PK_Region; ALTER TABLE C##dbo_Northwind.CustomerDemographics DISABLE CONSTRAINT PK_CustomerDemographics; ALTER TABLE C##dbo_Northwind.CustomerCustomerDemo DISABLE CONSTRAINT PK_CustomerCustomerDemo; ALTER TABLE C##dbo_Northwind.Orders DISABLE CONSTRAINT PK_Orders; ALTER TABLE C##dbo_Northwind.Products DISABLE CONSTRAINT PK_Products; ALTER TABLE C##dbo_Northwind.Territories DISABLE CONSTRAINT PK_Territories; ALTER TRIGGER C##dbo_Northwind.CK_Birthdate_SYSDTRG DISABLE; ALTER TRIGGER C##dbo_Northwind.Products_ProductID_TRG DISABLE; ALTER TRIGGER C##dbo_Northwind.Employees_EmployeeID_TRG DISABLE; ALTER TRIGGER C##dbo_Northwind.Orders_OrderID_TRG DISABLE; ALTER TRIGGER C##dbo_Northwind.Categories_CategoryID_TRG DISABLE; ALTER TRIGGER C##dbo_Northwind.Shippers_ShipperID_TRG DISABLE; ALTER TRIGGER C##dbo_Northwind.Suppliers_SupplierID_TRG DISABLE; ALTER TABLE C##dbo_Northwind.Categories add (SQLDEVELOPER_CLOB_4 CLOB); ALTER TABLE C##dbo_Northwind.Employees add (SQLDEVELOPER_CLOB_15 CLOB); +++++++++++++++++++++++++++++++++ c##dbo_Northwind.Customers.ctl +++++++++++++++++++++++++++++++++ load data infile '[Northwind].[dbo].[Customers].dat' "str '<EORD>'" into table C##dbo_Northwind.Customers fields terminated by '<EOFD>' trailing nullcols ( CustomerID "DECODE(:CustomerID, CHR(00), ' ', :CustomerID)", CompanyName "DECODE(:CompanyName, CHR(00), ' ', :CompanyName)", ContactName "DECODE(:ContactName, CHR(00), ' ', :ContactName)", ContactTitle "DECODE(:ContactTitle, CHR(00), ' ', :ContactTitle)", Address "DECODE(:Address, CHR(00), ' ', :Address)", City "DECODE(:City, CHR(00), ' ', :City)", Region "DECODE(:Region, CHR(00), ' ', :Region)", PostalCode "DECODE(:PostalCode, CHR(00), ' ', :PostalCode)", Country "DECODE(:Country, CHR(00), ' ', :Country)", Phone "DECODE(:Phone, CHR(00), ' ', :Phone)", Fax "DECODE(:Fax, CHR(00), ' ', :Fax)" ) ++++++++++++++++++ post_load.sql ++++++++++++++++++ BEGIN C##dbo_Northwind.CLOBTOBLOB_sqldeveloper('Categories', 'SQLDEVELOPER_CLOB_4', 'Picture'); END; / BEGIN C##dbo_Northwind.CLOBTOBLOB_sqldeveloper('Employees', 'SQLDEVELOPER_CLOB_15', 'Photo'); END; /
  • 28. WHENEVER SQLERROR CONTINUE; ALTER TABLE C##dbo_Northwind.Territories ENABLE CONSTRAINT PK_Territories; ALTER TABLE C##dbo_Northwind.Products ENABLE CONSTRAINT PK_Products; ALTER TABLE C##dbo_Northwind.Orders ENABLE CONSTRAINT PK_Orders; ALTER TABLE C##dbo_Northwind.CustomerCustomerDemo ENABLE CONSTRAINT PK_CustomerCustomerDemo; ALTER TABLE C##dbo_Northwind.CustomerDemographics ENABLE CONSTRAINT PK_CustomerDemographics; ALTER TABLE C##dbo_Northwind.Region ENABLE CONSTRAINT PK_Region; ALTER TABLE C##dbo_Northwind.Order_Details ENABLE CONSTRAINT PK_Order_Details; ALTER TABLE C##dbo_Northwind.EmployeeTerritories ENABLE CONSTRAINT PK_EmployeeTerritories; ALTER TABLE C##dbo_Northwind.Employees ENABLE CONSTRAINT PK_Employees; ALTER TABLE C##dbo_Northwind.Suppliers ENABLE CONSTRAINT PK_Suppliers; ALTER TABLE C##dbo_Northwind.Categories ENABLE CONSTRAINT PK_Categories; ALTER TABLE C##dbo_Northwind.Shippers ENABLE CONSTRAINT PK_Shippers; ALTER TABLE C##dbo_Northwind.Customers ENABLE CONSTRAINT PK_Customers; ALTER TABLE C##dbo_Northwind.Employees ENABLE CONSTRAINT FK_Employees_Employees; ALTER TABLE C##dbo_Northwind.Orders ENABLE CONSTRAINT FK_Orders_Customers; ALTER TABLE C##dbo_Northwind.Orders ENABLE CONSTRAINT FK_Orders_Employees; ALTER TABLE C##dbo_Northwind.Products ENABLE CONSTRAINT FK_Products_Categories; ALTER TABLE C##dbo_Northwind.Products ENABLE CONSTRAINT FK_Products_Suppliers; ALTER TABLE C##dbo_Northwind.Order_Details ENABLE CONSTRAINT FK_Order_Details_Orders; ALTER TABLE C##dbo_Northwind.CustomerCustomerDemo ENABLE CONSTRAINT FK_CustomerCustomerDemo; ALTER TABLE C##dbo_Northwind.CustomerCustomerDemo ENABLE CONSTRAINT FK_CustomerCustomerDemo_Custom; ALTER TABLE C##dbo_Northwind.Territories ENABLE CONSTRAINT FK_Territories_Region; ALTER TABLE C##dbo_Northwind.EmployeeTerritories ENABLE CONSTRAINT FK_EmployeeTerritories_Employe; ALTER TABLE C##dbo_Northwind.Orders ENABLE CONSTRAINT FK_Orders_Shippers; ALTER TABLE C##dbo_Northwind.EmployeeTerritories ENABLE CONSTRAINT FK_EmployeeTerritories_Territo; ALTER TABLE C##dbo_Northwind.Order_Details ENABLE CONSTRAINT FK_Order_Details_Products; ALTER TABLE C##dbo_Northwind.Products ENABLE CONSTRAINT CK_UnitsOnOrder; ALTER TABLE C##dbo_Northwind.Products ENABLE CONSTRAINT CK_UnitsInStock; ALTER TABLE C##dbo_Northwind.Products ENABLE CONSTRAINT CK_ReorderLevel; ALTER TABLE C##dbo_Northwind.Products ENABLE CONSTRAINT CK_Products_UnitPrice; ALTER TABLE C##dbo_Northwind.Order_Details ENABLE CONSTRAINT CK_Quantity; ALTER TABLE C##dbo_Northwind.Order_Details ENABLE CONSTRAINT CK_Discount;
  • 29. ALTER TABLE C##dbo_Northwind.Order_Details ENABLE CONSTRAINT CK_UnitPrice; ALTER TRIGGER C##dbo_Northwind.Orders_OrderID_TRG ENABLE; ALTER TRIGGER C##dbo_Northwind.Products_ProductID_TRG ENABLE; ALTER TRIGGER C##dbo_Northwind.Suppliers_SupplierID_TRG ENABLE; ALTER TRIGGER C##dbo_Northwind.Shippers_ShipperID_TRG ENABLE; ALTER TRIGGER C##dbo_Northwind.CK_Birthdate_SYSDTRG ENABLE; ALTER TRIGGER C##dbo_Northwind.Categories_CategoryID_TRG ENABLE; ALTER TRIGGER C##dbo_Northwind.Employees_EmployeeID_TRG ENABLE; ~