In this short article i will demonstrate how you can migrate/move data from a SQL Server database to a HP Vertica database in a single line of code. As we already know HP Vertica database is not handling very well OLTP transactional volumes and for this as a front end there will always be a database that will take care of the transactional jobs. in this case we have SQL Server doing this for us. Even thow you can use some ETL tools like Pentaho, Informatica, Talend and many more out there on the market to do the ETL process you can choose to build/write your own scripts that will do the job.
So how can we achieve this ? Here are the steps 1- Install the Microsoft Connectivity Pack and ADO.NET Driver on Windows 2- Replicate the table structure from SQL Server to HP VerticaSET NOCOUNT ON
SELECT * FROM dbo.TABLE_NAME
go
this script will do the E&T steps out of the ETL.(in this case we will do a simple select).
you can do all kind of stuff(transform) with the data while extracting it(getting it ready for Loading in Vertica).
5- Create the rest of the script that will load the data into Vertica database
vsql -h 11.111.1.11 -d db01 -U dbadmin -w db01 -c "COPY public.HD_BANCO FROM LOCAL STDIN
DELIMITER '|' ;"
sqlcmd -S SQL_Server_host.com -d SCHEMA_NAME -E -s"|" -W -ic:Usersadrian.opreaDownloads
query.sql | findstr /V /C:"-" /B
sqlcmd -S SQL_Server_host.com -d SCHEMA_NAME -E -s"|" -W -ic:Usersadrian.opreaDownloads
query.sql | findstr /V /C:"-" /B | vsql -h 11.111.1.11 -d db01 -U dbadmin -w db01 -c "COP
Y public.TABLE_NAME FROM LOCAL STDIN DELIMITER '|' ;"
sqlcmd -S SQL_Server_host.com -d SCHEMA_NAME -E -s"|" -W -ic:Usersadrian.opreaDownloads
query.sql | findstr /V /C:"-" /B | vsql -h 11.111.1.11 -d db01 -U dbadmin -w db01 -c "COP
Y public.TABLE_NAME FROM LOCAL STDIN DELIMITER '|' ;"
Rows Loaded
-------------
21
(1 row)