Home > Workload Solutions > Oracle > Guides > Design Guide — Oracle Big Data SQL on Dell EMC PowerFlex > Loading TPCH Schema on Microsoft SQL Server
We loaded a TPCH schema on Microsoft SQL Server using these steps:
USE [master]
GO
/****** Object: Database [Titanium_SQL] Script Date: 1/4/2021 9:23:48 AM ******/
CREATE DATABASE [Titanium_SQL]
CONTAINMENT = NONE
ON PRIMARY
( NAME = N'Titanium_SQL', FILENAME = N'F:\MSSQL\Data1\Titanium_SQL.mdf' , SIZE = 274726912KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1048576KB ),
( NAME = N'Titanium_SQL2', FILENAME = N'G:\MSSQL\Data2\Titanium_SQL2.ndf' , SIZE = 273678336KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1048576KB ),
( NAME = N'Titanium_SQL3', FILENAME = N'I:\MSSQL\Data3\Titanium_SQL3.ndf' , SIZE = 273678336KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1048576KB )
LOG ON
( NAME = N'Titanium_SQL_log', FILENAME = N'H:\MSSQL\log\Titanium_SQL_log.ldf' , SIZE = 9240576KB , MAXSIZE = 2048GB , FILEGROWTH = 1048576KB )
WITH CATALOG_COLLATION = DATABASE_DEFAULT
GO
USE [Titanium_SQL]
GO
CREATE TABLE PARTSUPP
(PS_PARTKEY int not null,
PS_SUPPKEY int not null,
PS_AVAILQTY int not null,
PS_SUPPLYCOST float not null,
PS_COMMENT nvarchar(200) not null)
CREATE CLUSTERED COLUMNSTORE INDEX [CCS_PARTSUPP] ON [dbo].[PARTSUPP]
WITH (DROP_EXISTING = OFF, COMPRESSION_DELAY = 0, DATA_COMPRESSION = COLUMNSTORE)
GO
CREATE TABLE CUSTOMER
(C_CUSTKEY int not null,
C_NAME nvarchar(50) not null,
C_ADDRESS nvarchar(50) not null,
C_NATIONKEY nvarchar(50) not null,
C_PHONE nvarchar(50) not null,
C_ACCTBAL float not null,
C_MKTSEGMENT nvarchar(50) not null,
C_COMMENT nvarchar(150) not null)
CREATE CLUSTERED COLUMNSTORE INDEX [CCS_CUSTOMER] ON [dbo].[CUSTOMER]
WITH (DROP_EXISTING = OFF, COMPRESSION_DELAY = 0, DATA_COMPRESSION = COLUMNSTORE)
GO
SqlBulkCopy utility to load data to SQL Instance.
Run below mentioned script to load CSV data to Microsoft SQL Server Instance.
BULK INSERT Titanium_SQL..CUSTOMER FROM 'E:\SQL Tables\customer.tbl.1' with (FieldTerminator = '|', RowTerminator ='0x7C0A',tablock,ROWS_PER_BATCH=100000)
BULK INSERT Titanium_SQL..CUSTOMER FROM 'E:\SQL Tables\customer.tbl.2' with (FieldTerminator = '|', RowTerminator ='0x7C0A',tablock,ROWS_PER_BATCH=100000)
BULK INSERT Titanium_SQL..CUSTOMER FROM 'E:\SQL Tables\customer.tbl.3' with (FieldTerminator = '|', RowTerminator ='0x7C0A',tablock,ROWS_PER_BATCH=100000)
BULK INSERT Titanium_SQL..PARTSUPP FROM 'E:\SQL Tables\partsupp.tbl.1' with (FieldTerminator = '|', RowTerminator ='0x7C0A',tablock,ROWS_PER_BATCH=100000)
BULK INSERT Titanium_SQL..PARTSUPP FROM 'E:\SQL Tables\partsupp.tbl.2' with (FieldTerminator = '|', RowTerminator ='0x7C0A',tablock,ROWS_PER_BATCH=100000)
BULK INSERT Titanium_SQL..PARTSUPP FROM 'E:\SQL Tables\partsupp.tbl.3' with (FieldTerminator = '|', RowTerminator ='0x7C0A',tablock,ROWS_PER_BATCH=100000)